-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathone.html
More file actions
55 lines (50 loc) · 1.13 KB
/
one.html
File metadata and controls
55 lines (50 loc) · 1.13 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Choreographer-JS | Example One</title>
</head>
<body>
<style>
p {
position: fixed;
top: 100px;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.1em;
font-family: 'Arial', sans-serif;
color: white;
text-align: center;
width: 100%;
z-index: 1;
}
#box {
margin: 0 0;
width: 100%;
height: 500vh;
background: black;
opacity: 0.2;
}
</style>
<p>Animating based on scroll location.</p>
<div id="box"></div>
<script src="../dist/choreographer.min.js"></script>
<script>
var choreographer = new Choreographer({
animations: [
{
range: [-1, window.innerHeight * 4],
selector: '#box',
type: 'scale',
style: 'opacity',
from: 0.2,
to: 1
}
]
})
window.addEventListener('scroll', function() {
choreographer.runAnimationsAt(window.pageYOffset)
})
</script>
</body>
</html>