Commit ·
fc0f297
1
Parent(s): 77d34be
feat(dartboard): inward tunnel animation, remove win-rate flash, fix malformed svg tag
Browse files- static/scan/index.html +1 -15
static/scan/index.html
CHANGED
|
@@ -408,7 +408,7 @@
|
|
| 408 |
|
| 409 |
<!-- Dartboard -->
|
| 410 |
<div style="display:flex;justify-content:center;margin:16px 0 12px 0;">
|
| 411 |
-
<!-- dartboard-hero-swap --><svg id="dartboard" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98" width="200" height="200" aria-label="Win rate indicator"<defs><linearGradient id="a" x1="-99.04" y1="372.9" x2="-162.46" y2="372.9" gradientTransform="translate(395.07 -112.17) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.36" stop-color="#e66969"/><stop offset="0.75" stop-color="#ffbaba"/><stop offset="1" stop-color="#fc7373"/></linearGradient><linearGradient id="b" x1="-99.04" y1="369.84" x2="-162.46" y2="369.84" gradientTransform="translate(395.07 -112.17) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.36" stop-color="#f87a7a"/><stop offset="0.77" stop-color="#ffc9c9"/><stop offset="1" stop-color="#ff8080"/></linearGradient><clipPath id="c"><path d="M76.8,44.28l-23-.05-.47.47L78.1,59.44A28.75,28.75,0,0,0,76.8,44.28Z" style="fill:none"/></clipPath><radialGradient id="d" cx="52.2" cy="50.58" r="23.4" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2f3235"/><stop offset="1" stop-color="#2f3235" stop-opacity="0"/></radialGradient><linearGradient id="e" x1="10.11" y1="222.23" x2="18.02" y2="222.23" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#40bf6e"/><stop offset="1" stop-color="#4ade80"/></linearGradient><linearGradient id="f" x1="14.48" y1="225.2" x2="28.04" y2="217.81" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#39ab62"/><stop offset="1" stop-color="#4ade80"/></linearGradient><linearGradient id="g" x1="19.62" y1="238.21" x2="16.43" y2="238.21" gradientTransform="matrix(0, 1, -1, 0, 300.68, 17.51)" gradientUnits="userSpaceOnUse"><stop offset="0.21" stop-color="#3eb86a"/><stop offset="0.63" stop-color="#67e694"/><stop offset="0.89" stop-color="#4ade80"/></linearGradient><linearGradient id="h" x1="18.61" y1="223.72" x2="17.44" y2="223.72" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.03" stop-color="#3eb86a"/><stop offset="0.63" stop-color="#67e694"/><stop offset="0.95" stop-color="#4ade80"/></linearGradient></defs><path d="M27.48,25.68l-3.81,3.81C13.76,39.39,15.6,57.63,28,70s30.62,14.23,40.52,4.32l3.81-3.81Z" style="fill:url(#a)"/><path d="M28.1,25.05l-.9.9c-9.91,9.91-7.9,28,4.49,40.36s30.45,14.4,40.36,4.49l.9-.9Z" style="fill:url(#b)"/><ellipse id="ring-outer" cx="49.9" cy="48.1" rx="25.36" ry="31.71" transform="translate(-19.4 49.37) rotate(-45)"
|
| 412 |
</div>
|
| 413 |
|
| 414 |
<!-- Win rate label -->
|
|
@@ -1396,17 +1396,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 1396 |
}
|
| 1397 |
el.textContent = rate.toFixed(1) + '%' + (totalBots ? ' (' + totalBots + ' bots)' : '');
|
| 1398 |
}
|
| 1399 |
-
function flashRing(active) {
|
| 1400 |
-
['ring-outer','ring-middle','ring-inner'].forEach(function(id) {
|
| 1401 |
-
var r = document.getElementById(id);
|
| 1402 |
-
if (!r) return;
|
| 1403 |
-
r.classList.remove('ring-flash');
|
| 1404 |
-
if (id === active) {
|
| 1405 |
-
r.classList.add('ring-flash');
|
| 1406 |
-
r.style.filter = '';
|
| 1407 |
-
} else {
|
| 1408 |
-
r.style.filter = 'brightness(0.55)';
|
| 1409 |
-
}
|
| 1410 |
});
|
| 1411 |
}
|
| 1412 |
function loadBotPnl() {
|
|
@@ -1442,14 +1431,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 1442 |
fetch('/api/win-rate').then(function(r){ return r.json(); }).then(function(d) {
|
| 1443 |
if (!d || d.status !== 'ok') {
|
| 1444 |
setWinRate(null);
|
| 1445 |
-
flashRing('ring-inner');
|
| 1446 |
return;
|
| 1447 |
}
|
| 1448 |
setWinRate(d.win_rate, d.total_bots);
|
| 1449 |
-
flashRing(d.active_ring);
|
| 1450 |
}).catch(function(){
|
| 1451 |
setWinRate(null);
|
| 1452 |
-
flashRing('ring-inner');
|
| 1453 |
});
|
| 1454 |
}
|
| 1455 |
loadBotPnl();
|
|
|
|
| 408 |
|
| 409 |
<!-- Dartboard -->
|
| 410 |
<div style="display:flex;justify-content:center;margin:16px 0 12px 0;">
|
| 411 |
+
<!-- dartboard-hero-swap --><svg id="dartboard" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98" width="200" height="200" <!-- dartboard-tunnel-applied --><!-- dartboard-tunnel-fix-applied -->aria-label="Win rate indicator"><style id="dartboard-tunnel-css">#dartboard #ring-outer,#dartboard #ring-middle,#dartboard #ring-inner,#dartboard > ellipse:nth-of-type(2),#dartboard > ellipse:nth-of-type(4) { transform-box: fill-box; transform-origin: center; animation: db-tunnel 3s linear infinite;}#dartboard #ring-outer { animation-delay: 0s; }#dartboard > ellipse:nth-of-type(2) { animation-delay: 0.3s; }#dartboard #ring-middle { animation-delay: 0.6s; }#dartboard > ellipse:nth-of-type(4) { animation-delay: 0.9s; }#dartboard #ring-inner { animation-delay: 1.2s; }@keyframes db-tunnel { 0% { transform: scale(1.00); opacity: 1; } 70% { transform: scale(0.40); opacity: 0.15; } 100% { transform: scale(0.10); opacity: 0; }}</style><defs><linearGradient id="a" x1="-99.04" y1="372.9" x2="-162.46" y2="372.9" gradientTransform="translate(395.07 -112.17) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.36" stop-color="#e66969"/><stop offset="0.75" stop-color="#ffbaba"/><stop offset="1" stop-color="#fc7373"/></linearGradient><linearGradient id="b" x1="-99.04" y1="369.84" x2="-162.46" y2="369.84" gradientTransform="translate(395.07 -112.17) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.36" stop-color="#f87a7a"/><stop offset="0.77" stop-color="#ffc9c9"/><stop offset="1" stop-color="#ff8080"/></linearGradient><clipPath id="c"><path d="M76.8,44.28l-23-.05-.47.47L78.1,59.44A28.75,28.75,0,0,0,76.8,44.28Z" style="fill:none"/></clipPath><radialGradient id="d" cx="52.2" cy="50.58" r="23.4" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2f3235"/><stop offset="1" stop-color="#2f3235" stop-opacity="0"/></radialGradient><linearGradient id="e" x1="10.11" y1="222.23" x2="18.02" y2="222.23" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#40bf6e"/><stop offset="1" stop-color="#4ade80"/></linearGradient><linearGradient id="f" x1="14.48" y1="225.2" x2="28.04" y2="217.81" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#39ab62"/><stop offset="1" stop-color="#4ade80"/></linearGradient><linearGradient id="g" x1="19.62" y1="238.21" x2="16.43" y2="238.21" gradientTransform="matrix(0, 1, -1, 0, 300.68, 17.51)" gradientUnits="userSpaceOnUse"><stop offset="0.21" stop-color="#3eb86a"/><stop offset="0.63" stop-color="#67e694"/><stop offset="0.89" stop-color="#4ade80"/></linearGradient><linearGradient id="h" x1="18.61" y1="223.72" x2="17.44" y2="223.72" gradientTransform="translate(218.16 -145.65) rotate(45)" gradientUnits="userSpaceOnUse"><stop offset="0.03" stop-color="#3eb86a"/><stop offset="0.63" stop-color="#67e694"/><stop offset="0.95" stop-color="#4ade80"/></linearGradient></defs><path d="M27.48,25.68l-3.81,3.81C13.76,39.39,15.6,57.63,28,70s30.62,14.23,40.52,4.32l3.81-3.81Z" style="fill:url(#a)"/><path d="M28.1,25.05l-.9.9c-9.91,9.91-7.9,28,4.49,40.36s30.45,14.4,40.36,4.49l.9-.9Z" style="fill:url(#b)"/><g transform="translate(-19.4 49.37) rotate(-45)"><ellipse id=""ring-outer" cx="49.9" cy="48.1" rx="25.36" ry="31.71" style="fill:#f87171"/></g><g transform="translate(-19.4 49.37) rotate(-45)"><ellipse cx="49.9" cy="48.1" rx="25.37" ry="31.71" style="fill:#f87171"/></g><g transform="translate(-18.23 49.85) rotate(-45)"><ellipse cx="51.06" cy="46.94" rx="20.45" ry="25.56" style="fill:#fff"/></g><g transform="translate(-17.4 50.2) rotate(-45)"><ellipse id=""ring-middle" cx="51.89" cy="46.11" rx="15.82" ry="19.78" style="fill:#f0b90b"/></g><g transform="translate(-16.66 50.51) rotate(-45)"><ellipse cx="52.64" cy="45.36" rx="10.97" ry="13.72" style="fill:#fff"/></g><g transform="translate(-15.99 50.78) rotate(-45)"><ellipse id=""ring-inner" cx="53.3" cy="44.7" rx="6.59" ry="8.23" style="fill:#4ade80"/></g><g style="clip-path:url(#c)"><circle cx="52.2" cy="50.58" r="23.4" style="opacity:0.5;fill:url(#d)"/></g><path d="M79,19l-3.66-6.6s-3.13.5-5.79,6.76a30.15,30.15,0,0,0-2.46,11.75Z" style="fill:url(#e)"/><path d="M79,19l6.6,3.66s-.5,3.13-6.76,5.79a30.15,30.15,0,0,1-11.75,2.46Z" style="fill:url(#f)"/><g transform="translate(-6.83 54.58) rotate(-45)"><ellipse cx="62.47" cy="35.53" rx="12.96" ry="1.59" style="fill:url(#g)"/></g><path d="M79.17,19.67c-6.69,6.68-12.3,11.92-12.53,11.69s5-5.84,11.69-12.53A3.72,3.72,0,0,1,79.17,19.67Z" style="fill:url(#h)"/><path d="M79.81,18.89,81,17.41a11.52,11.52,0,0,0,1-1.46,11.52,11.52,0,0,0-1.46,1l-1.48,1.23s-1.19-1.91-1.61-2.55c-.53-.8-2.17-3.23-2.17-3.23s1.1,2.66,1.51,3.52,1.52,2.93,1.52,2.93-1,1-1.41,1.47a18.45,18.45,0,0,0-1.54,2.26,18.45,18.45,0,0,0,2.26-1.54c.51-.45,1.47-1.41,1.47-1.41s2,1.11,2.71,1.44c.91.42,3.74,1.59,3.74,1.59S83.14,21,82.3,20.42C81.69,20,79.81,18.89,79.81,18.89Z" style="fill:#67e892"/></svg>
|
| 412 |
</div>
|
| 413 |
|
| 414 |
<!-- Win rate label -->
|
|
|
|
| 1396 |
}
|
| 1397 |
el.textContent = rate.toFixed(1) + '%' + (totalBots ? ' (' + totalBots + ' bots)' : '');
|
| 1398 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1399 |
});
|
| 1400 |
}
|
| 1401 |
function loadBotPnl() {
|
|
|
|
| 1431 |
fetch('/api/win-rate').then(function(r){ return r.json(); }).then(function(d) {
|
| 1432 |
if (!d || d.status !== 'ok') {
|
| 1433 |
setWinRate(null);
|
|
|
|
| 1434 |
return;
|
| 1435 |
}
|
| 1436 |
setWinRate(d.win_rate, d.total_bots);
|
|
|
|
| 1437 |
}).catch(function(){
|
| 1438 |
setWinRate(null);
|
|
|
|
| 1439 |
});
|
| 1440 |
}
|
| 1441 |
loadBotPnl();
|