Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

NumPlay Studio: say what NumPlay is, rank the games, real keys, no show

Mason36372c61ea72620
diff --git a/customize/app.css b/customize/app.css
index 36b44fc4..2be99496 100644
--- a/customize/app.css
+++ b/customize/app.css
@@ -1,22 +1,19 @@
:root {
--bg: #f2f1ef;
--ink: #1d1d1f;
- --mute: #6e737a;
+ --text: #5f5c56; /* (body text on --bg: 5.7 to 1) */
+ --mute: #6b6862;
--track: #e3e1dd;
--card: #ffffff;
--btn: #1d1d1f;
--btn-ink: #ffffff;
--line: #b9b6b0;
--blue: #0a84ff;
- --shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
+ --lift: drop-shadow(0 6px 9px rgba(0, 0, 0, 0.18));
--ease: cubic-bezier(0.2, 0.9, 0.25, 1);
- --spring: cubic-bezier(0.3, 1.5, 0.5, 1);
- --t: 210ms;
+ --t: 160ms;
/* the calculator, up close: wide enough that its screen and OK key fill the height of the window */
--cw: clamp(420px, min(calc((100vh - 24px) * 0.925), calc(60vw - 80px)), 880px);
- --plate-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1018 2000' preserveAspectRatio='none'%3E%3Cpath fill-rule='evenodd' d='M0 0H1018V2000H0Z M140 107H879A36 36 0 0 1 915 143V707A36 36 0 0 1 879 743H140A36 36 0 0 1 104 707V143A36 36 0 0 1 140 107Z'/%3E%3C/svg%3E");
- --star-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M41.68,12.87 L57.12,36.01 L84.64,32.00 L67.40,53.83 L79.73,78.77 L53.64,69.12 L33.73,88.54 L34.84,60.75 L10.22,47.82 L36.99,40.29Z' fill='black' stroke='black' stroke-width='14' stroke-linejoin='round'/%3E%3C/svg%3E");
- --star-foil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M41.68,12.87 L57.12,36.01 L84.64,32.00 L67.40,53.83 L79.73,78.77 L53.64,69.12 L33.73,88.54 L34.84,60.75 L10.22,47.82 L36.99,40.29Z' fill='black' stroke='black' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
@@ -35,368 +32,269 @@ a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
-/* ---- the page: NumPlay, yours, and its games on the left; the calculator, up close, on the right */
+/* ---- the page: what NumPlay is and its games on the left; the calculator, up close, on the right */
main {
display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--cw) + 96px);
grid-template-rows: auto 1fr; grid-template-areas: "head device" "games device";
min-height: 100vh;
}
-.head { grid-area: head; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; padding: 40px 32px 0 56px; }
+.head { grid-area: head; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 20px; padding: 40px 32px 0 56px; container-type: inline-size; }
.games { grid-area: games; display: flex; flex-direction: column; gap: 14px; padding: 30px 32px 28px 56px; max-width: 560px; }
-.title { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; display: flex; flex-direction: column; line-height: 0.95; }
-.title .word { font-size: clamp(52px, 5.4vw, 80px); font-weight: 800; letter-spacing: -0.045em; }
-.title .word { display: flex; }
-.title .word i { font-style: normal; display: inline-block; transition: transform 260ms var(--spring); }
-.title .word i.lift { transform: translateY(-0.12em); }
-.title:focus-visible { border-radius: 16px; }
-.chips { display: flex; gap: 8px; margin: 0 0 6px auto; }
-.lede { flex-basis: 100%; margin: 4px 0 0; min-height: 1.4em; font-size: 16px; font-weight: 550; color: #858279; transition: opacity 200ms var(--ease); }
-.lede.swap { opacity: 0; }
-.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13px; font-weight: 650; color: #858279; }
-.row-head .sub { font-weight: 500; }
-.retro .row-head { justify-content: flex-start; }
+.title { margin: 0; font-size: clamp(40px, calc((100cqw - 170px) / 4.3), 76px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
+.chips { display: flex; gap: 8px; }
+.lede { grid-column: 1 / -1; margin: 10px 0 0; max-width: 34em; font-size: 18px; line-height: 1.4; font-weight: 550; color: var(--ink); }
+.note { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--text); }
+.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; }
+.row-head:first-child { margin-top: 0; }
+.row-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.1px; }
+.row-head .sub { display: block; margin-top: 2px; font-size: 13px; color: var(--text); }
-/* ---- the game grids */
-.grid { display: grid; gap: 12px; }
-.grid.small { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 12px; }
-.grid.big { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
-.grid.big:empty { display: none; }
+/* ---- the game grids: the same size for every game, the best first */
+.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 12px; }
+.grid:empty { display: none; }
.app {
position: relative; border: 0; background: transparent; padding: 0; cursor: pointer;
-webkit-tap-highlight-color: transparent;
- transition: transform var(--t) var(--spring), opacity var(--t) var(--ease), translate 220ms var(--ease);
-}
-.app.placeholder { opacity: 0.25 !important; filter: grayscale(1); }
-.app.placeholder .badge { transform: scale(0) !important; }
-.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; border-radius: 18%; box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28); }
-.drag-ghost img { display: block; width: 100%; aspect-ratio: 55 / 56; border-radius: 18%; }
-/* while dragging, the other icons only slide aside: no hover, no other transition */
-body.dragging-icon .app { pointer-events: none; transition: translate 200ms cubic-bezier(0.2, 0.9, 0.25, 1) !important; }
-.app.held { outline: 2.5px solid var(--blue); outline-offset: 4px; border-radius: 18%; animation: wiggle 500ms ease-in-out infinite; }
-@keyframes wiggle { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
-body.dragging-icon, body.dragging-icon * { cursor: grabbing !important; user-select: none; }
-.app img {
- display: block; width: 100%; aspect-ratio: 55 / 56; border-radius: 18%;
- transition: box-shadow var(--t) var(--ease), filter var(--t) var(--ease);
- pointer-events: none; user-select: none;
+ transition: opacity var(--t) var(--ease), translate 200ms var(--ease);
}
+/* (the icons have their own rounded corners, so their shadow follows them, not a box) */
+.app img { display: block; width: 100%; aspect-ratio: 55 / 56; pointer-events: none; user-select: none; transition: filter var(--t) var(--ease); }
.app .badge {
position: absolute; right: -5px; top: -5px; width: 22px; height: 22px; border-radius: 11px;
- display: flex; align-items: center; justify-content: center;
- background: var(--blue); color: #ffffff; box-shadow: 0 0 0 2.5px var(--bg), 0 2px 4px rgba(0, 0, 0, 0.2);
- transform: scale(0); transition: transform 180ms var(--spring), background 120ms var(--ease);
-}
-.app .badge svg { width: 13px; height: 13px; color: #ffffff; }
-.app .badge .b-plus { display: none; }
-/* in: in colour, lifted, a blue tick */
-.app.on img { box-shadow: var(--shadow); }
-.app.on .badge { transform: scale(1); }
-/* out: grey and small; hovering shows a + but keeps it grey, so taking one out always shows */
-.app.off { transform: scale(0.9); opacity: 0.5; }
-.app.off img { filter: grayscale(0.85) contrast(0.9); }
-.app.off:hover { opacity: 0.78; transform: scale(0.93); }
-.app.off:hover .badge { transform: scale(1); background: #8e939a; }
-.app.off .badge .b-tick, .app.nofit .badge .b-tick { display: none; }
-.app.off .badge .b-plus { display: block; }
-.app.nofit { transform: scale(0.86); opacity: 0.22; }
+ display: none; align-items: center; justify-content: center;
+ background: var(--blue); color: #ffffff; box-shadow: 0 0 0 2.5px var(--bg);
+}
+.app .badge svg { width: 13px; height: 13px; }
+/* in: in colour, a blue tick; out: grey; doesn't fit: fainter */
+.app.on img { filter: var(--lift); }
+.app.on .badge { display: flex; }
+.app.off { opacity: 0.5; }
+.app.off img { filter: grayscale(0.85); }
+.app.off:hover { opacity: 0.75; }
+.app.nofit { opacity: 0.22; }
.app.nofit img { filter: grayscale(1); }
-.app.on:hover { transform: translateY(-2px); }
-.app:active { transform: scale(0.88); transition-duration: 80ms; }
-.app.bounce { animation: bounce 280ms var(--spring); }
-.app.shake { animation: shake 300ms var(--ease); }
-@keyframes bounce { 0% { transform: scale(0.84); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
-@keyframes shake {
- 0%, 100% { transform: translateX(0) scale(0.86); }
- 25% { transform: translateX(-5px) scale(0.86); }
- 50% { transform: translateX(4px) scale(0.86); }
- 75% { transform: translateX(-2px) scale(0.86); }
-}
+.app.placeholder { opacity: 0.25 !important; }
+.app.placeholder .badge { display: none; }
+.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; }
+.drag-ghost img { display: block; width: 100%; aspect-ratio: 55 / 56; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.28)); }
+/* while dragging, the other icons only slide aside */
+body.dragging-icon .app { pointer-events: none; }
+body.dragging-icon, body.dragging-icon * { cursor: grabbing !important; user-select: none; }
+.app.held { outline: 2.5px solid var(--blue); outline-offset: 4px; border-radius: 22%; }
-/* ---- the calculator, up close: its screen is the space, its OK key installs, a star sticker on it */
-.device { grid-area: device; position: sticky; top: 0; height: 100vh; overflow: hidden; align-self: start; perspective: 2400px; perspective-origin: 92% 30%; }
-/* a real calculator, built in 3D from its photo (--u is one of the photo's pixels): the front, with a hole
- where the screen is, the screen down in its recess, the recess's walls, rounded edges and sides, and the
- top (made by app.js, build3d). It turns a little toward the pointer (--rx, --ry) */
+/* ---- the calculator, up close: its screen is the space, OK installs, Back downloads, a star sticker on it */
+.device { grid-area: device; position: sticky; top: 0; height: 100vh; overflow: hidden; align-self: start; perspective: 2400px; perspective-origin: calc(40px + var(--cw) / 2) 30%; }
+/* a real calculator, built in 3D from its photo (--u is one of the photo's pixels): the front, with holes for
+ the screen and the keys; the screen down in its recess with the recess's walls; the keys standing up with
+ their sides; rounded edges, sides and top (app.js, build3d). It faces you, and turns a little toward the
+ pointer when it's over it (--rx, --ry) */
.calc {
position: absolute; left: 40px; top: 30px; width: var(--cw); aspect-ratio: 1018 / 2000; --u: calc(var(--cw) / 1018);
- transform-style: preserve-3d; transform-origin: 50% 24%; transform: rotateX(var(--rx, 2deg)) rotateY(var(--ry, -12deg));
+ transform-style: preserve-3d; transform-origin: 50% 24%; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.plate, .well, .body3d { position: absolute; inset: 0; }
-.plate { container-type: inline-size; pointer-events: none; }
-.plate > button, #screen { pointer-events: auto; }
-.calc, .well, .body3d { pointer-events: none; } /* (so a click on the sticker, lying on them, is the sticker's) */
-.sticker { pointer-events: auto; }
+.plate { container-type: inline-size; }
+.calc, .plate, .well, .body3d { pointer-events: none; } /* (so a click on the sticker or a key is theirs) */
+#screen, .sticker { pointer-events: auto; }
.calc-img, .well-img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
-.calc-img {
- clip-path: inset(0 2.947% 0 2.947%);
- -webkit-mask: var(--plate-mask) 0 0 / 100% 100% no-repeat; mask: var(--plate-mask) 0 0 / 100% 100% no-repeat;
-}
+.calc-img { clip-path: inset(0 2.947% 0 2.947%); -webkit-mask: var(--plate-mask) 0 0 / 100% 100% no-repeat; mask: var(--plate-mask) 0 0 / 100% 100% no-repeat; }
.well { transform: translateZ(calc(var(--u) * -14.6)); } /* (a hair under the sticker, which lies on it at 14) */
.well-img { clip-path: inset(5.35% 10.118% 62.85% 10.216% round calc(var(--u) * 36)); }
-.body3d, .fold, .sticker { transform-style: preserve-3d; }
+.body3d, .fold, .sticker, .key3d { transform-style: preserve-3d; }
.fold { position: absolute; top: 0; height: 100%; width: 0; transform-origin: 0 0; }
.facet { position: absolute; top: 0; height: 100%; display: block; }
.body3d .top { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; transform: rotateX(-90deg); display: block; }
-.body3d .rim { position: absolute; transform-origin: 0 0; display: block; }
-.cap { display: flex; gap: 2px; background: var(--track); border-radius: 999px; padding: 2px; }
-.cap button {
- border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer;
- font-size: 12px; font-weight: 650; color: #858279; white-space: nowrap;
- transition: background var(--t) var(--ease), color var(--t) var(--ease);
-}
-.cap button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
-/* OK, on the keypad (its key, 718,922 r 56 in the picture's pixels), with a tag under it */
-.ok-key {
- position: absolute; left: 65.03%; top: 43.3%; width: 11%; aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
- background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
- transition: background 120ms var(--ease), box-shadow 120ms var(--ease);
-}
-.ok-key::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; animation: okpulse 2.4s ease-out infinite; }
-.ok-key:hover { background: rgba(0, 0, 0, 0.04); }
-.ok-key:hover::after { animation: none; }
-.ok-key:active { background: rgba(0, 0, 0, 0.08); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.18); }
-.ok-key:focus-visible { outline-offset: 4px; border-radius: 50%; }
-@keyframes okpulse { 0% { box-shadow: 0 0 0 0 rgba(255, 183, 52, 0.7); } 70% { box-shadow: 0 0 0 1.8cqw rgba(255, 183, 52, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 183, 52, 0); } }
-.ok-tag {
- position: absolute; left: 50%; top: calc(100% + 1.3cqw); transform: translateX(-50%); white-space: nowrap;
- background: var(--btn); color: var(--btn-ink); font-size: max(13px, 1.75cqw); font-weight: 700; padding: 0.75cqw 1.5cqw; border-radius: 1cqw;
- transition: transform var(--t) var(--spring);
-}
-.ok-key:hover .ok-tag { transform: translateX(-50%) translateY(-1px) scale(1.04); }
-.ok-key.busy::after { animation: spin 700ms linear infinite; border: 0.35cqw solid #ffb734; border-right-color: transparent; inset: -0.6cqw; }
-.ok-key.busy .ok-tag { opacity: 0.6; }
-/* the .nwa itself: a small tag under Back, beside Install */
-.dl {
- position: absolute; left: 84.28%; top: calc(48.9% + 1.3cqw); transform: translateX(-50%); white-space: nowrap; cursor: pointer;
- display: flex; align-items: center; gap: 0.6cqw; border: 1px solid #d6d4cf; background: #ffffff; color: var(--ink);
- font-size: max(12px, 1.5cqw); font-weight: 650; padding: 0.7cqw 1.2cqw; border-radius: 1cqw;
- transition: transform var(--t) var(--spring), border-color var(--t) var(--ease);
-}
-.dl::before { content: ""; width: 1.1em; height: 1.1em; background: currentColor;
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; }
-.dl:hover { transform: translateX(-50%) translateY(-1px); border-color: #b9b6b0; }
-.dl.busy { opacity: 0.5; }
+.rim, .kwall { position: absolute; transform-origin: 0 0; display: block; }
+.keybed { position: absolute; display: block; background: #77777a; } /* (seen only in the gaps round the keys) */
+
+/* the keys: each its top, cut from the photo, standing on its sides (app.js, keys3d). OK and Back go in
+ under the pointer, as keys do */
+.key3d { position: absolute; transition: transform 90ms var(--ease); }
+.ktop { position: absolute; inset: 0; display: block; overflow: hidden; -webkit-mask: var(--key) 0 0 / 100% 100% no-repeat; mask: var(--key) 0 0 / 100% 100% no-repeat; }
+.ktop img { position: absolute; max-width: none; pointer-events: none; user-select: none; }
+.ok-key, .dl {
+ position: absolute; inset: 0; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer;
+ pointer-events: auto; -webkit-tap-highlight-color: transparent;
+}
+.key3d:has(> .ok-key:hover), .key3d:has(> .dl:hover) { transform: translateZ(calc(var(--u) * -3)); }
+.key3d:has(> .ok-key:active), .key3d:has(> .dl:active), .key3d.down { transform: translateZ(calc(var(--u) * -9)); }
+.ok-key:focus-visible, .dl:focus-visible { outline-offset: 4px; }
+.ok-key.busy, .dl.busy { cursor: progress; }
+/* what they do, printed on the plastic above them in the calculator's own amber, as its cut, copy and paste are */
+.legend { position: absolute; top: 41.2%; transform: translateX(-50%); font-size: calc(var(--u) * 25); font-weight: 700; color: #a8690a; white-space: nowrap; pointer-events: none; }
+.legend.ok { left: 70.53%; }
+.legend.back { left: 84.23%; }
+
/* GitHub: a die-cut star sticker of gold foil, stuck on the calculator by its screen: flat on the frame,
down the step into the screen's recess, and round the edge onto the side (app.js folds it, build3d).
Each piece shows its own part of one picture (.art, drawn by app.js's stickerRenderer), and the part
- round the edge peels up under the pointer (--b0 --b1 --b2, app.js) */
+ round the edge lifts off the side under the pointer (--b0 --b1 --b2, app.js) */
.sticker { position: absolute; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.sticker:focus-visible { outline-offset: 2px; border-radius: 8px; }
.leaf { position: absolute; top: 0; height: 100%; overflow: hidden; display: block; transform: translateZ(calc(var(--u) * 0.5)); } /* (a hair off the plastic, as a sticker is) */
.art, .shade { position: absolute; top: 0; width: var(--star); height: var(--star); display: block; }
/* each piece's light, darker as it turns away (app.js, shadeStar): over the sticker's own shape only */
.shade { -webkit-mask: var(--star-paper) center / 100% 100% no-repeat; mask: var(--star-paper) center / 100% 100% no-repeat; background-repeat: no-repeat; }
+
+/* the screen: the calculator's space, each game a block its size, and a game playing when you point at it */
.screen {
position: absolute; left: 14.538%; top: 7.7%; width: 70.923%; height: 27.1%;
background: #0c0d10; overflow: hidden; container-type: size;
}
-/* the glass over the screen: a soft reflection that moves as the calculator turns */
-.glass { position: absolute; inset: 0; z-index: 6; pointer-events: none;
- background: linear-gradient(112deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.07) 42%, rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0) 58%) var(--lx, 60%) 0 / 260% 100% no-repeat; }
.status {
position: absolute; left: 0; top: 0; right: 0; height: 7.5%;
background: #ffb734; color: #ffffff;
display: flex; align-items: center; justify-content: space-between; padding: 0 2.2cqw;
font-size: 4.6cqh; font-weight: 700; letter-spacing: 0.02em; z-index: 3; white-space: nowrap;
- transition: background var(--t) var(--ease);
}
.over .status { background: #ff453a; }
.battery { width: 5.6cqw; height: 3.6cqh; border: max(1px, 0.4cqh) solid #ffffff; border-radius: 1px; position: relative; display: block; flex-shrink: 0; }
-.battery i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 50%; background: #ffffff; display: block; transition: width var(--t) var(--ease); }
+.battery i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 50%; background: #ffffff; display: block; }
.map { position: absolute; left: 0; right: 0; top: 7.5%; bottom: 0; }
.tile {
position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden;
border: 1px solid rgba(0, 0, 0, 0.45);
- transition: left var(--t) var(--ease), top var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease),
- opacity var(--t) var(--ease), transform var(--t) var(--ease);
+ transition: left var(--t) var(--ease), top var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease);
}
-.tile.enter { opacity: 0; transform: scale(0.82); }
-.tile.leave { opacity: 0; transform: scale(0.82); pointer-events: none; }
-.tile img { display: block; height: auto; aspect-ratio: 55 / 56; border-radius: 18%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: width var(--t) var(--ease), opacity var(--t) var(--ease); }
+.tile img { display: block; height: auto; aspect-ratio: 55 / 56; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.tile b { color: #ffffff; font-size: 4.4cqh; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.tile.free { background: repeating-linear-gradient(135deg, #15171c 0 4px, #1b1e24 4px 8px); border-color: rgba(0, 0, 0, 0.6); }
-.preview { position: absolute; left: 0; right: 0; top: 7.5%; bottom: 0; z-index: 2; background: #000000; opacity: 0; transition: opacity 140ms var(--ease); pointer-events: none; }
+.preview { position: absolute; left: 0; right: 0; top: 7.5%; bottom: 0; z-index: 2; background: #000000; display: none; pointer-events: none; }
.preview img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
-.preview.show { opacity: 1; }
+.preview.show { display: block; }
.drop-hint {
- position: absolute; inset: 7.5% 0 0 0; z-index: 4; display: flex; align-items: center; justify-content: center;
+ position: absolute; inset: 7.5% 0 0 0; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1.5cqh;
color: #ffffff; background: rgba(10, 132, 255, 0.42); outline: 2px dashed rgba(255, 255, 255, 0.8); outline-offset: -6px;
- opacity: 0; pointer-events: none; transition: opacity 120ms var(--ease);
+ font-size: 6cqh; font-weight: 700; pointer-events: none;
}
-body.dragging .drop-hint { opacity: 1; }
+.drop-hint svg { width: 12cqh; height: 12cqh; }
+body.dragging .drop-hint { display: flex; }
+/* ---- your NumPlay's icon, name and language */
.chip {
- height: 46px; padding: 0 10px 0 9px; border: 0; border-radius: 23px; background: var(--card); cursor: pointer;
- display: flex; align-items: center; gap: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
- transition: transform var(--t) var(--spring);
-}
-.chip img { width: 28px; height: 28px; border-radius: 18%; outline: 1px solid rgba(0, 0, 0, 0.08); outline-offset: -1px; display: block; }
-.chip.lang span { font-size: 13px; font-weight: 750; min-width: 22px; text-align: center; }
-.chip .caret { color: var(--mute); transition: transform var(--t) var(--ease); }
-.chip[aria-expanded="true"] .caret { transform: rotate(180deg); }
+ height: 46px; padding: 0 12px 0 9px; border: 0; border-radius: 23px; background: var(--card); cursor: pointer;
+ display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); white-space: nowrap;
+ font-size: 14px; font-weight: 650;
+}
+.chip img { width: 28px; height: 28px; display: block; }
+.chip img.custom { clip-path: inset(0 round 22%); } /* (a picture of your own: the corners every icon has) */
+.chip.lang { padding: 0 12px 0 14px; font-size: 13px; font-weight: 750; }
+.chip .caret { color: var(--mute); flex-shrink: 0; }
+.chip:hover { background: #fafafa; }
.chip:disabled { opacity: 0.35; cursor: default; box-shadow: none; } /* (a game on its own: its own icon and language) */
-.chip:hover { transform: translateY(-2px); }
.install {
position: relative; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
background: var(--btn); color: var(--btn-ink); padding: 13px 30px; border-radius: 999px; font-size: 15px; font-weight: 600;
- transition: transform var(--t) var(--spring), opacity var(--t) var(--ease);
-}
-.install:hover { transform: scale(1.04); }
-.install:active { transform: scale(0.95); transition-duration: 80ms; }
-.install.busy span { opacity: 0; }
-.install.busy::after {
- content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
- border: 2.4px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 600ms linear infinite;
}
-@keyframes spin { to { transform: rotate(360deg); } }
-/* ---- the app's own settings: two small panels over the chips */
+.install:hover { background: #000000; }
.pop {
position: fixed; z-index: 25; width: 330px; background: var(--card); border-radius: 18px; padding: 16px;
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
- display: flex; flex-direction: column; gap: 14px; animation: rise 200ms var(--spring);
+ display: flex; flex-direction: column; gap: 14px;
}
.pop.narrow { width: 170px; padding: 8px; }
.pop-row { display: flex; align-items: center; gap: 10px; }
.pop-label { width: 66px; flex-shrink: 0; font-size: 12px; font-weight: 650; color: var(--mute); }
.icon-pick { display: flex; gap: 8px; }
-.icon-pick button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; position: relative; transition: transform var(--t) var(--spring); }
-.icon-pick button img { width: 100%; height: 100%; border-radius: 18%; display: block; outline: 1px solid rgba(0, 0, 0, 0.1); outline-offset: -1px; }
+.icon-pick button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22%; background: transparent; cursor: pointer; position: relative; }
+.icon-pick button img { width: 100%; height: 100%; display: block; }
.icon-pick button[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--blue); }
-.icon-pick button:hover { transform: translateY(-2px); }
.icon-pick .upload { border: 2px dashed var(--line); color: var(--mute); display: flex; align-items: center; justify-content: center; }
+.icon-pick .custom img { clip-path: inset(0 round 22%); }
.field { flex: 1; min-width: 0; height: 36px; border: 1px solid #d5d8dc; border-radius: 10px; padding: 0 10px; background: #f6f7f8; font-size: 14px; }
.field:focus { outline: 2px solid var(--blue); outline-offset: -1px; background: #ffffff; }
.segctl { display: flex; background: #eceef1; border-radius: 10px; padding: 3px; gap: 3px; }
-.segctl button { border: 0; background: transparent; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 650; color: var(--mute); cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
+.segctl button { border: 0; background: transparent; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 650; color: var(--mute); cursor: pointer; }
.segctl button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segctl.col { flex-direction: column; background: transparent; padding: 0; }
.segctl.col button { text-align: left; padding: 10px 12px; font-size: 14px; color: var(--ink); }
.segctl.col button[aria-checked="true"] { background: #eceef1; box-shadow: none; }
.tick { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--mute); white-space: nowrap; }
+/* ---- 1.94 MB or 6 MB */
+.cap { display: flex; gap: 2px; background: var(--track); border-radius: 999px; padding: 2px; flex-shrink: 0; }
+.cap button { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 650; color: var(--mute); white-space: nowrap; }
+.cap button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
#xl-pop { width: 360px; gap: 10px; }
.xl-title { font-size: 16px; }
.xl-text, .xl-warn { margin: 0; font-size: 13px; line-height: 1.45; color: #3a3d42; }
-.xl-warn { color: #a05a00; background: #fff4e0; border-radius: 10px; padding: 8px 10px; }
+.xl-warn { color: #8a4b00; background: #fff4e0; border-radius: 10px; padding: 8px 10px; }
.xl-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: #3a3d42; }
.xl-buttons { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
-.xl-guide { font-size: 13px; font-weight: 650; color: var(--blue); text-decoration: none; }
+.xl-guide { font-size: 13px; font-weight: 650; color: #0060c0; text-decoration: none; }
.xl-ok { padding: 10px 20px; font-size: 14px; }
-/* ---- Retro-Go: your games come in as cartridges, after a + cartridge */
+/* ---- Retro-Go: your own games, as cartridges */
.retro { display: flex; flex-direction: column; gap: 10px; }
-.carts-row { display: flex; flex-wrap: wrap; gap: 10px; }
+.retro .sub { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }
+.carts-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.retro input[type=file] { position: absolute; left: -9999px; }
.add-cart {
- width: 52px; height: 62px; border-radius: 5px 13px 5px 5px; border: 2px dashed var(--line); color: #858279; cursor: pointer;
- display: flex; align-items: center; justify-content: center;
- transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--spring), color var(--t) var(--ease);
+ height: 40px; padding: 0 16px 0 12px; border-radius: 20px; border: 1.5px dashed var(--line); color: var(--ink); cursor: pointer;
+ display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650;
}
-.add-cart:hover, body.dragging .add-cart { border-color: var(--ink); color: var(--ink); transform: translateY(-3px); }
-.add-cart:active { transform: scale(0.94); }
-.add-cart.shake { animation: shake 300ms var(--ease); }
+.add-cart svg { color: var(--mute); }
+.add-cart:hover, body.dragging .add-cart { border-color: var(--ink); background: rgba(0, 0, 0, 0.03); }
.carts { display: contents; }
.cart {
position: relative; width: 52px; height: 62px; border: 0; padding: 0; cursor: pointer;
border-radius: 5px 13px 5px 5px; display: flex; flex-direction: column; justify-content: flex-end;
box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
- transition: transform var(--t) var(--spring), opacity var(--t) var(--ease);
}
.cart .label { margin: 0 6px 10px; height: 26px; border-radius: 3px; color: #ffffff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cart .x {
position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 10px;
- background: var(--btn); color: var(--btn-ink); display: flex; align-items: center; justify-content: center;
- opacity: 0; transform: scale(0.6); transition: opacity 120ms var(--ease), transform 160ms var(--spring);
+ background: var(--btn); color: var(--btn-ink); display: none; align-items: center; justify-content: center;
}
-.cart:hover .x, .cart:focus-visible .x { opacity: 1; transform: scale(1); }
-.cart:hover { transform: translateY(-3px) rotate(-2deg); }
-.cart:active { transform: scale(0.92); transition-duration: 80ms; }
-.cart.enter { animation: slot 320ms var(--spring); }
-@keyframes slot { 0% { transform: translateY(-18px) scale(0.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
-
-/* ---- the intro: a few words, the calculator filling up, then the studio */
-.intro-skip {
- position: fixed; left: 50%; bottom: 28px; z-index: 30; transform: translateX(-50%); border: 0; cursor: pointer;
- background: rgba(29, 29, 31, 0.08); color: var(--mute); font-size: 13px; font-weight: 650; padding: 8px 16px; border-radius: 999px;
-}
-.ih { opacity: 0 !important; }
-body.intro { overflow: hidden; }
-body.intro .calc { z-index: 2; }
-.boot { position: absolute; inset: 7.5% 0 0 0; z-index: 4; background: #0c0d10; display: flex; align-items: center; justify-content: center; overflow: hidden; }
-.boot .crt { position: absolute; left: 0; right: 0; top: 50%; height: 1.2%; margin-top: -0.6%; background: #ffffff; transform: scaleX(0); box-shadow: 0 0 12px #ffffff; }
-.boot .splash { display: flex; flex-direction: column; align-items: center; gap: 2cqh; opacity: 0; }
-.boot .splash img { width: 24cqw; border-radius: 18%; box-shadow: 0 0 0 0.8cqw rgba(255, 255, 255, 0.08), 0 2cqh 5cqh rgba(0, 0, 0, 0.6); }
-.boot .splash b { color: #ffffff; font-size: 11cqh; font-weight: 800; letter-spacing: -0.03em; }
-.boot .splash span { color: #ffb734; font-size: 5cqh; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
-.drop-cart { position: fixed; z-index: 35; width: 52px; height: 62px; border-radius: 5px 13px 5px 5px; pointer-events: none; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12); }
-.drop-cart::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 10px; height: 26px; border-radius: 3px; background: var(--c); }
-.ghost-icon { position: fixed; z-index: 35; border-radius: 18%; pointer-events: none; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
-.press-ring { position: absolute; inset: 0; border-radius: 50%; border: 0.4cqw solid #ffb734; pointer-events: none; }
+.cart:hover .x, .cart:focus-visible .x { display: flex; }
/* ---- tooltip, toast and the install sheet */
.tip {
position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
background: rgba(29, 29, 31, 0.92); color: #ffffff; font-size: 12px; font-weight: 600; white-space: nowrap;
- padding: 6px 10px; border-radius: 8px; opacity: 0; transform: translateY(4px);
- transition: opacity 110ms var(--ease), transform 110ms var(--ease);
+ padding: 6px 10px; border-radius: 8px; display: none;
}
-.tip.show { opacity: 1; transform: none; }
-.tip small { font-weight: 500; opacity: 0.7; margin-left: 6px; }
+.tip.show { display: block; }
+.tip small { font-weight: 500; opacity: 0.75; margin-left: 6px; }
.toast {
- position: fixed; left: 50%; bottom: 28px; z-index: 45; transform: translate(-50%, 20px);
+ position: fixed; left: 50%; bottom: 28px; z-index: 45; transform: translateX(-50%);
background: var(--btn); color: var(--btn-ink); font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 999px;
- opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease), transform 220ms var(--spring);
- max-width: calc(100vw - 32px); text-align: center;
+ display: none; pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
-.toast.show { opacity: 1; transform: translate(-50%, 0); }
+.toast.show { display: block; }
.sheet {
position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
- background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
- animation: fade 160ms var(--ease);
-}
-.sheet-card {
- position: relative; width: min(390px, 100%); background: var(--card); color: var(--ink); border-radius: 22px; padding: 26px 26px 18px;
- box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); animation: rise 260ms var(--spring);
+ background: rgba(0, 0, 0, 0.32);
}
-.sheet-card h2 { margin: 0 0 18px; font-size: 19px; letter-spacing: -0.3px; }
+.sheet-card { position: relative; width: min(400px, 100%); background: var(--card); color: var(--ink); border-radius: 22px; padding: 26px 26px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
+.sheet-card h2 { margin: 0 0 18px; font-size: 19px; letter-spacing: -0.3px; padding-right: 30px; }
.sheet-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border: 0; border-radius: 15px; background: var(--track); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
-.steps li { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 550; }
+.steps li { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 550; line-height: 1.35; }
.step-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--track); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.install.wide { width: 100%; }
-.star-ask { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #fff7e0; text-decoration: none; font-size: 14px; font-weight: 600; transition: transform var(--t) var(--spring); }
-.star-ask:hover { transform: translateY(-1px); }
-@keyframes fade { from { opacity: 0; } }
-@keyframes rise { from { transform: translateY(14px) scale(0.97); opacity: 0; } }
+.star-ask { display: block; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #fff7e0; text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.4; }
+.star-ask:hover { background: #ffefc2; }
.foot { margin-top: auto; padding-top: 22px; font-size: 12px; color: var(--mute); display: flex; gap: 8px; }
.foot a { color: var(--mute); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.noscript { text-align: center; padding: 0 16px; }
-/* ---- narrow screens: NumPlay, yours, then the calculator, then the games */
+/* ---- narrow screens: what it is, then the calculator, then the games */
@media (max-width: 900px) {
:root { --cw: min(560px, calc(100vw - 32px)); }
main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "head" "device" "games"; }
.head { padding: 24px 16px 0; }
.games { padding: 8px 16px 24px; max-width: none; }
.device { position: relative; height: calc(var(--cw) * 1.1 + 30px); margin: 8px auto 0; width: calc(var(--cw) + 40px); perspective-origin: 50% 20%; }
- .calc { left: 20px; --ry: -8deg; }
+ .calc { left: 20px; }
.foot { justify-content: center; }
}
-@media (max-width: 600px) {
- .dl { font-size: 0; gap: 0; padding: 7px 8px; } /* (just the arrow, beside Install) */
- .dl::before { width: 14px; height: 14px; }
-}
-@media (max-width: 420px) {
- .grid.small { grid-template-columns: repeat(5, minmax(0, 1fr)); }
- .grid.big { grid-template-columns: repeat(6, minmax(0, 1fr)); }
- .chip { padding: 0 8px 0 7px; }
+@media (max-width: 520px) {
+ .head { grid-template-columns: 1fr; }
+ .title { font-size: 48px; }
+ .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pop { width: calc(100vw - 32px); }
}
-@media (prefers-reduced-motion: reduce) {
- :root { --t: 1ms; }
- .app.bounce, .app.shake, .cart.enter, .sheet, .sheet-card, .pop, .ok-key::after { animation: none; }
-}
diff --git a/customize/app.js b/customize/app.js
index 4121daa6..a955f448 100644
--- a/customize/app.js
+++ b/customize/app.js
@@ -120,7 +120,7 @@
// ------------------------------------------------------------------ drawing
const tiles = new Map(), buttons = new Map();
- let shownUsed = 0, tween = 0, previewing = null;
+ let shownUsed = 0, previewing = null;
function render() {
const list = items(), cap = capacity();
@@ -131,19 +131,18 @@
const free = cap - used;
const all = free > cap * 0.002 ? list.concat([{ key: '_free', name: 'Free', bytes: free, free: true }]) : list;
const laid = treemap(all, Math.max(cap, used));
- const map = $('#map'), seen = new Set(), first = !tiles.size;
- laid.forEach((t, i) => {
+ const map = $('#map'), seen = new Set();
+ laid.forEach((t) => {
let e = tiles.get(t.key);
const fresh = !e;
if (fresh) {
- e = el('div', 'tile enter');
+ e = el('div', 'tile');
if (t.icon) e.appendChild(el('img', '', { src: t.icon, alt: '', draggable: 'false' }));
if (t.tag) e.appendChild(el('b')).textContent = t.tag;
map.appendChild(e);
tiles.set(t.key, e);
if (t.id || t.rom) e.addEventListener('click', () => (t.rom ? removeRom(t.rom) : toggle(t.id)));
}
- e.classList.remove('leave');
e.classList.toggle('free', !!t.free);
e.style.left = (100 * t.x / W) + '%';
e.style.top = (100 * t.y / H) + '%';
@@ -162,31 +161,17 @@
const b = e.querySelector('b');
if (b) b.style.opacity = s >= 14 ? 1 : 0;
e.dataset.tip = (t.free ? 'Free' : t.name) + '|' + size(t.bytes);
- if (fresh) {
- if (first) { // (the first time, the blocks come in one after another, the biggest first)
- e.style.transitionDelay = (18 * i) + 'ms';
- setTimeout(() => { e.style.transitionDelay = ''; }, 18 * i + 400);
- }
- requestAnimationFrame(() => requestAnimationFrame(() => e.classList.remove('enter')));
- }
seen.add(t.key);
});
- for (const [k, e] of tiles) if (!seen.has(k)) { e.classList.add('leave'); tiles.delete(k); setTimeout(() => e.remove(), 260); }
+ for (const [k, e] of tiles) if (!seen.has(k)) { e.remove(); tiles.delete(k); }
$('#screen').classList.toggle('over', over);
$('#screen').setAttribute('aria-label', 'Space on the calculator: ' + size(used) + ' of ' + size(cap) + ', each game a block its size');
// the numbers
- const from = shownUsed, t0 = performance.now(), cancel = ++tween;
- const step = (now) => {
- if (cancel !== tween) return;
- const k = Math.min(1, Math.max(0, (now - t0) / 220)), e = 1 - Math.pow(1 - k, 3); // (a frame's time can be before t0)
- shownUsed = from + (used - from) * e;
- if (!previewing) $('#status-line').textContent = (shownUsed / MiB).toFixed(2) + ' OF ' + +(cap / MiB).toFixed(2) + ' MB';
- $('#battery').style.width = 'calc(' + Math.min(100, 100 * shownUsed / cap) + '% - 2px)';
- if (k < 1) requestAnimationFrame(step);
- };
- step(t0);
+ shownUsed = used;
+ if (!previewing) $('#status-line').textContent = (used / MiB).toFixed(2) + ' OF ' + +(cap / MiB).toFixed(2) + ' MB';
+ $('#battery').style.width = 'calc(' + Math.min(100, 100 * used / cap) + '% - 2px)';
// the icons, in the order they go in the launcher
for (const [id, b] of buttons) {
@@ -207,9 +192,14 @@
const s = solo(), file = s ? byId[s].alone.file : 'NumPlay.nwa';
for (const c of [$('#app-chip'), $('#lang-chip')]) c.disabled = !!s;
$('#download').setAttribute('aria-label', 'Download ' + file);
- $('#download').textContent = file;
+ $('#download').dataset.tip = 'Download ' + file;
$('#app-chip-icon').src = iconUrl();
+ $('#app-chip-icon').classList.toggle('custom', st.app.icon === 'custom');
+ $('#app-chip').dataset.tip = (s ? byId[s].title : st.app.name.trim() || 'No name') + '|its icon and name on your calculator, and how it opens';
+ $('#lang-chip').dataset.tip = LANGS[st.lang][1] + '|the language of its menus';
$('#lang-chip-label').textContent = LANGS[st.lang][0];
+ $('#space-note').textContent = st.cap === 'xl' ? 'Your calculator has 6 MB for apps, with Enlarged Extra Apps. Its screen shows what fits.'
+ : 'Your calculator has 1.94 MB for apps. Its screen shows what fits.';
renderCarts();
save();
}
@@ -221,7 +211,7 @@
have.add('c' + r.key);
if (box.querySelector('[data-k="c' + r.key + '"]')) continue;
const s = SYS[r.sys];
- const c = el('button', 'cart enter', { type: 'button', 'data-k': 'c' + r.key, 'aria-label': 'Remove ' + r.name });
+ const c = el('button', 'cart', { type: 'button', 'data-k': 'c' + r.key, 'aria-label': 'Remove ' + r.name });
c.style.background = s.shell;
c.dataset.tip = r.name + '|' + s.name + ', ' + size(r.bytes.length);
const lab = c.appendChild(el('span', 'label'));
@@ -230,7 +220,6 @@
c.appendChild(el('span', 'x')).innerHTML =
'<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="3.4" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>';
c.addEventListener('click', () => removeRom(r));
- c.addEventListener('animationend', () => c.classList.remove('enter'));
box.appendChild(c);
}
for (const c of box.querySelectorAll('.cart[data-k]')) if (!have.has(c.dataset.k)) c.remove();
@@ -260,38 +249,29 @@
}
// ------------------------------------------------------------------ picking
- function bump(e, cls) {
- if (!e) return;
- e.classList.remove('bounce', 'shake');
- void e.offsetWidth;
- e.classList.add(cls);
- setTimeout(() => e.classList.remove(cls), 320);
- }
function overflow(bytes) {
toast("That doesn't fit: " + size(bytes) + ' too much' + (st.cap === 'std' ? '. 6 MB can take more' : ''));
$('#screen').classList.add('over');
setTimeout(() => render(), 500);
}
function toggle(id, quiet) {
- const b = buttons.get(id), s = solo();
+ const s = solo();
if (st.picked.has(id)) {
st.picked.delete(id);
if (alone(id) && before) { st.picked = new Set(before); before = null; }
} else if (alone(id)) {
if (!s) before = ordered();
st.picked = new Set([id]);
- bump(b, 'bounce');
if (!quiet) {
toast(byId[id].title + ' fills the whole calculator, so it goes on its own. Pick it again to get your games back');
fetchBytes(KIT + 'apps/' + id + '.nwa.gz').catch(() => {});
}
} else {
- if (s) { bump(b, 'shake'); if (!quiet) toast(byId[s].title + ' takes the whole calculator. Pick it again to take it out'); return; }
- if (byId[id].xl && st.lang !== 'en') { bump(b, 'shake'); toast('The big games are in English: pick English to add them'); return; }
+ if (s) { if (!quiet) toast(byId[s].title + ' takes the whole calculator. Pick it again to take it out'); return; }
+ if (byId[id].xl && st.lang !== 'en') { toast('The big games are in English: pick English to add them'); return; }
const over = usedBytes() + flash(id) - capacity();
- if (over > 0) { bump(b, 'shake'); if (!quiet) overflow(over); return; }
+ if (over > 0) { if (!quiet) overflow(over); return; }
st.picked.add(id);
- bump(b, 'bounce');
if (!quiet) fetchObj(objPath(id)).catch(() => {}); // (ready by the time you install)
}
render();
@@ -310,7 +290,7 @@
const r = { key: ++romKey, sys, bytes, name: romName(f.name) };
const extra = (st.roms.length ? 0 : flash(rg.id) + ROM_HEAD) + romBytes(r);
const over = usedBytes() + extra - capacity();
- if (over > 0) { bump($('#drop'), 'shake'); overflow(over); continue; }
+ if (over > 0) { overflow(over); continue; }
st.roms.push(r);
fetchObj(objPath(rg.id)).catch(() => {});
}
@@ -356,7 +336,7 @@
function sortable(box) {
box.addEventListener('pointerdown', (e) => {
const b = e.target.closest('.app');
- if (!b || e.button || intro.on) return;
+ if (!b || e.button) return;
if (e.pointerType === 'touch') {
if (holding === b) { b.classList.remove('held'); holding = null; justDragged = true; return; }
if (holding && holding !== b) { // (a phone: the held icon goes where you tap)
@@ -424,7 +404,6 @@
// ------------------------------------------------------------------ remembering a pick
function save() {
- if (intro.on) return; // (the intro empties the calculator for a moment: not a pick to keep)
const a = st.app, p = new URLSearchParams();
p.set('games', ordered().join(','));
if (st.cap === 'xl') p.set('space', 'xl');
@@ -434,15 +413,15 @@
if (a.open === 'matrices') p.set('open', 'matrices' + (a.secret ? '-' + a.secret : '') + (a.hint ? '' : '-nohint'));
const h = p.toString();
try { history.replaceState(null, '', '#' + h); } catch (e) { /* (a file:// page) */ }
- store('numplay-studio', h);
- store('numplay-order', st.order.join(','));
+ store('numplay-studio2', h); // (2: since the games are ranked)
+ store('numplay-order2', st.order.join(',')); // (2: since the games are ranked)
}
function restore() {
let h = location.hash.slice(1);
- if (!h) h = store('numplay-studio') || '';
+ if (!h) h = store('numplay-studio2') || '';
const p = new URLSearchParams(h);
- const known = kit.games.filter((g) => g !== rg).map((g) => g.id);
- const saved = (store('numplay-order') || '').split(',').filter((id) => known.includes(id));
+ const known = kit.games.filter((g) => g !== rg).sort((a, b) => (a.xl - b.xl) || ((a.rank || 99) - (b.rank || 99))).map((g) => g.id);
+ const saved = (store('numplay-order2') || '').split(',').filter((id) => known.includes(id));
const linked = p.has('games') ? p.get('games').split(',').filter((id) => known.includes(id)) : null;
// the order: the link's picks first, in its order, then the rest as last time, then the kit's
st.order = [...new Set([...(linked || []), ...saved, ...known])];
@@ -685,6 +664,7 @@
async function go(btn, sheet) {
if (btn.classList.contains('busy')) return;
btn.classList.add('busy');
+ btn.parentNode.classList.add('down'); // (its key stays in while NumPlay is made)
try {
const out = await build();
download(out.bytes, out.file);
@@ -694,6 +674,7 @@
toast(/more than/.test(e.message) ? e.message : solo() ? "Couldn't get " + byId[solo()].alone.file + ', try again' : "Couldn't make NumPlay.nwa, try again");
} finally {
btn.classList.remove('busy');
+ btn.parentNode.classList.remove('down');
}
}
function prefetch() {
@@ -744,7 +725,7 @@
box.appendChild(b);
}
if (custom) {
- const b = el('button', '', { type: 'button', role: 'radio', 'aria-checked': st.app.icon === 'custom', 'aria-label': 'Your icon', 'data-tip': 'Your icon' });
+ const b = el('button', 'custom', { type: 'button', role: 'radio', 'aria-checked': st.app.icon === 'custom', 'aria-label': 'Your icon', 'data-tip': 'Your icon' });
b.appendChild(el('img', '', { src: custom.url, alt: '' }));
b.addEventListener('click', () => { st.app.icon = 'custom'; renderApp(); render(); });
box.appendChild(b);
@@ -793,181 +774,6 @@
openPop(pop, btn, true);
}
- // ------------------------------------------------------------------ the intro
- // The first time (and when the title is clicked): the calculator rises and boots, NumPlay's
- // letters come up off its keypad to make the title, the games fly into its screen one by one,
- // Retro-Go's cartridges drop into their slot, the star sticker goes on and OK presses itself.
- // The line under the title says what's happening; any key skips.
- const intro = { on: false, run: 0, anims: [], temps: [] };
- const OUT = 'cubic-bezier(0.2, 0.9, 0.25, 1)', SPRING = 'cubic-bezier(0.3, 1.45, 0.5, 1)';
- // where NumPlay's letters sit on the keypad (their alpha keys), in the calculator picture's pixels
- const LETTER_KEYS = [[340, 1474], [677, 1598], [172, 1474], [677, 1474], [857, 1354], [159, 1242], [509, 1722]];
- const LEDE = 'Free games for your NumWorks. Pick yours, then press OK.';
- let ledeTimer = 0;
- function caption(text) {
- const c = $('#caption');
- clearTimeout(ledeTimer);
- c.classList.add('swap');
- ledeTimer = setTimeout(() => { c.textContent = text || LEDE; c.classList.remove('swap'); }, 200);
- }
- function play(e, frames, opts) {
- const a = e.animate(frames, { fill: 'backwards', ...opts });
- intro.anims.push(a);
- e.classList.remove('ih');
- return a.finished.catch(() => {});
- }
- const temp = (e) => { intro.temps.push(e); return e; };
- const center = (r) => [r.left + r.width / 2, r.top + r.height / 2];
-
- async function playIntro() {
- if (intro.on || matchMedia('(prefers-reduced-motion: reduce)').matches) return;
- intro.on = true;
- const run = ++intro.run, alive = () => intro.on && intro.run === run;
- closePops(); hidePreview();
- scrollTo(0, 0);
- const target = ordered(), roms = st.roms;
- intro.restore = () => { st.picked = new Set(target); st.roms = roms; };
- st.picked = new Set(); st.roms = [];
- const body = document.body;
- body.classList.add('intro');
- const letters = [...document.querySelectorAll('.title .word i')];
- const hide = [$('#calc'), ...letters, $('#caption'), document.querySelector('.chips'), $('#star'),
- $('#install'), $('#download'), ...buttons.values(), ...document.querySelectorAll('.row-head'), $('#retro'), document.querySelector('.foot')];
- for (const e of hide) e.classList.add('ih');
- render();
- const skip = temp(el('button', 'intro-skip', { type: 'button' }));
- skip.textContent = 'Skip';
- skip.addEventListener('click', endIntro);
- body.appendChild(skip);
-
- // the calculator comes up, its screen off; it boots to NumPlay's splash
- const screen = $('#screen'), calc = $('#calc');
- const boot = temp(el('div', 'boot'));
- boot.innerHTML = '<i class="crt"></i><div class="splash"><img alt=""><b>NumPlay</b><span>free games</span></div>';
- boot.querySelector('img').src = KIT + 'variants/NumPlay.png';
- screen.appendChild(boot);
- previewing = 'intro';
- $('#status-line').textContent = '';
- await play(calc, [{ opacity: 0, translate: '0 55vh' }, { opacity: 1, offset: 0.3 }, { opacity: 1, translate: '0 0' }], { duration: 900, easing: OUT });
- if (!alive()) return;
- const crt = boot.querySelector('.crt'), splash = boot.querySelector('.splash');
- await play(crt, [{ transform: 'scaleX(0)', opacity: 1 }, { transform: 'scaleX(1)', opacity: 1 }], { duration: 170, easing: 'ease-in', fill: 'forwards' });
- play(crt, [{ transform: 'scaleX(1) scaleY(1)', opacity: 1 }, { transform: 'scaleX(1) scaleY(140)', opacity: 0 }], { duration: 320, easing: 'ease-out', fill: 'forwards' });
- $('#status-line').textContent = 'NUMPLAY';
- await play(splash, [{ opacity: 0, transform: 'scale(0.5)' }, { opacity: 1, transform: 'scale(1)' }], { duration: 460, delay: 140, easing: SPRING, fill: 'forwards' });
- if (!alive()) return;
-
- // NumPlay's letters come up off the keypad, key by key, and make the title
- const cr = calc.getBoundingClientRect(), k = cr.width / 1018;
- const flights = letters.map((key, i) => {
- const [kx, ky] = LETTER_KEYS[i], sx = cr.left + kx * k, sy = cr.top + ky * k;
- const [fx, fy] = center(key.getBoundingClientRect());
- const dx = sx - fx, dy = sy - fy, lift = Math.min(220, Math.abs(dy) * 0.3), d = 80 * i;
- return play(key, [
- { opacity: 0, transform: `translate(${dx}px, ${dy}px) scale(0.45) rotate(0deg)` },
- { opacity: 1, offset: 0.12, transform: `translate(${dx}px, ${dy - 20}px) scale(0.5) rotate(-8deg)` },
- { offset: 0.6, transform: `translate(${dx * 0.3}px, ${dy * 0.3 - lift}px) scale(0.9) rotate(${i % 2 ? 12 : -12}deg)` },
- { opacity: 1, transform: 'translate(0, 0) scale(1) rotate(0deg)' }], { duration: 860, delay: d, easing: OUT });
- });
- await Promise.all(flights);
- if (!alive()) return;
-
- // the games come in, then fly into the calculator, which fills up block by block
- caption('Free games for your NumWorks');
- play($('#caption'), [{ opacity: 0 }, { opacity: 1 }], { duration: 300, delay: 200 });
- const all = [...buttons.values()];
- all.forEach((b, i) => play(b, [{ opacity: 0, transform: 'translateY(22px) scale(0.5)' }, { opacity: 0.5, transform: 'translateY(0) scale(0.9)' }],
- { duration: 460, delay: 14 * i, easing: SPRING }));
- for (const h of document.querySelectorAll('.games .row-head')) if (!h.closest('#retro')) play(h, [{ opacity: 0 }, { opacity: 1 }], { duration: 400, delay: 300 });
- await wait(420 + 14 * all.length);
- if (!alive()) return;
- caption('Pick the ones you want');
- play(splash, [{ opacity: 1, transform: 'scale(1)' }, { opacity: 0, transform: 'scale(1.3)' }], { duration: 380, delay: 200, fill: 'forwards' });
- play(boot, [{ opacity: 1 }, { opacity: 0 }], { duration: 500, delay: 300, fill: 'forwards' });
- const map = $('#map');
- const step = Math.max(40, Math.min(100, 1300 / Math.max(target.length, 1)));
- for (const id of target) {
- if (!alive()) return;
- const b = buttons.get(id), from = b.getBoundingClientRect();
- st.picked.add(id);
- if (st.picked.size === 1) previewing = null;
- render();
- bump(b, 'bounce');
- const t = tiles.get(id), mr = map.getBoundingClientRect();
- if (!t) { await wait(step); continue; }
- const tx = mr.left + (parseFloat(t.style.left) + parseFloat(t.style.width) / 2) / 100 * mr.width;
- const ty = mr.top + (parseFloat(t.style.top) + parseFloat(t.style.height) / 2) / 100 * mr.height;
- const g = temp(el('img', 'ghost-icon', { src: KIT + 'icons/' + id + '.png', alt: '' }));
- Object.assign(g.style, { left: from.left + 'px', top: from.top + 'px', width: from.width + 'px', height: from.height + 'px' });
- body.appendChild(g);
- const [fx, fy] = center(from), dx = tx - fx, dy = ty - fy;
- play(g, [{ transform: 'translate(0, 0) scale(1) rotate(0)', opacity: 1 },
- { offset: 0.55, transform: `translate(${dx * 0.55}px, ${dy * 0.55 - 70}px) scale(0.85) rotate(${dx > 0 ? 18 : -18}deg)`, opacity: 1 },
- { transform: `translate(${dx}px, ${dy}px) scale(0.3) rotate(0)`, opacity: 0.2 }], { duration: 640, easing: 'cubic-bezier(0.5, 0, 0.2, 1)', fill: 'forwards' })
- .then(() => g.remove());
- await wait(step);
- }
- await wait(500);
- if (!alive()) return;
-
- // Retro-Go: three cartridges drop into its slot
- if (rg) {
- caption('Add your Game Boy, NES and Sega games');
- play($('#retro .row-head'), [{ opacity: 0 }, { opacity: 1 }], { duration: 300 });
- await play($('#retro'), [{ opacity: 0, transform: 'translateY(16px)' }, { opacity: 1, transform: 'none' }], { duration: 460, easing: OUT });
- const slot = $('#drop').getBoundingClientRect();
- const drops = [[SYS[1], -16, -40], [SYS[3], 10, 25], [SYS[4], -4, 50]].map(([sys, x, rot], i) => {
- const c = temp(el('i', 'drop-cart'));
- Object.assign(c.style, { left: slot.left + 'px', top: slot.top + 'px', background: sys.shell });
- c.style.setProperty('--c', sys.color);
- body.appendChild(c);
- return play(c, [{ opacity: 0, transform: `translate(${x}px, -${200 + 50 * i}px) rotate(${rot}deg)` }, { opacity: 1, offset: 0.25 },
- { opacity: 1, offset: 0.85, transform: 'translate(0, 0) rotate(0deg)' }, { opacity: 0, transform: 'translate(0, 6px) scale(0.9)' }],
- { duration: 820, delay: 150 * i, easing: 'cubic-bezier(0.35, 1.4, 0.55, 1)', fill: 'forwards' });
- });
- await Promise.all(drops);
- play($('#drop'), [{ transform: 'scale(1)' }, { transform: 'scale(1.08)', offset: 0.4 }, { transform: 'scale(1)' }], { duration: 360 });
- await wait(500);
- if (!alive()) return;
- }
-
- // the star sticker goes on, and OK presses itself
- caption('Press OK to install');
- const lift = calc.getBoundingClientRect().width / 1018 * 160; // (from above, onto the calculator)
- play($('#star'), [{ opacity: 0, transform: 'translateZ(' + lift + 'px) rotateZ(-30deg)' }, { opacity: 1, offset: 0.3 },
- { opacity: 1, transform: 'translateZ(0) rotateZ(0deg)' }], { duration: 620, easing: SPRING });
- play(document.querySelector('.chips'), [{ opacity: 0, transform: 'translateY(10px)' }, { opacity: 1, transform: 'none' }], { duration: 460, easing: OUT });
- play(document.querySelector('.foot'), [{ opacity: 0 }, { opacity: 1 }], { duration: 600 });
- const ok = $('#install');
- await play(ok, [{ opacity: 0 }, { opacity: 1 }], { duration: 300 });
- if (!alive()) return;
- await wait(300);
- await play(ok, [{ background: 'rgba(0, 0, 0, 0)', boxShadow: 'inset 0 0 0 rgba(0, 0, 0, 0)' },
- { background: 'rgba(0, 0, 0, 0.08)', boxShadow: 'inset 0 3px 8px rgba(0, 0, 0, 0.2)', offset: 0.3 },
- { background: 'rgba(0, 0, 0, 0)', boxShadow: 'inset 0 0 0 rgba(0, 0, 0, 0)' }], { duration: 420, easing: 'ease-out' });
- const ring = temp(el('i', 'press-ring'));
- ok.appendChild(ring);
- play($('#download'), [{ opacity: 0 }, { opacity: 1 }], { duration: 500 });
- await play(ring, [{ opacity: 0.9, transform: 'scale(1)' }, { opacity: 0, transform: 'scale(1.7)' }], { duration: 700, easing: 'ease-out', fill: 'forwards' });
- await wait(700);
- if (alive()) endIntro();
- }
- function endIntro() {
- if (!intro.on) return;
- intro.on = false;
- intro.run++;
- for (const a of intro.anims) a.cancel();
- for (const e of intro.temps) e.remove();
- intro.anims = []; intro.temps = [];
- for (const e of document.querySelectorAll('.ih')) e.classList.remove('ih');
- document.body.classList.remove('intro');
- previewing = null;
- if (intro.restore) intro.restore();
- caption('');
- store('numplay-intro', '1');
- render();
- }
-
// ------------------------------------------------------------------ the calculator in 3D, and its sticker
// The calculator is built from its photo (1018 by 2000 pixels; --u is one of them on the page): its front
// has a hole where the screen sits, down in a recess 14 deep, with the recess's walls round it; its long
@@ -1133,6 +939,87 @@
}
}
+ // The keys at the top of the keypad, where the photo has them (measured from it): the D-pad's cross with
+ // its corners rounded (a quadratic curve through each corner), OK and Back's circles, and pills.
+ const KEY_H = 14;
+ function roundPoly(pts, radii, n) {
+ const out = [];
+ pts.forEach((p, i) => {
+ const a = pts[(i + pts.length - 1) % pts.length], b = pts[(i + 1) % pts.length], r = radii[i];
+ const da = Math.hypot(a[0] - p[0], a[1] - p[1]), db = Math.hypot(b[0] - p[0], b[1] - p[1]);
+ const p1 = [p[0] + (a[0] - p[0]) * r / da, p[1] + (a[1] - p[1]) * r / da], p2 = [p[0] + (b[0] - p[0]) * r / db, p[1] + (b[1] - p[1]) * r / db];
+ for (let k = 0; k <= n; k++) {
+ const t = k / n, s = 1 - t;
+ out.push([s * s * p1[0] + 2 * s * t * p[0] + t * t * p2[0], s * s * p1[1] + 2 * s * t * p[1] + t * t * p2[1]]);
+ }
+ });
+ return out;
+ }
+ const circlePts = (cx, cy, r) => Array.from({ length: 40 }, (_, i) => [cx + r * Math.cos(i * Math.PI / 20), cy + r * Math.sin(i * Math.PI / 20)]);
+ const pill = (x0, y0, x1, y1, r) => roundPoly([[x0, y0], [x1, y0], [x1, y1], [x0, y1]], [r, r, r, r], 7);
+ // a shape as a mask (outlines in the photo's pixels, drawn on a canvas, w x h from x0, y0; evenodd: holes)
+ function maskOf(outlines, x0, y0, w, h, scale, evenodd) {
+ const c = el('canvas');
+ c.width = Math.ceil(w * scale); c.height = Math.ceil(h * scale);
+ const x = c.getContext('2d');
+ x.scale(scale, scale);
+ x.translate(-x0, -y0);
+ x.beginPath();
+ for (const pts of outlines) { pts.forEach(([px, py], i) => (i ? x.lineTo(px, py) : x.moveTo(px, py))); x.closePath(); }
+ x.fill(evenodd ? 'evenodd' : 'nonzero');
+ return 'url(' + c.toDataURL() + ')';
+ }
+ function keyOutlines() {
+ // (each taking in the dark edge the photo draws round it)
+ const cross = [[190.5, 794.5], [267.5, 794.5], [267.5, 885.5], [356.5, 885.5], [356.5, 958.5], [267.5, 958.5], [267.5, 1051.5], [190.5, 1051.5],
+ [190.5, 958.5], [100.5, 958.5], [100.5, 885.5], [190.5, 885.5]];
+ const white = [222, 222, 219];
+ // and the hole each sits in, 2 wider, so none of the photo's own edge is left on the front
+ const hole = cross.map(([x, y]) => [x + (x > 229 ? 2 : -2), y + (y > 922 ? 2 : -2)]);
+ const keys = [
+ { id: 'dpad', pts: roundPoly(cross, [23.5, 23.5, 7.5, 23.5, 23.5, 7.5, 23.5, 23.5, 7.5, 23.5, 23.5, 7.5], 6),
+ hole: roundPoly(hole, [25.5, 25.5, 5.5, 25.5, 25.5, 5.5, 25.5, 25.5, 5.5, 25.5, 25.5, 5.5], 6), side: white },
+ { id: 'home', pts: pill(438.5, 815.5, 578.5, 905.5, 44.5), hole: pill(436.5, 813.5, 580.5, 907.5, 46.5), side: [212, 148, 34] },
+ { id: 'power', pts: pill(438.5, 938.5, 578.5, 1028.5, 44.5), hole: pill(436.5, 936.5, 580.5, 1030.5, 46.5), side: [36, 36, 38] },
+ { id: 'ok', pts: circlePts(718, 923, 57), hole: circlePts(718, 923, 59), side: white },
+ { id: 'back', pts: circlePts(857.5, 923, 57), hole: circlePts(857.5, 923, 59), side: white },
+ ];
+ return keys.concat([160, 299, 439, 578, 718, 858].map((x, i) => ({ id: 'row' + i, pts: pill(x - 58.5, 1090.5, x + 58.5, 1169.5, 39.5),
+ hole: pill(x - 60.5, 1088.5, x + 60.5, 1171.5, 41.5), side: white })));
+ }
+ // each key: its top, cut from the photo, standing on its sides, a wall at each step of its outline lit by
+ // the calculator's light, darker down in its hole. Under them all, the dark of the keypad's bed. OK and
+ // Back carry Install and Download.
+ const KEY_DOWN = 10;
+ function keys3d(calc, keys) {
+ part(calc, 'i', 'keybed', { left: U(90), top: U(780), width: U(840), height: U(1220), transform: 'translateZ(' + U(-KEY_DOWN) + ')' });
+ for (const k of keys) {
+ const xs = k.pts.map((p) => p[0]), ys = k.pts.map((p) => p[1]);
+ const x0 = Math.floor(Math.min(...xs)) - 1, y0 = Math.floor(Math.min(...ys)) - 1;
+ const w = Math.ceil(Math.max(...xs)) + 1 - x0, h = Math.ceil(Math.max(...ys)) + 1 - y0;
+ const g = part(calc, 'div', 'key3d', { left: U(x0), top: U(y0), width: U(w), height: U(h) });
+ g.dataset.key = k.id;
+ k.pts.forEach(([x, y], i) => {
+ const [x2, y2] = k.pts[(i + 1) % k.pts.length], len = Math.hypot(x2 - x, y2 - y);
+ if (len < 0.01) return;
+ const phi = Math.atan2(y2 - y, x2 - x), n = [Math.sin(phi), -Math.cos(phi), 0]; // (facing out)
+ const deep = k.side.map((v) => Math.round(v * lit(n) * 0.45)), top = k.side.map((v) => Math.round(Math.min(255, v * lit(n))));
+ part(g, 'i', 'kwall', { left: U(x - x0), top: U(y - y0), width: U(len + 2), height: U(KEY_H + KEY_DOWN), // (over its neighbours: no seams)
+ transform: 'rotateZ(' + (phi * 180 / Math.PI).toFixed(2) + 'deg) translate3d(' + U(-1) + ', 0, ' + U(-KEY_DOWN) + ') rotateX(90deg)',
+ background: 'linear-gradient(rgb(' + deep.join(',') + '), rgb(' + top.join(',') + ') ' + (100 * KEY_DOWN / (KEY_H + KEY_DOWN)).toFixed(0) + '%, rgb(' + top.join(',') + '))' });
+ });
+ const top = part(g, 'i', 'ktop', { transform: 'translateZ(' + U(KEY_H) + ')' });
+ top.style.setProperty('--key', maskOf([k.pts], x0, y0, w, h, 3));
+ const img = el('img', '', { src: 'calculator.webp', alt: '', draggable: 'false' });
+ Object.assign(img.style, { left: U(-x0), top: U(-y0), width: U(1018), height: U(2000) });
+ top.appendChild(img);
+ }
+ for (const [key, b] of [['ok', $('#install')], ['back', $('#download')]]) {
+ calc.querySelector('.key3d[data-key="' + key + '"]').appendChild(b);
+ b.style.transform = 'translateZ(' + U(KEY_H + 0.5) + ')';
+ }
+ }
+
function build3d() {
const body = document.querySelector('.body3d'), star = $('#star');
// the rounded edges and the sides: the quarter circle in facets, then the side
@@ -1171,10 +1058,21 @@
transform: 'rotateZ(' + (phi * 180 / Math.PI).toFixed(2) + 'deg) rotateX(-90deg)',
background: 'linear-gradient(' + grey(n, 236) + ', ' + grey(n, 214) + ')' });
});
+ // the keys, standing up off the front, each a hole in its photo
+ const keys = keyOutlines();
+ keys3d(document.querySelector('#calc'), keys);
+ $('#calc').style.setProperty('--plate-mask', maskOf([[[0, 0], [1018, 0], [1018, 2000], [0, 2000]], pill(104, 107, 915, 743, 36)]
+ .concat(keys.map((k) => k.hole)), 0, 0, 1018, 2000, 2, true));
// the sticker: each piece shows its own span of the one artwork
const S = STAR;
Object.assign(star.style, { left: (100 * S.lip / 1018) + '%', top: (100 * S.top / 2000) + '%', width: U(S.edge - S.lip), height: U(S.size) });
star.style.setProperty('--star', U(S.size));
+ const paper = el('canvas');
+ paper.width = paper.height = 256;
+ const px = paper.getContext('2d');
+ starPath(px, 2.56, 1);
+ px.lineWidth = 14 * 2.56; px.lineJoin = 'round'; px.fill(); px.stroke();
+ star.style.setProperty('--star-paper', 'url(' + paper.toDataURL() + ')');
const art = (key) => {
const a = el('canvas', 'art');
a.width = a.height = ART;
@@ -1208,8 +1106,6 @@
shadeStar(0);
sticker.draw = stickerRenderer();
paintSticker();
- // (a click on any piece of it: GitHub)
- star.addEventListener('click', (e) => { e.preventDefault(); window.open(star.href, '_blank', 'noopener'); });
}
// how much light each piece of the sticker gets, as the part round the edge lifts (0 to 1)
function shadeStar(lift) {
@@ -1228,26 +1124,27 @@
}
}
- // The calculator turns a little toward the pointer. The light on the foil comes from where the pointer
- // is, and under the pointer the part of the sticker round the edge peels up off the side.
+ // The calculator faces you straight, and turns a little toward the pointer when it's on it. The light on
+ // the foil comes from where the pointer is, and under the pointer the part of the sticker round the edge
+ // peels up off the side.
function depth() {
if (matchMedia('(prefers-reduced-motion: reduce)').matches) return;
- const calc = $('#calc'), star = $('#star'), REST = [0, -0.08];
- let mx = innerWidth * 0.6, my = innerHeight * 0.2, tx = REST[0], ty = REST[1], x = tx, y = ty;
+ const calc = $('#calc'), star = $('#star'), dev = document.querySelector('.device');
+ let mx = innerWidth * 0.6, my = innerHeight * 0.2, tx = 0, ty = 0, x = 0, y = 0;
let over = false, lift = 0, raf = 0;
const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
const draw = () => {
raf = 0;
x += (tx - x) * 0.07; y += (ty - y) * 0.07;
- calc.style.setProperty('--ry', (-12 + x * 14).toFixed(2) + 'deg');
- calc.style.setProperty('--rx', (2 - y * 6).toFixed(2) + 'deg');
- calc.style.setProperty('--lx', (100 - (x + 0.5) * 100).toFixed(1) + '%');
+ calc.style.setProperty('--ry', (x * 18).toFixed(2) + 'deg');
+ calc.style.setProperty('--rx', (-y * 10).toFixed(2) + 'deg');
+ calc.style.setProperty('--lx', (50 - x * 100).toFixed(1) + '%');
const r = star.getBoundingClientRect(), cx = r.left + r.width * 0.68, cy = r.top + r.height / 2;
const want = over ? 0.45 + 0.55 * clamp((mx - r.left) / (r.width * 1.3), 0, 1) : 0;
lift += (want - lift) * 0.14;
// (the pointer is the light; the calculator's turn is where the sticker is seen from)
sticker.light = [(mx - cx) / 260, -(my - cy) / 260, 0.85];
- sticker.view = [(12 - x * 14) / 38 + 0.12, (2 - y * 6) / 38];
+ sticker.view = [-x * 18 / 38 + 0.12, -y * 10 / 38];
paintSticker();
shadeStar(lift);
if (Math.abs(tx - x) + Math.abs(ty - y) > 0.0005 || Math.abs(want - lift) > 0.002) raf = requestAnimationFrame(draw);
@@ -1256,31 +1153,18 @@
addEventListener('pointermove', (e) => {
if (e.pointerType === 'touch') return;
mx = e.clientX; my = e.clientY;
- tx = mx / innerWidth - 0.5; ty = my / innerHeight - 0.5;
+ const r = dev.getBoundingClientRect(), on = mx >= r.left && mx <= r.right && my >= r.top && my <= r.bottom;
+ tx = on ? clamp((mx - r.left) / r.width - 0.5, -0.5, 0.5) : 0;
+ ty = on ? clamp((my - r.top) / r.height - 0.4, -0.5, 0.5) : 0;
kick();
}, { passive: true });
- document.documentElement.addEventListener('pointerleave', () => { tx = REST[0]; ty = REST[1]; kick(); });
+ document.documentElement.addEventListener('pointerleave', () => { tx = 0; ty = 0; kick(); });
star.addEventListener('pointerenter', (e) => { if (e.pointerType !== 'touch') { over = true; kick(); } });
star.addEventListener('pointerleave', () => { over = false; kick(); });
kick();
}
- // ------------------------------------------------------------------ the title's letters, GitHub
- function logoKeys() {
- const keys = [...document.querySelectorAll('.title .word i')];
- let busy = false;
- const wave = () => {
- if (busy || intro.on) return;
- busy = true;
- keys.forEach((k, i) => {
- setTimeout(() => k.classList.add('lift'), 40 * i);
- setTimeout(() => k.classList.remove('lift'), 40 * i + 160);
- });
- setTimeout(() => { busy = false; }, 40 * keys.length + 300);
- };
- $('#logo').addEventListener('pointerenter', wave);
- $('#logo').addEventListener('click', () => { if (intro.on) endIntro(); else playIntro(); });
- }
+ // ------------------------------------------------------------------ GitHub's star count, for the sticker
async function stars() {
try {
let n = sessionStorage.getItem('numplay-stars');
@@ -1354,8 +1238,7 @@
} catch (e) { custom = null; }
const small = $('#small'), big = $('#big');
- const badge = '<span class="badge"><svg class="b-tick" viewBox="0 0 12 12"><path d="M2.5 6.2l2.3 2.3 4.7-5" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>' +
- '<svg class="b-plus" viewBox="0 0 12 12"><path d="M6 2.5v7M2.5 6h7" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg></span>';
+ const badge = '<span class="badge" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M2.5 6.2l2.3 2.3 4.7-5" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg></span>';
for (const g of kit.games) {
if (g === rg) continue;
const b = el('button', 'app off', { type: 'button', 'aria-label': g.title, 'aria-pressed': 'false', 'data-id': g.id });
@@ -1414,7 +1297,7 @@
toast(byId[one].title + ' goes on its own in 1.94 MB. Pick it again to get your other games back');
}
const over = usedBytes() - kit.appSpace;
- if (over > 0) { st.cap = 'xl'; bump(b, 'shake'); toast('Take ' + size(over) + ' of games out first'); return; }
+ if (over > 0) { st.cap = 'xl'; toast('Take ' + size(over) + ' of games out first'); return; }
closePops(); render(); return;
}
if (b.dataset.cap === 'xl' && st.cap !== 'xl') askXL(b);
@@ -1428,7 +1311,6 @@
$('#sheet').addEventListener('click', (e) => { if (e.target.id === 'sheet' || e.target.closest('.sheet-close')) closeSheet(); });
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') { closeSheet(); closePops(); if (holding) { holding.classList.remove('held'); holding = null; } }
- if (intro.on && e.key !== 'Tab') endIntro();
});
if (rg) {
@@ -1451,17 +1333,14 @@
});
}
tips();
- logoKeys();
build3d();
depth();
- const first = (!store('numplay-intro') && !location.hash) || /[?&]intro\b/.test(location.search); // (or ?intro, to see it)
restore();
if (st.lang !== 'en') loadKit(st.lang).then(render).catch(() => { st.lang = 'en'; render(); });
render();
addEventListener('hashchange', () => { restore(); render(); });
stars();
(window.requestIdleCallback || setTimeout)(() => loadTools().catch(() => {}), { timeout: 3000 });
- if (first) playIntro();
}
start();
})();
diff --git a/customize/apple-touch-icon.png b/customize/apple-touch-icon.png
index a2fc4ed9..78b93bbc 100644
Binary files a/customize/apple-touch-icon.png and b/customize/apple-touch-icon.png differ
diff --git a/customize/favicon.png b/customize/favicon.png
index f0738e83..c6db1ab1 100644
Binary files a/customize/favicon.png and b/customize/favicon.png differ
diff --git a/customize/index.html b/customize/index.html
index c12a334e..198b6727 100644
--- a/customize/index.html
+++ b/customize/index.html
@@ -4,23 +4,23 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light">
-<title>NumPlay Studio: free games for your NumWorks calculator</title>
-<meta name="description" content="Pick the free games you want for your NumWorks calculator, add your own Game Boy, NES and Sega games, and get one app with all of them. NumPlay Studio builds it right in your browser.">
+<title>NumPlay Studio: choose the games in your NumPlay</title>
+<meta name="description" content="NumPlay is real games rebuilt for the NumWorks calculator, in one app. Choose which go into yours, add your own Game Boy, NES and Sega games, and install it. NumPlay Studio builds it in your browser.">
<link rel="canonical" href="https://mason363.github.io/NumPlay/customize/">
<link rel="icon" href="favicon.png" type="image/png">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<meta name="theme-color" content="#f2f1ef">
<meta property="og:type" content="website">
<meta property="og:site_name" content="NumPlay">
-<meta property="og:title" content="NumPlay Studio: free games for your NumWorks calculator">
-<meta property="og:description" content="Pick your games, drop in Game Boy, NES and Sega games, install. Free and open source.">
+<meta property="og:title" content="NumPlay Studio: choose the games in your NumPlay">
+<meta property="og:description" content="NumPlay is real games rebuilt for the NumWorks calculator, in one app. Choose which go into yours, add your own Game Boy, NES and Sega games, and install it.">
<meta property="og:url" content="https://mason363.github.io/NumPlay/customize/">
<meta property="og:image" content="https://mason363.github.io/NumPlay/customize/og.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
-<meta name="twitter:title" content="NumPlay Studio: free games for your NumWorks calculator">
-<meta name="twitter:description" content="Pick your games, drop in Game Boy, NES and Sega games, install. Free and open source.">
+<meta name="twitter:title" content="NumPlay Studio: choose the games in your NumPlay">
+<meta name="twitter:description" content="NumPlay is real games rebuilt for the NumWorks calculator, in one app. Choose which go into yours, add your own Game Boy, NES and Sega games, and install it.">
<meta name="twitter:image" content="https://mason363.github.io/NumPlay/customize/og.png">
<script type="application/ld+json">
{
@@ -29,7 +29,7 @@
"name": "NumPlay Studio",
"url": "https://mason363.github.io/NumPlay/customize/",
"image": "https://mason363.github.io/NumPlay/customize/og.png",
- "description": "Pick the free games you want for your NumWorks calculator, add your own Game Boy, NES and Sega games, and get one NumPlay app with all of them.",
+ "description": "NumPlay is real games rebuilt for the NumWorks calculator, in one app. Choose which go into yours, add your own Game Boy, NES and Sega games, and install it.",
"applicationCategory": "GameApplication",
"operatingSystem": "NumWorks calculator (N0110, N0115, N0120)",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
@@ -40,43 +40,42 @@
<link rel="stylesheet" href="app.css">
</head>
<body>
-<h1 class="sr">NumPlay Studio: pick free games for your NumWorks calculator, add your own Game Boy, NES and Sega games, and install one app with all of them</h1>
-
<main id="studio">
<div class="head">
- <button id="logo" class="title" type="button" aria-label="NumPlay: play the intro again" data-tip="Play the intro again">
- <span class="word" aria-hidden="true"><i>N</i><i>u</i><i>m</i><i>P</i><i>l</i><i>a</i><i>y</i></span>
- </button>
+ <h1 class="title">NumPlay</h1>
<div class="chips">
- <button id="app-chip" type="button" class="chip" aria-haspopup="dialog" aria-expanded="false" data-tip="Its icon, name and how it opens">
+ <button id="app-chip" type="button" class="chip" aria-haspopup="dialog" aria-expanded="false" data-tip="Its icon and name on your calculator, and how it opens">
<img id="app-chip-icon" src="kit/variants/NumPlay.png" alt="" width="28" height="28">
<svg class="caret" viewBox="0 0 12 12" width="10" height="10" aria-hidden="true"><path d="M3 4.5l3 3 3-3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
- <button id="lang-chip" type="button" class="chip lang" aria-haspopup="dialog" aria-expanded="false" data-tip="Its language">
+ <button id="lang-chip" type="button" class="chip lang" aria-haspopup="dialog" aria-expanded="false" data-tip="The language of its menus">
<span id="lang-chip-label">EN</span>
<svg class="caret" viewBox="0 0 12 12" width="10" height="10" aria-hidden="true"><path d="M3 4.5l3 3 3-3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
</div>
- <p id="caption" class="lede" aria-live="polite">Free games for your NumWorks. Pick yours, then press OK.</p>
+ <p class="lede">Real games, rebuilt for the NumWorks. Choose yours and they go on your calculator as one app.</p>
+ <p id="space-note" class="note">Your calculator has 1.94 MB for apps. Its screen shows what fits.</p>
</div>
<div class="games">
- <section id="small" class="grid small" aria-label="Games in NumPlay"></section>
+ <div class="row-head"><div><h2>Games in NumPlay</h2><span class="sub">Best first. Drag one to change where it sits.</span></div></div>
+ <section id="small" class="grid" aria-label="Games in NumPlay, best first"></section>
<div class="row-head">
- <span>Big games</span>
- <div class="cap" role="radiogroup" aria-label="App space">
+ <div><h2>Big games</h2><span class="sub">They take more room, so fewer fit at once.</span></div>
+ <div class="cap" role="radiogroup" aria-label="Space for apps">
<button type="button" role="radio" data-cap="std" aria-checked="true" data-tip="Every NumWorks">1.94 MB</button>
<button type="button" role="radio" data-cap="xl" aria-checked="false" data-tip="With Enlarged Extra Apps">6 MB</button>
</div>
</div>
- <section id="big" class="grid big" aria-label="Big games"></section>
- <section id="retro" class="retro" aria-label="Retro-Go" hidden>
- <div class="row-head"><span>Retro-Go</span><span class="sub">Game Boy, NES and Sega games you own</span></div>
+ <section id="big" class="grid" aria-label="Big games, best first"></section>
+ <section id="retro" class="retro" aria-label="Your own Game Boy, NES and Sega games" hidden>
+ <div class="row-head"><div><h2>Your own Game Boy, NES and Sega games</h2></div></div>
+ <p class="sub">Retro-Go plays them inside NumPlay. Add the game files you have, or drop them anywhere on this page.</p>
<div class="carts-row">
- <div id="carts" class="carts" aria-label="Your Retro-Go games"></div>
- <label id="drop" class="add-cart" for="rom-file" data-tip="Add a game|.gb .gbc .nes .sms .gg, or drop the files anywhere">
- <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14"/><path d="M5 12h14"/></svg>
- <span class="sr">Add Game Boy, NES or Sega games</span>
+ <div id="carts" class="carts" aria-label="Your games"></div>
+ <label id="drop" class="add-cart" for="rom-file" data-tip=".gb .gbc .nes .sms .gg">
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14"/><path d="M5 12h14"/></svg>
+ Add game files
</label>
<input id="rom-file" type="file" multiple accept=".gb,.gbc,.nes,.sms,.gg">
</div>
@@ -91,9 +90,11 @@
<section class="device" aria-label="Your calculator">
<div id="calc" class="calc">
<div class="plate">
- <img class="calc-img" src="calculator.webp" alt="A NumWorks calculator, up close" draggable="false" width="1018" height="2000">
- <button id="install" class="ok-key" type="button" aria-label="Install it on my calculator"><span class="ok-tag">Install</span></button>
- <button id="download" class="dl" type="button" aria-label="Download NumPlay.nwa">NumPlay.nwa</button>
+ <img class="calc-img" src="calculator.webp" alt="A NumWorks calculator" draggable="false" width="1018" height="2000">
+ <span class="legend ok" aria-hidden="true">install</span>
+ <span class="legend back" aria-hidden="true">download</span>
+ <button id="install" class="ok-key" type="button" aria-label="Install your NumPlay on your calculator" data-tip="Install it on your calculator"></button>
+ <button id="download" class="dl" type="button" aria-label="Download NumPlay.nwa" data-tip="Download NumPlay.nwa"></button>
</div>
<div class="well">
<img class="well-img" src="calculator.webp" alt="" draggable="false" width="1018" height="2000">
@@ -102,13 +103,13 @@
<div id="map" class="map"></div>
<div id="preview" class="preview" aria-hidden="true"><img alt=""></div>
<div class="drop-hint" aria-hidden="true">
- <svg viewBox="0 0 24 24" width="30" height="30" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v11"/><path d="M7 10l5 5 5-5"/><path d="M5 20h14"/></svg>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v11"/><path d="M7 10l5 5 5-5"/><path d="M5 20h14"/></svg>
+ Drop to add
</div>
- <i class="glass" aria-hidden="true"></i>
</div>
</div>
<div class="body3d" aria-hidden="true"></div>
- <a id="star" class="sticker" href="https://github.com/Mason363/NumPlay" target="_blank" rel="noopener" aria-label="Star NumPlay on GitHub" data-tip="Star NumPlay on GitHub|it helps more people find it"></a>
+ <a id="star" class="sticker" href="https://github.com/Mason363/NumPlay" target="_blank" rel="noopener" aria-label="Star NumPlay on GitHub" data-tip="Star NumPlay on GitHub|it helps other people find it"></a>
</div>
</section>
</main>
@@ -145,28 +146,27 @@
<button type="button" class="sheet-close" aria-label="Close">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>
</button>
- <h2 id="sheet-title"><span class="sheet-file">NumPlay.nwa</span> is on its way</h2>
+ <h2 id="sheet-title"><span class="sheet-file">NumPlay.nwa</span> is downloading</h2>
<ol class="steps">
<li><span class="step-icon">
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="2" width="12" height="20" rx="2.5"/><rect x="8.5" y="4.5" width="7" height="5" rx="0.5"/><path d="M9 13h.01M12 13h.01M15 13h.01M9 16h.01M12 16h.01M15 16h.01M9 19h.01M12 19h.01M15 19h.01"/></svg>
- </span><span>Plug your calculator in</span></li>
+ </span><span>Plug your calculator into this computer</span></li>
<li class="xl-only"><span class="step-icon">
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h12v18l-6-4-6 4z"/></svg>
</span><span>Click the <a href="https://nwagyu.org/guide/help/enlarge-your-memory.html" target="_blank" rel="noopener">Nwagra</a> bookmark on the installer page</span></li>
<li><span class="step-icon">
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15V3"/><path d="M7 8l5-5 5 5"/><path d="M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"/></svg>
- </span><span>Drop <span class="sheet-file">NumPlay.nwa</span> there</span></li>
+ </span><span>Open NumWorks' installer and drop <span class="sheet-file">NumPlay.nwa</span> into it</span></li>
</ol>
<a class="install wide" href="https://my.numworks.com/apps" target="_blank" rel="noopener">Open the installer</a>
<a class="star-ask" href="https://github.com/Mason363/NumPlay" target="_blank" rel="noopener">
- <svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#f5b70a" d="M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z"/></svg>
- <span>Like it? A star on GitHub helps more people find NumPlay</span>
+ Like it? A star on GitHub helps other people find NumPlay
</a>
</div>
</div>
-<noscript><p class="noscript">NumPlay Studio needs JavaScript to build your NumPlay. You can also <a href="https://github.com/Mason363/NumPlay/releases/latest/download/NumPlay.nwa">download NumPlay.nwa</a> with every game.</p></noscript>
+<noscript><p class="noscript">NumPlay Studio needs JavaScript to build your NumPlay. You can also <a href="https://github.com/Mason363/NumPlay/releases/latest/download/NumPlay.nwa">download NumPlay.nwa</a> with all of its games.</p></noscript>
<div id="tip" class="tip" role="tooltip"></div>
<div id="toast" class="toast" role="status" aria-live="polite"></div>
diff --git a/games/games.json b/games/games.json
index 2136dde1..a3910395 100644
--- a/games/games.json
+++ b/games/games.json
@@ -1,6 +1,7 @@
[
{
"id": "numdash",
+ "rank": 4,
"title": "NumDash",
"tagline": "Jump to the beat",
"credit": null,
@@ -24,6 +25,7 @@
},
{
"id": "crossyroad",
+ "rank": 6,
"title": "Crossy Road",
"tagline": "Hop, dodge, survive",
"credit": null,
@@ -40,6 +42,7 @@
},
{
"id": "numblocks",
+ "rank": 1,
"title": "NumBlocks",
"tagline": "Mine, craft, survive",
"credit": "Inspired by Minecraft, not affiliated with Mojang",
@@ -95,6 +98,7 @@
},
{
"id": "numdrive",
+ "rank": 2,
"title": "NumDrive",
"tagline": "Drive, flip, finish",
"credit": null,
@@ -111,6 +115,7 @@
},
{
"id": "balatro",
+ "rank": 3,
"title": "Balatro",
"tagline": "Poker hands, wild jokers",
"credit": null,
@@ -127,6 +132,7 @@
},
{
"id": "buckshot",
+ "rank": 5,
"title": "Buckshot Roulette",
"tagline": "You, the Dealer, one shotgun",
"credit": null,
@@ -143,6 +149,7 @@
},
{
"id": "blockblast",
+ "rank": 8,
"title": "Block Blast",
"tagline": "Fit the blocks, blast the lines",
"credit": "Based on Block Blast! by Hungry Studio",
@@ -161,6 +168,7 @@
},
{
"id": "portal",
+ "rank": 7,
"title": "Portal Returns",
"tagline": "Think with portals",
"credit": null,
@@ -177,6 +185,7 @@
},
{
"id": "tetris",
+ "rank": 9,
"title": "Tetris",
"tagline": "Stack and clear lines",
"credit": "By Tatone26, from All the Apps",
@@ -194,6 +203,7 @@
},
{
"id": "dinorun",
+ "rank": 14,
"title": "Chrome Dino",
"tagline": "Jump, duck, survive",
"credit": "Based on Chrome's dinosaur game by Google",
@@ -211,6 +221,7 @@
},
{
"id": "chess",
+ "rank": 13,
"title": "Chess",
"tagline": "Bots, puzzles, 2 players",
"credit": null,
@@ -227,6 +238,7 @@
},
{
"id": "flappybird",
+ "rank": 11,
"title": "Flappy Bird",
"tagline": "Flap through the pipes",
"credit": "Inspired by Tatone26's All the Apps",
@@ -244,6 +256,7 @@
},
{
"id": "pacman",
+ "rank": 10,
"title": "Pac-Man",
"tagline": "Eat dots, dodge ghosts",
"credit": "Inspired by Tatone26's All the Apps",
@@ -261,6 +274,7 @@
},
{
"id": "snake",
+ "rank": 15,
"title": "Snake",
"tagline": "Eat apples, grow long",
"credit": "Inspired by Tatone26's All the Apps",
@@ -278,6 +292,7 @@
},
{
"id": "connectfour",
+ "rank": 19,
"title": "Connect Four",
"tagline": "Four in a row wins",
"credit": "Inspired by Tatone26's All the Apps",
@@ -295,6 +310,7 @@
},
{
"id": "solitaire",
+ "rank": 24,
"title": "Solitaire",
"tagline": "The classic card game",
"credit": "Inspired by Tatone26's All the Apps",
@@ -312,6 +328,7 @@
},
{
"id": "g2048",
+ "rank": 18,
"title": "2048",
"tagline": "Slide, merge, reach 2048",
"credit": "Based on 2048 by Gabriele Cirulli",
@@ -329,6 +346,7 @@
},
{
"id": "minesweeper",
+ "rank": 23,
"title": "Minesweeper",
"tagline": "Clear the field, flag the mines",
"credit": null,
@@ -346,6 +364,7 @@
},
{
"id": "breakout",
+ "rank": 17,
"title": "Block Breaker",
"tagline": "Break every brick",
"credit": null,
@@ -363,6 +382,7 @@
},
{
"id": "twoplayer",
+ "rank": 12,
"title": "2 Players",
"tagline": "Pong and more, side by side",
"credit": null,
@@ -381,6 +401,7 @@
},
{
"id": "invaders",
+ "rank": 16,
"title": "Space Invaders",
"tagline": "Stop the invasion, one cannon",
"credit": "Based on Space Invaders by Taito",
@@ -399,6 +420,7 @@
},
{
"id": "sudoku",
+ "rank": 22,
"title": "Sudoku",
"tagline": "Fill the grid, 1 to 9",
"credit": null,
@@ -417,6 +439,7 @@
},
{
"id": "uttt",
+ "rank": 20,
"title": "Ultimate Tic-Tac-Toe",
"tagline": "Tic-tac-toe in tic-tac-toe",
"credit": null,
@@ -435,6 +458,7 @@
},
{
"id": "sokoban",
+ "rank": 21,
"title": "Sokoban",
"tagline": "Push every box home",
"credit": "Levels: Microban by David W. Skinner",
@@ -453,6 +477,7 @@
},
{
"id": "retrogo",
+ "rank": 25,
"title": "Retro-Go",
"tagline": "Game Boy, NES and Sega games",
"credit": "Based on Retro-Go by ducalex",
@@ -483,6 +508,7 @@
},
{
"id": "celeste",
+ "rank": 2,
"title": "Celeste",
"tagline": "Climb the mountain",
"credit": "Based on Celeste by Maddy Makes Games",
@@ -503,6 +529,7 @@
},
{
"id": "hollowknight",
+ "rank": 1,
"title": "Hollow Knight",
"tagline": "Explore Hallownest",
"credit": "Based on Hollow Knight by Team Cherry",
@@ -527,6 +554,7 @@
},
{
"id": "undertale",
+ "rank": 3,
"title": "Undertale",
"tagline": "Fall into the Underground",
"credit": "Based on Undertale by Toby Fox",
@@ -554,6 +582,7 @@
},
{
"id": "championisland",
+ "rank": 12,
"title": "Champion Island",
"tagline": "Seven sports, one island",
"credit": "Based on Google's Champion Island Games",
@@ -575,6 +604,7 @@
},
{
"id": "finalearth2",
+ "rank": 13,
"title": "The Final Earth 2",
"tagline": "Build a city in space",
"credit": "Based on the game by Florian van Strien",
@@ -596,6 +626,7 @@
},
{
"id": "numpowder",
+ "rank": 8,
"title": "NumPowder",
"tagline": "Sand, water, fire and more",
"credit": "Inspired by The Powder Toy",
@@ -627,6 +658,7 @@
},
{
"id": "subway",
+ "rank": 4,
"title": "Subway Surfers",
"tagline": "Dodge the trains",
"credit": "Based on Subway Surfers by SYBO and Kiloo",
@@ -648,6 +680,7 @@
},
{
"id": "fnaf",
+ "rank": 7,
"title": "Five Nights at Freddy's",
"tagline": "Survive five nights",
"credit": "Based on the game by Scott Cawthon",
@@ -669,6 +702,7 @@
},
{
"id": "doom",
+ "rank": 6,
"title": "Doom",
"tagline": "Rip and tear",
"credit": "Based on Doom by id Software",
@@ -707,6 +741,7 @@
},
{
"id": "isaac",
+ "rank": 10,
"title": "The Binding of Isaac",
"tagline": "Cry through the basement",
"credit": "Based on the game by Edmund McMillen",
@@ -728,6 +763,7 @@
},
{
"id": "hillclimb",
+ "rank": 11,
"title": "Hill Climb Racing",
"tagline": "Drive up, don't flip",
"credit": "Based on Hill Climb Racing by Fingersoft",
@@ -749,6 +785,7 @@
},
{
"id": "pvz",
+ "rank": 5,
"title": "Plants vs. Zombies",
"tagline": "Plant your lawn",
"credit": "Based on the game by PopCap Games",
@@ -770,6 +807,7 @@
},
{
"id": "sonic",
+ "rank": 9,
"title": "Sonic the Hedgehog",
"tagline": "Run through six zones",
"credit": "Based on the game by Sonic Team",
@@ -790,6 +828,7 @@
},
{
"id": "cookieclicker",
+ "rank": 15,
"title": "Cookie Clicker",
"tagline": "Bake billions of cookies",
"credit": "Based on Cookie Clicker by Orteil",
@@ -810,6 +849,7 @@
},
{
"id": "leveldevil",
+ "rank": 14,
"title": "Level Devil",
"tagline": "Run to the door",
"credit": "Based on Level Devil by Unept",
diff --git a/tools/kit.py b/tools/kit.py
index 24afa222..9eefabac 100644
--- a/tools/kit.py
+++ b/tools/kit.py
@@ -85,6 +85,17 @@ def icon_of(gid):
return None
+def rounded(src, dst):
+ """An app icon as the website shows it: the calculator's white outside its corners made transparent, with
+ the corners every game icon has (make_icon.corner_mask), so it sits on the page as they do."""
+ from PIL import Image, ImageChops
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+ from make_icon import corner_mask
+ im = Image.open(src).convert("RGBA")
+ im.putalpha(ImageChops.darker(im.getchannel("A"), corner_mask(*im.size)))
+ im.save(dst, optimize=True)
+
+
def gz(src, dst):
with open(src, "rb") as f, open(dst, "wb") as g:
g.write(gzip.compress(f.read(), 9, mtime=0))
@@ -132,7 +143,7 @@ def main():
for part in ("name", "icon"):
local[f"{v}-{part}.o"] = put(os.path.join(B, "variant", f"{v}-{part}.o"), f"variants/{v}-{part}.o")
png = "icon.png" if v == "NumPlay" else "icon-" + v.split("-", 1)[1].lower() + ".png"
- shutil.copy(os.path.join(ROOT, "launcher", "assets", png), os.path.join(O, "variants", v + ".png"))
+ rounded(os.path.join(ROOT, "launcher", "assets", png), os.path.join(O, "variants", v + ".png"))
variants.append(v)
games = []
@@ -160,7 +171,7 @@ def main():
if os.path.exists(thumb):
shutil.copy(thumb, os.path.join(O, "thumbs", i + ".png"))
games.append({
- "id": i, "index": n, "title": g["title"], "tagline": g["tagline"], "credit": g.get("credit"),
+ "id": i, "index": n, "rank": g.get("rank", 99), "title": g["title"], "tagline": g["tagline"], "credit": g.get("credit"),
"top": g["top"], "bottom": g["bottom"], "accent": g["accent"],
"flash": flash, "ram": ram, "heap": g.get("heap", 0), "default": i in default, "upsilon": i in upsilon,
"roms": bool(g.get("roms")), "systems": g.get("systems"), "xl": bool(g.get("xl")),