5 ms·
replace orangered with random color, lil more visually descriptive: javascript:document.querySelectorAll("*") .forEach(el=>el.style.outline=`1px solid
by Jerrrry 3y ago
replace orangered with random color, lil more visually descriptive:
javascript:document.querySelectorAll("*")
.forEach(el=>el.style.outline=`1px solid ${
Math.floor(Math.random()*2*16).toString(16)
}`)
- flir 3y agoSweet. We could pull the colours from an array instead of generating them randomly: javascript: (function() { const colors = ['red', 'green', 'blue']; const setColor = (el, idx) => { el.style.outline = `1px solid ${colors[idx % colors.length]}`; [...el.children].forEach(child => setColor(child, idx + 1)); }; setColor(document.body, 0); })(); Thus green is always inside red. Any advances?
- kacesensitive 3y agoIdk. 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); })();
- Jerrrry 3y agomake it do a barrel roll
- flir 3y agojavascript:(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); })();
- Jerrrry 3y agofuck that was sick