base subscript moved to end of number, larger font for scroll text

This commit is contained in:
Трошин Антон Валерьевич
2026-07-12 11:13:53 +03:00
parent fc13a8832d
commit 9f720e73ab
4 changed files with 13 additions and 11 deletions
+8 -6
View File
@@ -646,10 +646,10 @@ const TICKER_COLORS = [
];
const TICKER_SYSTEMS = [
{ key: 'binary', min: 1, max: 255, prefix: toSubscript(2) },
{ key: 'octal', min: 1, max: 511, prefix: toSubscript(8) },
{ key: 'binary', min: 1, max: 255, suffix: toSubscript(2) },
{ key: 'octal', min: 1, max: 511, suffix: toSubscript(8) },
{ key: 'hex', min: 1, max: 255, prefix: '0x' },
{ key: 'ternary', min: 1, max: 27, prefix: toSubscript(3) },
{ key: 'ternary', min: 1, max: 27, suffix: toSubscript(3) },
{ key: 'braille', min: 1, max: 99, prefix: null },
{ key: 'roman', min: 1, max: 3999, prefix: null },
{ key: 'greek', min: 1, max: 999, prefix: null },
@@ -662,10 +662,12 @@ function generateTickerText() {
const sys = TICKER_SYSTEMS[Math.floor(Math.random() * TICKER_SYSTEMS.length)];
const num = sys.min + Math.floor(Math.random() * (sys.max - sys.min + 1));
const display = SYSTEMS[sys.key].toDisplay(num);
const prefixed = sys.prefix ? sys.prefix + display : display;
let labelled = display;
if (sys.prefix) labelled = sys.prefix + display;
if (sys.suffix) labelled = display + sys.suffix;
const wrapped = sys.key === 'slavonic'
? '<span class="slavonic-font">' + prefixed + '</span>'
: prefixed;
? '<span class="slavonic-font">' + labelled + '</span>'
: labelled;
const color = TICKER_COLORS[Math.floor(Math.random() * TICKER_COLORS.length)];
pairs.push('<span style="color:' + color + '">' + wrapped + ' = ' + num + '</span>');
}
+3 -3
View File
@@ -10,7 +10,7 @@
<link rel="manifest" href="manifest.json">
<link rel="icon" type="image/svg+xml" href="icon.svg">
<link rel="apple-touch-icon" href="icon-192.png">
<link rel="stylesheet" href="styles.css?v=40">
<link rel="stylesheet" href="styles.css?v=41">
</head>
<body>
<div id="app">
@@ -155,10 +155,10 @@
</div>
<script type="module" src="app.js?v=40"></script>
<script type="module" src="app.js?v=41"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js?v=40').catch(() => {});
navigator.serviceWorker.register('/sw.js?v=41').catch(() => {});
}
</script>
</body>
+1 -1
View File
@@ -111,7 +111,7 @@ body {
display: inline-block;
white-space: nowrap;
color: var(--text-dim);
font-size: 1.05rem;
font-size: 1.3rem;
font-family: monospace;
animation: ticker-scroll 40s linear infinite;
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE_NAME = 'numnum-v40';
const CACHE_NAME = 'numnum-v41';
const ASSETS = [
'/',
'/index.html',