nicer text scroll

This commit is contained in:
Трошин Антон Валерьевич
2026-07-12 10:31:10 +03:00
parent 983190d146
commit 45c72fc4df
4 changed files with 13 additions and 8 deletions
+7 -1
View File
@@ -640,6 +640,11 @@ function toSubscript(n) {
return String(n).split('').map(d => SUBSCRIPTS[d]).join('');
}
const TICKER_COLORS = [
'#7ec8e3', '#a8d5a2', '#f0c674', '#d4a0d4', '#e8a87c',
'#87ceeb', '#98d4bb', '#deb887', '#c9b1ff', '#ff9a9e'
];
const TICKER_SYSTEMS = [
{ key: 'binary', min: 1, max: 255, prefix: toSubscript(2) },
{ key: 'octal', min: 1, max: 511, prefix: toSubscript(8) },
@@ -661,7 +666,8 @@ function generateTickerText() {
const wrapped = sys.key === 'slavonic'
? '<span class="slavonic-font">' + prefixed + '</span>'
: prefixed;
pairs.push(wrapped + ' = ' + num);
const color = TICKER_COLORS[Math.floor(Math.random() * TICKER_COLORS.length)];
pairs.push('<span style="color:' + color + '">' + wrapped + ' = ' + num + '</span>');
}
return pairs.join('\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0');
}
+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=38">
<link rel="stylesheet" href="styles.css?v=39">
</head>
<body>
<div id="app">
@@ -155,10 +155,10 @@
</div>
<script type="module" src="app.js?v=38"></script>
<script type="module" src="app.js?v=39"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js?v=38').catch(() => {});
navigator.serviceWorker.register('/sw.js?v=39').catch(() => {});
}
</script>
</body>
+2 -3
View File
@@ -114,12 +114,11 @@ body {
font-size: 1.05rem;
font-family: monospace;
animation: ticker-scroll 40s linear infinite;
padding-left: 100%;
}
@keyframes ticker-scroll {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
/* BUTTONS */
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE_NAME = 'numnum-v38';
const CACHE_NAME = 'numnum-v39';
const ASSETS = [
'/',
'/index.html',