Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- **Laser pointer sound** (v53, PDF app and HTML overlay). Turning on the laser pointer now plays a short, quiet, low laser sound, so it is clear what just happened. Turning it off is silent.
- **Laser pointer** (v52, PDF app and HTML overlay). Tap the pen or highlighter color you already have selected, and its ring turns black, red, black. What you draw now stays for two seconds after you lift the pen, then fades away by itself. It is never saved, printed or added to Undo. Tap the color again, or pick another color or tool, to go back to writing. Your palm still erases.
- **Blue toolbar and pink eraser** (v51, PDF app and HTML overlay). The toolbar, its menus, Settings, the Timer and the Chapters / Find panel are now dark navy with light sky-blue buttons and black text, instead of black and yellow, to match the boat icon. The Eraser button is eraser pink. A selected tool has a white ring. Pen, highlighter and cover colors are unchanged.
- **New boat icon** (v48). The PDF app, the demo page and the "Board not working?" page now use the OverBoard sailboat icon in the browser tab, on the home screen and when installed. The PDF app's start screen shows it next to the OverBoard PDF title. The sail is a little smaller and sits a little higher than in the first version of the icon.
Expand Down
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OverBoard PDF</title>
<meta name="description" content="OverBoard: write on any PDF on your smartboard. Runs in the browser; nothing is uploaded.">
<meta name="ob-version" content="5b083e233d69">
<meta name="ob-version" content="a4543e5866fb">
<meta name="theme-color" content="#145da0">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="icons/favicon.ico" sizes="32x32">
Expand Down Expand Up @@ -47,7 +47,7 @@ <h2 data-t="open_again">Open again</h2>
<p class="note"><span data-th="start_note">Your PDF and your ink stay in this browser on this computer. Nothing is uploaded.
Have a Word file? In Word, choose File → Save as PDF, then drop the PDF here.
Have an HTML worksheet? Drop it here to get a <i>_board.html</i> copy you can write on.</span>
<br><a href="https://github.com/BPMData/OverBoard" data-t="about">About OverBoard</a> · <a href="report/?from=start" target="_blank" data-t="board_help">Board not working?</a> · <span id="ob-release" title="OverBoard version">v52</span></p>
<br><a href="https://github.com/BPMData/OverBoard" data-t="about">About OverBoard</a> · <a href="report/?from=start" target="_blank" data-t="board_help">Board not working?</a> · <span id="ob-release" title="OverBoard version">v53</span></p>
<p class="note ob-langpick"><label><span aria-hidden="true">🌐</span> <select id="ob-lang" aria-label="Language" data-ta="language" data-tt="language" title="Language"></select></label></p>
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ function laserReady() { return !T.erasing && !T.selecting && !T.typing && !(T.hi
function tapColor(c) {
const again = c === T.color && laserReady(), was = T.laser;
pickColor(c);
if (again) { T.laser = !was; setStatus(tr(T.laser ? 'st_laser_on' : 'st_laser_off')); }
if (again) { T.laser = !was; if (T.laser) ink.laser.sound(); setStatus(tr(T.laser ? 'st_laser_on' : 'st_laser_off')); }
}
function pickColor(c) {
T.color = c; T.laser = false;
Expand Down
2 changes: 1 addition & 1 deletion app/report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1 data-t="r_h1">Is OverBoard not working on your board?</h1>
<p data-th="r_intro2">If something doesn't work the way the page asks, that's fine. <b>That's exactly what I need to know.</b> Just keep going.</p>
<p class="mute small" data-th="r_privacy">Nothing is sent until you press <b>Send</b> at the very end, and you'll see everything first. No worksheets, PDFs or ink are ever included.</p>
<div class="row"><button class="go big" data-go="start" data-t="r_start">Start</button></div>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v52</span></p>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v53</span></p>
</div></div>
</section>

Expand Down
14 changes: 7 additions & 7 deletions app/sw.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// ===== GENERATED by tools/build.py: every file the app needs, with the start of its SHA-256. Do not edit by hand. =====
const VERSION = '67235d4523b7';
const VERSION = 'ad523d024e67';
const FILES = {
"../overlay/ink_overlay.html": "b36e22b0b1502928",
"../shared/ink-core.js": "272a7bb3b465f4fe",
"../overlay/ink_overlay.html": "ccbeec7f9a193362",
"../shared/ink-core.js": "b65c19035e241559",
"../shared/strings.js": "b247836e7165abf0",
"../shared/toolbar.css": "a611595b897560c5",
"app.css": "01f9300545b535ad",
Expand All @@ -17,14 +17,14 @@ const FILES = {
"icons/icon-512.png": "46ca8bd2d6a32612",
"icons/maskable-512.png": "c7d41ed2fa4ad874",
"image.js": "d396b7d4f5aced4e",
"index.html": "abcc33cde11b1fdf",
"index.html": "07e71eee1c4df161",
"ink.js": "3dc693cb202efe0c",
"libs.js": "c09f60186ab9029a",
"main.js": "8275dced3e07837c",
"main.js": "ed783dc63ed7a6dd",
"manifest.json": "416c107c34c8610b",
"notebook.js": "7346e40dda6ff149",
"offline.js": "6504935b2738711a",
"report/index.html": "6bee078f59f66287",
"report/index.html": "480150bf36208394",
"store.js": "155ec064f6ffe569",
"textlayer.js": "383ad22e91afb648",
"vendor/pdf-lib@1.17.1/LICENSE.md": "f2c9fc00fdb66eb9",
Expand Down Expand Up @@ -217,7 +217,7 @@ const FILES = {
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-BoldItalic.ttf": "a224075ac17495ad",
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-Italic.ttf": "832b4406dbef2362",
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-Regular.ttf": "f8ace1f892b2bd9d",
"version.json": "e055ceb95d13e895",
"version.json": "7b8de4a25ae70b82",
"viewer.js": "1cffd9d5c7158958"
};
// ===== END GENERATED =====
Expand Down
2 changes: 1 addition & 1 deletion app/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"v": "5b083e233d69",
"v": "a4543e5866fb",
"js": [
"embed.js",
"export.js",
Expand Down
25 changes: 22 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2>Exit ticket</h2>
<div class="lines"><div></div><div></div><div></div><div></div></div>
<div class="foot">OverBoard · page 2 / 2 · Your ink saves in this browser only. Nothing is uploaded.</div>
</div>
<!-- ===== INK OVERLAY START (v52) =====
<!-- ===== INK OVERLAY START (v53) =====
Smartboard writing layer. Paste this whole block just before </body> in any .html file.
SMART BOARD: pen tip writes. Palm, fist or side of hand erases (the board reports it as an eraser).
Finger (and the round end of the SMART pen) scrolls the page; the "Finger" button switches it to drawing if you lose the pen.
Expand Down Expand Up @@ -469,7 +469,7 @@ <h2>Exit ticket</h2>
lifts, then fades over LASER_FADE_MS. The canvas is hidden, and nothing runs, while there are no marks. */
var LASER_HOLD_MS = 2000, LASER_FADE_MS = 1000;
function makeLaser(){
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1;
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1, actx = null;
function fit(){ // cover the window exactly, even when the overlay's zoom scales everything inside the page
if (!el) {
el = document.createElement('canvas'); el.id = 'ob-laser'; el.setAttribute('aria-hidden', 'true');
Expand Down Expand Up @@ -501,7 +501,26 @@ <h2>Exit ticket</h2>
raf = requestAnimationFrame(tick);
}
function wake(){ dirty = true; if (!raf) raf = requestAnimationFrame(tick); }
/* a quiet "pew" when the laser turns on: one tone sliding quickly from high to low. No sound file needed. */
function sound(){
var C = window.AudioContext || window.webkitAudioContext;
if (!C) return;
try {
if (!actx) actx = new C();
if (actx.state === 'suspended') actx.resume();
var t = actx.currentTime + 0.01, o = actx.createOscillator(), v = actx.createGain();
o.type = 'square';
o.frequency.setValueAtTime(900, t);
o.frequency.exponentialRampToValueAtTime(110, t + 0.38);
v.gain.setValueAtTime(0.0001, t);
v.gain.exponentialRampToValueAtTime(0.04, t + 0.01);
v.gain.exponentialRampToValueAtTime(0.0001, t + 0.4);
o.connect(v); v.connect(actx.destination);
o.start(t); o.stop(t + 0.42);
} catch(e){} // no sound is fine: the ring and the status line still say the laser is on
}
return {
sound: sound,
/* x, y: screen px; w: line width in screen px; soft: see-through, for the highlighter */
down: function(x, y, c, w, soft){
fit(); sx = window.pageXOffset; sy = window.pageYOffset;
Expand Down Expand Up @@ -2704,7 +2723,7 @@ <h2>Exit ticket</h2>
function tapColor(c){
var again = c === color && laserReady(), was = laserOn;
pickColor(c);
if (again) { laserOn = !was; setStatus(tr(laserOn ? 'st_laser_on' : 'st_laser_off')); }
if (again) { laserOn = !was; if (laserOn) laser.sound(); setStatus(tr(laserOn ? 'st_laser_on' : 'st_laser_off')); }
}
function pickColor(c){
color = c; laserOn = false;
Expand Down
25 changes: 22 additions & 3 deletions overlay/ink_overlay.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- ===== INK OVERLAY START (v52) =====
<!-- ===== INK OVERLAY START (v53) =====
Smartboard writing layer. Paste this whole block just before </body> in any .html file.
SMART BOARD: pen tip writes. Palm, fist or side of hand erases (the board reports it as an eraser).
Finger (and the round end of the SMART pen) scrolls the page; the "Finger" button switches it to drawing if you lose the pen.
Expand Down Expand Up @@ -409,7 +409,7 @@
lifts, then fades over LASER_FADE_MS. The canvas is hidden, and nothing runs, while there are no marks. */
var LASER_HOLD_MS = 2000, LASER_FADE_MS = 1000;
function makeLaser(){
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1;
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1, actx = null;
function fit(){ // cover the window exactly, even when the overlay's zoom scales everything inside the page
if (!el) {
el = document.createElement('canvas'); el.id = 'ob-laser'; el.setAttribute('aria-hidden', 'true');
Expand Down Expand Up @@ -441,7 +441,26 @@
raf = requestAnimationFrame(tick);
}
function wake(){ dirty = true; if (!raf) raf = requestAnimationFrame(tick); }
/* a quiet "pew" when the laser turns on: one tone sliding quickly from high to low. No sound file needed. */
function sound(){
var C = window.AudioContext || window.webkitAudioContext;
if (!C) return;
try {
if (!actx) actx = new C();
if (actx.state === 'suspended') actx.resume();
var t = actx.currentTime + 0.01, o = actx.createOscillator(), v = actx.createGain();
o.type = 'square';
o.frequency.setValueAtTime(900, t);
o.frequency.exponentialRampToValueAtTime(110, t + 0.38);
v.gain.setValueAtTime(0.0001, t);
v.gain.exponentialRampToValueAtTime(0.04, t + 0.01);
v.gain.exponentialRampToValueAtTime(0.0001, t + 0.4);
o.connect(v); v.connect(actx.destination);
o.start(t); o.stop(t + 0.42);
} catch(e){} // no sound is fine: the ring and the status line still say the laser is on
}
return {
sound: sound,
/* x, y: screen px; w: line width in screen px; soft: see-through, for the highlighter */
down: function(x, y, c, w, soft){
fit(); sx = window.pageXOffset; sy = window.pageYOffset;
Expand Down Expand Up @@ -2644,7 +2663,7 @@
function tapColor(c){
var again = c === color && laserReady(), was = laserOn;
pickColor(c);
if (again) { laserOn = !was; setStatus(tr(laserOn ? 'st_laser_on' : 'st_laser_off')); }
if (again) { laserOn = !was; if (laserOn) laser.sound(); setStatus(tr(laserOn ? 'st_laser_on' : 'st_laser_off')); }
}
function pickColor(c){
color = c; laserOn = false;
Expand Down
21 changes: 20 additions & 1 deletion shared/ink-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function liveLift(s, x, y){
lifts, then fades over LASER_FADE_MS. The canvas is hidden, and nothing runs, while there are no marks. */
var LASER_HOLD_MS = 2000, LASER_FADE_MS = 1000;
function makeLaser(){
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1;
var el = null, g = null, marks = [], cur = null, raf = 0, dirty = false, sx = 0, sy = 0, d = 1, actx = null;
function fit(){ // cover the window exactly, even when the overlay's zoom scales everything inside the page
if (!el) {
el = document.createElement('canvas'); el.id = 'ob-laser'; el.setAttribute('aria-hidden', 'true');
Expand Down Expand Up @@ -195,7 +195,26 @@ function makeLaser(){
raf = requestAnimationFrame(tick);
}
function wake(){ dirty = true; if (!raf) raf = requestAnimationFrame(tick); }
/* a quiet "pew" when the laser turns on: one tone sliding quickly from high to low. No sound file needed. */
function sound(){
var C = window.AudioContext || window.webkitAudioContext;
if (!C) return;
try {
if (!actx) actx = new C();
if (actx.state === 'suspended') actx.resume();
var t = actx.currentTime + 0.01, o = actx.createOscillator(), v = actx.createGain();
o.type = 'square';
o.frequency.setValueAtTime(900, t);
o.frequency.exponentialRampToValueAtTime(110, t + 0.38);
v.gain.setValueAtTime(0.0001, t);
v.gain.exponentialRampToValueAtTime(0.04, t + 0.01);
v.gain.exponentialRampToValueAtTime(0.0001, t + 0.4);
o.connect(v); v.connect(actx.destination);
o.start(t); o.stop(t + 0.42);
} catch(e){} // no sound is fine: the ring and the status line still say the laser is on
}
return {
sound: sound,
/* x, y: screen px; w: line width in screen px; soft: see-through, for the highlighter */
down: function(x, y, c, w, soft){
fit(); sx = window.pageXOffset; sy = window.pageYOffset;
Expand Down
15 changes: 15 additions & 0 deletions tests/laser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ test.describe('HTML overlay', () => {
expect((await savedInk(page))?.periods.P1 || []).toHaveLength(0);
});

test('a short sound plays when the laser turns on, and not when it turns off', async ({ page }) => {
await page.evaluate(() => {
const make = BaseAudioContext.prototype.createOscillator;
window.__tones = 0;
BaseAudioContext.prototype.createOscillator = function () { window.__tones++; return make.call(this); };
});
const tones = () => page.evaluate(() => window.__tones);
await swatch(page, '#1565c0').click(); // just picking a color is silent
expect(await tones()).toBe(0);
await swatch(page, '#1565c0').click(); // on
expect(await tones()).toBe(1);
await swatch(page, '#1565c0').click(); // off
expect(await tones()).toBe(1);
});

test('tap again, another color or another tool goes back to writing', async ({ page }) => {
await swatch(page, '#e0218a').click();
await swatch(page, '#e0218a').click();
Expand Down
Loading