-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmrd-smoothscroller.html
61 lines (60 loc) · 1.76 KB
/
mrd-smoothscroller.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mr.D - Smooth Scroller Example</title>
<meta name="description" content="SmoothScroller.js - A lightweight JavaScript library for smooth scrolling with customizable options.">
<meta name="author" content="mr.D - Carl Durocher - www.carldurocher.com">
<style>
body,html {
font-family: Arial, sans-serif;
padding: 0;
margin:0;
}
section {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-size: 4em;
text-transform: uppercase;
}
nav {
position: fixed;
top: 0;
left:0;
width: 100%;
background: #333;
color: white;
text-align: center;
padding: 1em 0;
}
nav a {
color: white;
margin: 0 1em;
text-decoration: none;
}
</style>
</head>
<body class="mrd-smooth"
data-scroll-duration="1000"
data-scroll-deceleration="0.96"
data-scroll-sensitivity="0.05"
data-scroll-isScrolling="false"
data-scroll-velocity="0">
<nav>
<a href="#section1">Section 1</a>
<a href="#section2">Section 2</a>
<a href="#section3">Section 3</a>
<a href="#section4">Section 4</a>
<a href="#section5">Section 5</a>
</nav>
<section id="section1" style="background-color:black; color: white;">Section 1</section>
<section id="section2">Section 2</section>
<section id="section3" style="background-color:black; color: white;">Section 3</section>
<section id="section4">Section 4</section>
<section id="section5" style="background-color:black; color: white;">Section 5</section>
<script src="mrd-smoothscroller.js"></script>
</body>
</html>