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** (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.
- **"Save notebook…" for blank notebooks** (v46, PDF app). In a notebook started from the start screen, the button that reads **Save ink into PDF…** for other PDFs now reads **Save notebook…**, and its window explains that the notebook is only kept in this browser until you save it as a real file. The file keeps the notebook's own name (no `_board`). Reopened in OverBoard, it's still a notebook: your writing comes back and you can keep adding pages. Once saving is on, the button shows **Saving into PDF ✓** as before.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The ink tool that ships with a lot of classroom smartboards draws on a see-throu
- **Highlighter** that sits behind the printed text, so words stay readable
- **Cover**: tap the **▾** beside Highlighter and pick a cover to black out answers; wipe it away with your palm to reveal them. The same menu sets **highlight strength** (10–100%)
- **Select**: circle ink with the pen (or tap one mark), then **send a copy to another class period**, copy and paste it onto another page, drag it somewhere else, or delete it. A dashed blue box shows what's selected, with its menu beside it (a right-click on the box opens it too)
- **Laser pointer**: tap the pen or highlighter color you already have selected (its ring turns black, red, black) and what you draw fades away by itself a few seconds later. Tap it again to go back to writing
- **Undo and Redo** (↶ ↷ on the toolbar, or Ctrl/⌘+Z and Ctrl/⌘+Y, Ctrl/⌘+R or Ctrl/⌘+Shift+Z). Reloading from the keyboard is turned off, so a slip can't throw away the page
- **8 colors + a custom color picker**, pen size and smoothing controls (hold − / + to repeat)
- **Separate ink for each class period** on the same worksheet: P1–P4 to start, or set your own in **Settings & help ▸ Settings…** (1–12 periods, any names)
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="1f191617e962">
<meta name="ob-version" content="5b083e233d69">
<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">v51</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">v52</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
16 changes: 15 additions & 1 deletion app/ink.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// so zooming never moves ink. o: 1 marks a cover (an opaque highlighter stroke): it is drawn on the pen
// layer, above the page and its text, instead of multiplied underneath.

import { textAt, selectTo, clearTextSel, copyTextSel, seeThrough, isNote, notesGone, pointerKind, paintStroke, liveStart, liveAdd, livePieces, liveEndPieces, paintPieces, liveLift } from '../shared/ink-core.js';
import { makeLaser, textAt, selectTo, clearTextSel, copyTextSel, seeThrough, isNote, notesGone, pointerKind, paintStroke, liveStart, liveAdd, livePieces, liveEndPieces, paintPieces, liveLift } from '../shared/ink-core.js';
import { GUTTER } from './viewer.js';

export const PT_PER_UNIT = 0.75; // toolbar sizes are in 1/96 in (CSS px at 100%), like the overlay; ink is stored in points
Expand All @@ -25,6 +25,8 @@ export class Ink {
this.typing = null; // the Type tool (makeTyping), set by main.js
this.selP = null; // the page a Select gesture started on
this.pv = null; // { page, hide, add }: a selection being dragged, drawn in its new spot
this.laser = makeLaser(); // laser pointer marks: they fade away and are never ink
this.pointing = false; // a laser mark is being drawn
}

/* for a moment, let the PDF's text be found under the pen (Type: drag on text to select it) */
Expand Down Expand Up @@ -167,6 +169,11 @@ export class Ink {
if (typing) { clearTextSel(); this.drag.text = textAt(e.clientX, e.clientY, this.unblock); } // starting on the PDF's text: select it
e.preventDefault(); return;
}
if (T.laser && kind !== 'palm') { // the palm still erases
this.pointing = true;
this.laser.down(e.clientX, e.clientY, T.hiliting ? T.hlInk() : T.color, (T.hiliting ? T.hlWidth : T.width) * PT_PER_UNIT * this.v.zoom, T.hiliting);
e.preventDefault(); return;
}
const el = e.target.closest('.pg');
if (!el) { this.active = null; return; }
const P = el._P, q = this.pt(e, P), z = this.v.zoom;
Expand Down Expand Up @@ -201,6 +208,12 @@ export class Ink {
this.drag.x = e.screenX; this.drag.y = e.screenY;
e.preventDefault(); return;
}
if (this.pointing) {
let evs = e.getCoalescedEvents ? e.getCoalescedEvents() : null;
if (!evs || !evs.length) evs = [e];
for (const ev of evs) this.laser.move(ev.clientX, ev.clientY);
e.preventDefault(); return;
}
if (this.selP) {
let evs = e.getCoalescedEvents ? e.getCoalescedEvents() : null;
if (!evs || !evs.length) evs = [e];
Expand Down Expand Up @@ -235,6 +248,7 @@ export class Ink {
if (a) a.click();
return;
}
if (this.pointing) { this.pointing = false; this.laser.up(); return; }
if (this.selP) {
const P = this.selP; this.selP = null;
if (e.type === 'pointerup') { const q = this.pt(e, P); this.sel.up(q[0], q[1], e.clientX, e.clientY); } else this.sel.cancel();
Expand Down
22 changes: 16 additions & 6 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Everything runs in this browser tab. Nothing is uploaded.

import { obLangs, obLang, obT, obTranslate } from '../shared/strings.js';
import { makeTimer, paletteColors, setPalette, fitTools, makePopMenu, historyKey, hlInk, makeHlMenu, holdRepeat, confirmTap, flashBtn, makePeriodPicker, makeSettings, loadPeriods, startPen, remapPeriods, makeSelect, makeTyping } from '../shared/ink-core.js';
import { showLaser, makeTimer, paletteColors, setPalette, fitTools, makePopMenu, historyKey, hlInk, makeHlMenu, holdRepeat, confirmTap, flashBtn, makePeriodPicker, makeSettings, loadPeriods, startPen, remapPeriods, makeSelect, makeTyping } from '../shared/ink-core.js';
import { loadPdfjs, PDFJS_CMAPS_URL, PDFJS_FONTS_URL } from './libs.js';
import { Viewer } from './viewer.js';
import { Ink, PT_PER_UNIT } from './ink.js';
Expand Down Expand Up @@ -45,6 +45,7 @@ const isHex = (c) => /^#[0-9a-f]{6}$/i.test(c || '');
/* ---------- tool state (read by the ink layer) ---------- */
const T = {
typing: false, erasing: false, hiliting: false, covering: false, // covering: the highlighter is in Cover mode
laser: false, // laser pointer: tap the selected color again, and marks fade away by themselves
selecting: false, // the Select tool: the pen circles ink instead of writing
penColor: PEN_COLOR, hlColor: HIGHLIGHT_COLOR, coverColor: COVER_COLOR, // pen, highlighter and cover each remember their own color
color: PEN_COLOR, width: 2.5, hlWidth: HIGHLIGHT_W, smooth: SMOOTHING, fingerScrolls: FINGER_SCROLLS,
Expand Down Expand Up @@ -592,10 +593,10 @@ const settings = makeSettings({
return true;
},
tools: () => ({ finger: T.fingerScrolls, width: T.width, smooth: T.smooth, hlColor: T.hlColor, hlStrength: T.hlStrength }),
setPen(c) { T.penColor = c; if (!T.hiliting) T.color = c; T.erasing = false; if (T.typing) typing.restyle(); refresh(); },
setPen(c) { T.penColor = c; if (!T.hiliting) T.color = c; T.erasing = false; T.laser = false; if (T.typing) typing.restyle(); refresh(); },
resetTools() {
Object.assign(T, { width: 2.5, hlWidth: HIGHLIGHT_W, hlColor: HIGHLIGHT_COLOR, customColor: '', covering: false, hlStrength: HIGHLIGHT_STRENGTH,
coverColor: COVER_COLOR, smooth: SMOOTHING, fingerScrolls: FINGER_SCROLLS, penColor: PEN_COLOR, erasing: false });
coverColor: COVER_COLOR, smooth: SMOOTHING, fingerScrolls: FINGER_SCROLLS, penColor: PEN_COLOR, erasing: false, laser: false });
T.color = toolColor(); refresh();
},
onOpen: () => { closeMenus(); timer.syncSound(); },
Expand Down Expand Up @@ -626,6 +627,7 @@ const isPreset = (c) => !!bar.querySelector('[data-color="' + c + '"]');
function refresh() {
setPalette(bar, T.hiliting ? (T.covering ? 'cover' : 'hl') : 'pen', tr); // the swatches change with the tool
for (const b of bar.querySelectorAll('[data-color]')) b.classList.toggle('on', !T.erasing && b.dataset.color === T.color);
showLaser(bar, T.laser, laserReady(), tr);
$('[data-act="custom"]', bar).classList.toggle('on', !T.erasing && !!T.customColor && T.color === T.customColor && !isPreset(T.color));
customFill.style.background = T.customColor || 'transparent';
const w = T.hiliting ? T.hlWidth : T.width, shown = T.hiliting && !T.covering ? T.hlInk() : T.color;
Expand All @@ -652,8 +654,15 @@ function typeOn() {
}
function selectOff() { if (T.selecting) { T.selecting = false; ink.dropSel(); } }
function toolColor() { return T.hiliting ? (T.covering ? T.coverColor : T.hlColor) : T.penColor; }
function laserReady() { return !T.erasing && !T.selecting && !T.typing && !(T.hiliting && T.covering); } // pen and highlighter colors only
/* a tap on a color swatch: the color you already have selected turns the laser pointer on or off; any other color just picks it */
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')); }
}
function pickColor(c) {
T.color = c;
T.color = c; T.laser = false;
if (T.hiliting && T.covering) { T.coverColor = c; setLS('ink-cover-color', c); }
else if (T.hiliting) { T.hlColor = c; setLS('ink-hl-color', c); } else T.penColor = c;
T.erasing = false; selectOff(); if (T.typing) typing.restyle(); refresh();
Expand Down Expand Up @@ -703,7 +712,7 @@ const hlMenu = makeHlMenu(bar, T, () => {
setLS('ink-hl-mode', T.covering ? 'cover' : 'hl');
setLS('ink-hl-strength', T.hlStrength);
if (T.covering) setLS('ink-cover-color', T.coverColor);
typeOff(); T.hiliting = true; T.erasing = false; selectOff(); T.color = toolColor(); refresh();
typeOff(); T.hiliting = true; T.erasing = false; T.laser = false; selectOff(); T.color = toolColor(); refresh();
}, () => closeMenus('hl'));
for (const m of [fileMenu, clearMenu.el]) m.addEventListener('click', (e) => {
const b = e.target.closest('button'); if (!b) return;
Expand All @@ -717,7 +726,8 @@ for (const m of [fileMenu, clearMenu.el]) m.addEventListener('click', (e) => {
bar.addEventListener('click', onToolbarClick);
function onToolbarClick(e) {
const b = e.target.closest('button'); if (!b) return;
if (b.dataset.color) pickColor(b.dataset.color);
if (/^(type|erase|hilite|select)$/.test(b.dataset.act)) T.laser = false; // another tool puts the laser pointer away
if (b.dataset.color) tapColor(b.dataset.color);
else if (b.dataset.period !== undefined) { if (ink.switchTo(b.dataset.period)) renderPeriods(); }
else switch (b.dataset.act) {
case 'type': if (T.typing) typeOff(); else typeOn(); break;
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">v51</span></p>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v52</span></p>
</div></div>
</section>

Expand Down
20 changes: 10 additions & 10 deletions app/sw.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ===== GENERATED by tools/build.py: every file the app needs, with the start of its SHA-256. Do not edit by hand. =====
const VERSION = '8db00c515759';
const VERSION = '67235d4523b7';
const FILES = {
"../overlay/ink_overlay.html": "c55fd5171f4aab60",
"../shared/ink-core.js": "bd0ac55dbae6a3ea",
"../shared/strings.js": "4c0c63493dd62532",
"../shared/toolbar.css": "3d62c20ea472966f",
"../overlay/ink_overlay.html": "b36e22b0b1502928",
"../shared/ink-core.js": "272a7bb3b465f4fe",
"../shared/strings.js": "b247836e7165abf0",
"../shared/toolbar.css": "a611595b897560c5",
"app.css": "01f9300545b535ad",
"embed.js": "ea50a9ff4e960dd4",
"export.js": "eaec8736ffed97b7",
Expand All @@ -17,14 +17,14 @@ const FILES = {
"icons/icon-512.png": "46ca8bd2d6a32612",
"icons/maskable-512.png": "c7d41ed2fa4ad874",
"image.js": "d396b7d4f5aced4e",
"index.html": "ce988a0e5e7c1229",
"ink.js": "76142d82f12d37ca",
"index.html": "abcc33cde11b1fdf",
"ink.js": "3dc693cb202efe0c",
"libs.js": "c09f60186ab9029a",
"main.js": "fa607d2ba7d7680b",
"main.js": "8275dced3e07837c",
"manifest.json": "416c107c34c8610b",
"notebook.js": "7346e40dda6ff149",
"offline.js": "6504935b2738711a",
"report/index.html": "8363f612fa99d807",
"report/index.html": "6bee078f59f66287",
"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": "69825a788032a52b",
"version.json": "e055ceb95d13e895",
"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": "1f191617e962",
"v": "5b083e233d69",
"js": [
"embed.js",
"export.js",
Expand Down
Loading
Loading