Created
September 6, 2024 14:06
-
-
Save Kvnbbg/e1f27dcfbd2b9738abf18d6af4531886 to your computer and use it in GitHub Desktop.
Revisions
-
Kvnbbg created this gist
Sep 6, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ CSS Scroll Snap --------------- A [Pen](https://codepen.io/denic/pen/ExNZmwd) by [Marko](https://codepen.io/denic) on [CodePen](https://codepen.io). [License](https://codepen.io/license/pen/ExNZmwd). 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ <div class="wrapper"> <div class="section"> Content 1 </div> <div class="section bg-blue"> Content 2 </div> <div class="section bg-green"> Content 3 </div> <div class="section"> Content 4 </div> <div class="section bg-blue"> Content 5 </div> </div> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <script src="https://codepen.io/denic/pen/YzyPzKG.js"></script> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ body { margin: 0; padding: 0; } .wrapper { height: 100vh; overflow: auto; scroll-snap-type: y mandatory; } .section { scroll-snap-align: center; height: 100vh; display: flex; justify-content: center; align-items: center; background-color: #de5448; color: #fff; font-size: 3em; } .bg-blue { background: #4267b2; } .bg-green { background: #4CAF50; } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ <link href="https://codepen.io/denic/pen/YzyPzKG.css" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />