Tweak sparkles

This commit is contained in:
Fraxle
2026-05-30 21:24:55 +01:00
parent da12910feb
commit 0535232446
+4 -3
View File
@@ -56,7 +56,8 @@ if (history.scrollRestoration) {
const s = document.createElement('div'); const s = document.createElement('div');
s.style.cssText = [ s.style.cssText = [
'position:absolute', 'position:absolute',
'width:3px', 'height:3px',
'width:2px', 'height:3px',
'background:rgba(251,191,36,0.9)', 'background:rgba(251,191,36,0.9)',
'border-radius:50%', 'border-radius:50%',
`top:${(Math.random() * 100).toFixed(2)}%`, `top:${(Math.random() * 100).toFixed(2)}%`,
@@ -134,12 +135,12 @@ var WAND_COLORS = [
]; ];
function spawnSparkleCluster(btn, x, btnH) { function spawnSparkleCluster(btn, x, btnH) {
var n = 16 + Math.floor(Math.random() * 13); // 1628 per cluster var n = 14 + Math.floor(Math.random() * 13); // 1628 per cluster
for (var i = 0; i < n; i++) { for (var i = 0; i < n; i++) {
var s = document.createElement('span'); var s = document.createElement('span');
s.className = 'btn-sparkle'; s.className = 'btn-sparkle';
var ox = (Math.random() - 0.5) * 40; // ±20px horizontal spread var ox = (Math.random() - 0.5) * 40; // ±20px horizontal spread
var fy = Math.random() * btnH - 8; // shifted up a few px var fy = Math.random() * btnH - 7; // shifted up a few px
var sz = (0.28 + Math.random() * 0.55).toFixed(2); var sz = (0.28 + Math.random() * 0.55).toFixed(2);
var dur = (0.38 + Math.random() * 0.45).toFixed(3); var dur = (0.38 + Math.random() * 0.45).toFixed(3);
var col = WAND_COLORS[Math.floor(Math.random() * WAND_COLORS.length)]; var col = WAND_COLORS[Math.floor(Math.random() * WAND_COLORS.length)];