// jQuery
$(document).ready(function() {
// code
})
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
| let scrollPos = 0; | |
| const nav = document.querySelector('.site-nav'); | |
| function checkPosition() { | |
| let windowY = window.scrollY; | |
| if (windowY < scrollPos) { | |
| // Scrolling UP | |
| nav.classList.add('is-visible'); | |
| nav.classList.remove('is-hidden'); | |
| } else { |
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
| // https://codepen.io/cmykw/pen/gemxJm | |
| // layout | |
| <nav/> | |
| // style | |
| <style> | |
| body { min-height: 200vh; } | |
| nav { |
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
| #root { | |
| padding: 3rem; | |
| text-align: center | |
| } | |
| #root h1 { | |
| font-family: 'Press Start 2P', Consolas, monospace; | |
| color: white; | |
| } | |
| <div id="root"> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="css/style.css"> | |
| </head> | |
| <body> |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| var spData = null; | |
| function doData(json) { | |
| spData = json.feed.entry; | |
| } | |