Re:18yo arrested for reporting a bug in the new Budapest e-T...
by tekromancr on Monday July 24, 2017 @12:12AM
(#14835844)
I want to emulate that behavior somehow.
[ Parent
| on HN ]
Re:18yo arrested for reporting a bug in the new Budapest e-T...
by sgentle on Monday July 24, 2017 @02:14AM
(#14836214)
So I tried but the results were... um, unexpected: https://gfycat.com/negligiblesnivelingastarte
Code:
var db = document.body;document.onscroll = function(){db.style.transform = 'scaleY(1)'; db.style.transform = 'scaleY('+db.scrollHeight / (db.scrollHeight - db.scrollTop)+')'}
Re:18yo arrested for reporting a bug in the new Budapest e-T...
by Casseres on Monday July 24, 2017 @03:14AM
(#14836457)
That looks like it would be a good April Fool's Day prank.
Re:18yo arrested for reporting a bug in the new Budapest e-T...
by nWjbyf45T on Monday July 24, 2017 @06:26AM
(#14837230)
It seems from the code you first stretch it out to Infinity and then when scrollTop is bigger than scrollHeight, you go from negative Infinity back to 1. Negative values of scale() 'mirrors' the element. Maybe make sure scrollTop is never equal to or bigger than scrollHeight.
Re:18yo arrested for reporting a bug in the new Budapest e-T...
by daxterspeed on Monday July 24, 2017 @11:54AM
(#14839501)
This result is by itself amazing, but if you want to make it behave a bit more like the bug you can set the transform-origin to "center bottom".