This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // <a href="#" onclick="doScrolling('#myID', 1500)"> | |
| function getElementY(query) { | |
| return window.pageYOffset + document.querySelector(query).getBoundingClientRect().top | |
| } | |
| function doScrolling(element, duration) { | |
| var startingY = window.pageYOffset | |
| var elementY = getElementY(element) | |
| var targetY = document.body.scrollHeight - elementY < window.innerHeight ? document.body.scrollHeight - window.innerHeight : elementY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| window.addEventListener("resize", aspectRatio); | |
| function aspectRatio() { | |
| var w = window.innerWidth; | |
| var h = window.innerHeight; | |
| var r = w/10; | |
| var aspect = document.querySelector('pre'); | |
| var rounded = Math.round( h/r * 10 ) / 10; | |
| aspect.innerHTML = "<pre style='position:fixed; top: 30px; right: 30px; color: #fff; background: #000; padding: 10px 20px; z-index: 99999999;'>"+ w/r +":"+ rounded +"</pre>"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| -webkit-font-smoothing: antialiased; | |
| -moz-osx-font-smoothing: grayscale; | |
| } |
NewerOlder