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 = [ const TICKER_SYSTEMS = [
{ key: 'binary', min: 1, max: 255, prefix: toSubscript(2) }, { key: 'binary', min: 1, max: 255, suffix: toSubscript(2) },
{ key: 'octal', min: 1, max: 511, prefix: toSubscript(8) }, { key: 'octal', min: 1, max: 511, suffix: toSubscript(8) },
{ key: 'hex', min: 1, max: 255, prefix: '0x' }, { 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: 'braille', min: 1, max: 99, prefix: null },
{ key: 'roman', min: 1, max: 3999, prefix: null }, { key: 'roman', min: 1, max: 3999, prefix: null },
{ key: 'greek', min: 1, max: 999, 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 sys = TICKER_SYSTEMS[Math.floor(Math.random() * TICKER_SYSTEMS.length)];
const num = sys.min + Math.floor(Math.random() * (sys.max - sys.min + 1)); const num = sys.min + Math.floor(Math.random() * (sys.max - sys.min + 1));
const display = SYSTEMS[sys.key].toDisplay(num); 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' const wrapped = sys.key === 'slavonic'
? '<span class="slavonic-font">' + prefixed + '</span>' ? '<span class="slavonic-font">' + labelled + '</span>'
: prefixed; : labelled;
const color = TICKER_COLORS[Math.floor(Math.random() * TICKER_COLORS.length)]; const color = TICKER_COLORS[Math.floor(Math.random() * TICKER_COLORS.length)];
pairs.push('<span style="color:' + color + '">' + wrapped + ' = ' + num + '</span>'); 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="manifest" href="manifest.json">
<link rel="icon" type="image/svg+xml" href="icon.svg"> <link rel="icon" type="image/svg+xml" href="icon.svg">
<link rel="apple-touch-icon" href="icon-192.png"> <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> </head>
<body> <body>
<div id="app"> <div id="app">
@@ -155,10 +155,10 @@
</div> </div>
<script type="module" src="app.js?v=40"></script> <script type="module" src="app.js?v=41"></script>
<script> <script>
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js?v=40').catch(() => {}); navigator.serviceWorker.register('/sw.js?v=41').catch(() => {});
} }
</script> </script>
</body> </body>
+1 -1
View File
@@ -111,7 +111,7 @@ body {
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
color: var(--text-dim); color: var(--text-dim);
font-size: 1.05rem; font-size: 1.3rem;
font-family: monospace; font-family: monospace;
animation: ticker-scroll 40s linear infinite; 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 = [ const ASSETS = [
'/', '/',
'/index.html', '/index.html',