<html>
<head>
<meta name="description" content="scrollSnapDotsClip">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>scrollSnapDotsClip</title>
</head>
<body>
<div class="footer">
<a href="#p1" class="faint"></a>
<a href="#p2" class="faint"></a>
<a href="#p3" class="faint"></a>
<a href="#p4" class="faint"></a>
<a href="#p5" class="faint"></a>
</div>
<div class="app">
<div class="pages">
<div id="p1" class="page">
<div class="foot">
<div class="dot">
<div class="dot-inner">
<div class="dot-val"></div>
</div>
</div>
</div>
</div>
<div id="p2" class="page">
<div class="foot">
<div class="dot">
<div class="dot-inner">
<div class="dot-val"></div>
</div>
</div>
</div>
</div>
<div id="p3" class="page">
<div class="foot">
<div class="dot">
<div class="dot-inner">
<div class="dot-val"></div>
</div>
</div>
</div>
</div>
<div id="p4" class="page">
<div class="foot">
<div class="dot">
<div class="dot-inner">
<div class="dot-val"></div>
</div>
</div>
</div>
</div>
<div id="p5" class="page">
<div class="foot">
<div class="dot">
<div class="dot-inner">
<div class="dot-val"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
@import url('https://necolas.github.io/normalize.css/3.0.2/normalize.css');
html {
box-sizing: border-box;
background: #fff;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
.app {
position: absolute;
top: 0;
right: 0;
height: 90vh;
left: 0;
pointer-events: none;
overflow-x: auto;
overflow-y: hidden;
overflow-scrolling: touch;
scroll-snap-type: mandatory;
scroll-snap-type: mandatory;
scroll-snap-destination: 50% 50%;
scroll-snap-destination: 50% 50%;
display: flex;
display: flex;
flex-flow: column;
flex-flow: column;
}
.pages {
flex: 0 0 auto;
display: flex;
display: flex;
flex-flow: row;
flex-flow: row;
height: 80vh;
}
.page {
position: relative;
width: 100vw;
background: url('http://placekitten.com/300/700') no-repeat center;
background-size: cover;
height: 100%;
pointer-events: auto;
scroll-snap-coordinate: 50% 50%;
scroll-snap-coordinate: 50% 50%;
flex: 0 0 auto;
flex: 0 0 auto;
&:nth-child(1) {}
&:nth-child(2) {background-image: url('http://placekitten.com/600/800');}
&:nth-child(3) {background-image: url('http://placekitten.com/600/850');}
&:nth-child(4) {background-image: url('http://placekitten.com/600/900');}
&:nth-child(5) {background-image: url('http://placekitten.com/600/950');}
}
.footer {
position: fixed;
top: 80vh;
width: 100%;
left: 0;
flex: 0 0 auto;
flex: 0 0 auto;
height: 10vh;
display: flex;
display: flex;
flex-flow: row;
flex-flow: row;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
}
.faint {
background: #ddd;
border-radius: 100%;
height: 2vh;
width: 2vh;
margin: 0 1vh;
}
.foot {
width: 100%;
position: absolute;
top: 100%;
height: 10vh;
display: flex;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
justify-content: center;
pointer-events: none;
}
.dot {
position: relative;
height: 100%;
width: 100%;
}
.dot-inner {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
clip: rect(auto, auto, auto, auto);
}
.dot-val {
position: fixed;
left: 0;
right: 0;
top: 80vh;
height: 10vh;
display: flex;
display: flex;
justify-content: center;
justify-content: center;
&::after {
content: '';
width: 2vh;
height: 2vh;
margin-top: 4vh;
background: #f00;
display: block;
border-radius: 100%;
.page:nth-child(1) & { margin-right: 16vh; }
.page:nth-child(2) & { margin-right: 8vh; }
.page:nth-child(3) & { }
.page:nth-child(4) & { margin-left: 8vh; }
.page:nth-child(5) & { margin-left: 16vh; }
}
}
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |