Full Screen Scrolling Layout (wip)
How do I make an full screen scrolling layout (wip)?
It's currently totally inflexible. Still need to add support for a dynamic number of pages.. What is a full screen scrolling layout (wip)? How do you make a full screen scrolling layout (wip)? This script and codes were developed by Matt Gross on 28 August 2022, Sunday.
Full Screen Scrolling Layout (wip) - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Full Screen Scrolling Layout (wip)</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="up arrow invisible"></div>
<div class="label label-up label-first">First</div>
<div class="label label-up label-second-1">Second</div>
<div class="down arrow"></div>
<div class="label label-down label-second-2">Second</div>
<div class="label label-down label-third">Third</div>
<ul class="nav"> <li><a href="#one" id="menu-1" class="inactive">First</a><div></div></li> <li><a href="#two" id="menu-2" class="inactive">Second</a><div></div></li> <li><a href="#three" id="menu-3" class="inactive">Third</a><div></div></li> <!-- <li><a href="#four" id="menu-4" class="inactive">Fourth</a><div></div></li> -->
</ul>
<section class="base" id="one"> <article class="content"> <p class="law"> Now this is the Law of the Jungle -- <br /> as old and as true as the sky;<br />
And the Wolf that shall keep it may prosper, <br />
but the Wolf that shall break it must die. </p> </article>
</section>
<section class="base" id="two"> <article class="content"> <p class="law"> As the creeper that girdles the tree-trunk <br />
the Law runneth forward and back --<br />
For the strength of the Pack is the Wolf,<br />
and the strength of the Wolf is the Pack. </p> </article>
</section>
<section class="base" id="three"> <article class="content"> <p class="law"> Wash daily from nose-tip to tail-tip;<br />
drink deeply, but never too deep;<br />
And remember the night is for hunting,<br />
and forget not the day is for sleep. </p> </article>
</section>
<!-- <section class="base" id="four"> <article class="content"> <p class="law"> Rudyard Kipling, The Jungle Book </p> </article>
</section> --> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Full Screen Scrolling Layout (wip) - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,100);
*,
*:before,
*:after { margin: 0; padding: 0; -moz-box-sizing: border-box; box-sizing: border-box;
}
body { overflow: auto; background: #111; -webkit-backface-visibility: hidden; font-family: "Open Sans", Helvetica, sans-serif; font-weight: 100;
}
.base { width: 100%; background: #111;
}
#one { background: #131419;
}
#two { background: #202128;
}
#three { background: #303038;
}
#four { background: #404048;
}
.content { color: #fff; padding: 40px 0; margin: 0 100px; text-align: center; position: relative; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%);
}
.law { max-width: 600px; width: 50%; min-width: 370px; margin: 0 auto; line-height: 1.5;
}
.arrow { position: fixed; left: 50%; height: 40px; width: 40px; border: 20px solid; opacity: 1; transition: .4s ease; -webkit-transform: translateX(-50%); transform: translateX(-50%);
}
.arrow:not(.invisible) { cursor: pointer;
}
.invisible { opacity: 0; border: 0px solid;
}
.up { top: 20px; border-color: transparent transparent #ccc transparent;
}
.down { bottom: 20px; border-color: #ccc transparent transparent transparent;
}
.nav { position: fixed; right: 0; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%);
}
.nav li { list-style: none; text-align: right;
}
.nav li a { display: inline-block; padding: 0 5px; color: #ccc; text-decoration: none; line-height: 30px; -webkit-transition: .2s ease; transition: .2s ease;
}
.nav li a:after { content: ''; display: inline-block; background: transparent; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #eee; margin: 0 10px; -webkit-transition: .3s ease; transition: .3s ease;
}
.nav li a.active { color: #fff;
}
.nav li a.active:after { border: 6px solid #eee;
}
.label { position: fixed; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #eee; -webkit-transition: .3s ease; transition: .3s ease;
}
.label-up { top: 64px;
}
.label-down { bottom: 64px;
}
Full Screen Scrolling Layout (wip) - Script Codes JS Codes
//Setting the height to the window height var viewportHeight = $(window).height(); //window height var position = $(window).scrollTop(); //position of the viewport var pages = $('ul.nav a').length; //number of sections/links var $one = $(' #menu-1 '); var $two = $(' #menu-2 '); var $three = $(' #menu-3 ');
$(document).ready(function(){ resizeBase(); makeOneActive();
});
$(window).resize(function() { resizeBase();
});
function resizeBase() { var viewportHeight = $(window).height(); //refigure window height $('.base').css({'height': viewportHeight});
}
//direct links to each section
$('a[href*=#]').click(function(){ $('html, body').animate({ scrollTop: $( $.attr(this, 'href') ).offset().top }, 600); event.preventDefault(); this.addClass( 'current' );
});
//triggers a function for each section based on where the scroll position is
$(window).scroll(function() { position = $(window).scrollTop(); if( (viewportHeight/2) > position > 0 ) { //alert(position); makeOneActive(); } else if( (viewportHeight * 1.5) > position && position > (viewportHeight/2) ) { //alert(position); makeTwoActive(); } else { //alert(position); makeThreeActive(); }
});
//function for the first panel
function makeOneActive() { $one.addClass( 'active' ); $two.removeClass( 'active' ); $three.removeClass( 'active' ); $( 'div.label' ).addClass( 'invisible' ); $( 'div.label-second-2' ).removeClass( 'invisible' ); $( 'div.up' ).addClass( 'invisible' ); $( 'div.down' ).removeClass( 'invisible' );
}
//function for the second panel
function makeTwoActive() { $one.removeClass( 'active' ); $two.addClass( 'active' ); $three.removeClass( 'active' ); $( 'div.label' ).addClass( 'invisible' ); $( 'div.label-third' ).removeClass( 'invisible' ); $( 'div.label-first' ).removeClass( 'invisible' ); $( 'div.up' ).removeClass( 'invisible' ); $( 'div.down' ).removeClass( 'invisible' );
}
//function for the third panel
function makeThreeActive() { $one.removeClass( 'active' ); $two.removeClass( 'active' ); $three.addClass( 'active' ); $( 'div.label' ).addClass( 'invisible' ); $( 'div.label-second-1' ).removeClass( 'invisible' ); $( 'div.up' ).removeClass( 'invisible' ); $( 'div.down' ).addClass( 'invisible' );
}
//scrolls the page down one viewport height
$('div.down').click(function() { $('html, body').animate({ scrollTop: $(window).scrollTop()+viewportHeight }, 500);
});
//scrolls the page up one viewport height
$('div.up').click(function() { $('html, body').animate({ scrollTop: $(window).scrollTop()-viewportHeight }, 500);
});
Developer | Matt Gross |
Username | mattgrosswork |
Uploaded | August 28, 2022 |
Rating | 3.5 |
Size | 3,565 Kb |
Views | 32,384 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Site Menu | 6,873 Kb |
CSS-Only Fly Menu | 3,744 Kb |
Basic Fullscreen Video Background | 2,208 Kb |
Working on a Volusion version of a Drupal Theme | 6,095 Kb |
Fiddling with css-only parallax | 2,996 Kb |
Easy Lines Around a Subtitle | 1,807 Kb |
Playing with transition timing | 1,993 Kb |
Super Basic Inline Menu | 1,668 Kb |
EvenVision Branded Ajax Loader | 3,023 Kb |
Basic Flexbox Reference | 1,662 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Electric worm | Jeffibacache | 2,377 Kb |
Greyscale image with filter in CSS3 | NickyCDK | 1,562 Kb |
Cool audio | Bigliam | 1,868 Kb |
Simple Flat Menu | Jeplaa | 2,467 Kb |
Scroll to view if element partially out of view port height | ChrisMaki | 2,104 Kb |
Arrow Navigation | Hinducows | 1,973 Kb |
Ipad Mini Showcase | Hornebom | 10,479 Kb |
BlueBox Fork | Huskynation | 12,675 Kb |
Isometric css island | Xaddict | 2,950 Kb |
Draggable directive | YahyaKacem | 2,277 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!