Hacker News new | past | comments | ask | show | jobs | submit login

Idk. Animate it?

(function() { const colors = ['red', 'green', 'blue']; const setColor = (el, idx) => { let currentThickness = (idx % 10) + 1; el.style.outlineColor = colors[idx % colors.length]; let direction = 1; setInterval(() => { if (currentThickness >= 10 || currentThickness <= 1) direction *= -1; el.style.outline = `${currentThickness}px solid ${colors[idx % colors.length]}`; currentThickness += direction; }, 100); [...el.children].forEach(child => setColor(child, idx + 1)); }; setColor(document.body, 0); })();




make it do a barrel roll


javascript:(function() { const applyRotation = (el, t) => { el.style.cssText = `transition:transform ${t}s; transform-style:preserve-3d; perspective:2048px; transform:rotateY(360deg)`; [...el.children].forEach(child => applyRotation(child, t + 0.4)); }; applyRotation(document.body, 1); })();


fuck that was sick




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: