-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
91 lines (85 loc) · 1.86 KB
/
test.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Show On Scroll</title>
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
.box {
width: 300px;
height: 300px;
background: blue;
margin: 20px;
}
.wrap {
display: flex;
flex-wrap: wrap;
min-height: 100vh;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<h1>Show On Scroll</h1>
<div class="wrap">
<div class="box one"></div>
</div>
<div class="wrap">
<div class="box two"></div>
<div class="box two"></div>
</div>
<div class="wrap">
<div class="box three"></div>
<div class="box three"></div>
<div class="box three"></div>
</div>
<div class="wrap">
<div class="box four"></div>
</div>
<div class="wrap">
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
<div class="box five"></div>
</div>
<div class="wrap">
<div class="box six"></div>
<div class="box six"></div>
<div class="box six"></div>
</div>
<script type="module">
import showOnScroll, {
fadeSlideUp,
fadeSlideDown,
wipeUp,
wipeDown,
makeTransition
} from './dist/index.js';
const customTransition = makeTransition({
start: {'background': 'green'},
end: {
'background': 'red',
'transition': '1s background'
}
});
const modifiedTransiton = {...wipeUp, stagger: 0};
showOnScroll('.box.one', fadeSlideUp);
showOnScroll('.box.two', fadeSlideDown, el => console.log(el));
showOnScroll('.box.three', wipeUp);
showOnScroll('.box.four', wipeDown);
showOnScroll('.box.five', customTransition);
showOnScroll('.box.six', modifiedTransiton);
</script>
</body>
</html>