forked from min30327/luxy.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·155 lines (153 loc) · 7.99 KB
/
index.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Luxy.js|Inertia scroll and parallax effect plugin in Vanilla.js</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0">
<meta name="robots" content="index,follow">
<link href="https://fonts.googleapis.com/css?family=Oleo+Script|Source+Sans+Pro" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="test/style.css">
<link rel="stylesheet" href="test/prittyprint.css">
</head>
<body>
<div id="luxy">
<main id="main">
<div id="section01" class="vh-element" data-props="padding-top,padding-bottom" data-values="45,45">
<div id="bg-section01" class="luxy-el bg-section" data-speed-y="40"></div>
<div class="content-inner">
<div class="d-flex justify-content-center oleo">
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-12">L</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-6">u</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-3">x</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="0">y</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="3">.</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="6">j</div>
<div class="luxy-el inner-el" data-horizontal="1" data-speed-x="12">s</div>
</div>
<div class="text-center">
<p>Inertia scroll and parallax effect plugin in Vanilla.js</p>
<div><a href="https://github.com/min30327/luxy.js" class="btn btn-ghost" target="_blank">View on GitHub</a></div>
</div>
</div>
</div>
<div id="section02">
<div class="container z-depth-2">
<div class="row justify-content-center">
<div class="col-lg-8">
<h3 class="oleo title text-center mb-3">Installation</h3>
<p>You can install it using npm:</p>
<div class="code-print">
<pre class="prettyprint linenums"><code class="language-html">npm install luxy.js --save</code></pre>
</div>
<p>Or just include the script in your page:</p>
<div class="code-print">
<pre class="prettyprint linenums"><code class="language-html"><script src="path/to/luxy.js" charset="utf-8"></script></code></pre>
</div>
<p>Included luxy.js in your project and initialize:</p>
<div class="code-print">
<pre class="prettyprint linenums">
<code class="language-html"><script charset="utf-8">
luxy.init();
</script></code>
</pre>
</div>
</div>
</div>
</div>
<div id="fog01" class="luxy-el vh-element" data-speed-y="-5" data-props="bottom" data-values="-30">
<img src="test/img/fog01.png" alt="fog">
</div>
</div>
<div id="section03" class="vh-element" data-props="padding-top" data-values="50">
<div id="bg-section02" class="luxy-el bg-section" data-speed-y="-10"></div>
</div>
<div id="section04">
<div id="fog02" class="luxy-el vh-element" data-speed-y="-5" data-props="bottom" data-values="-50">
<img src="test/img/fog01.png" alt="fog02">
</div>
<div class="container z-depth-2">
<div class="row justify-content-center">
<div class="col-lg-8">
<h3 class="oleo title text-center mb-3">Usage</h3>
<p>Wrap the entire content with the element specified in the wrapper option. Please exclude fixed elements.</p>
<div class="code-print">
<pre class="prettyprint linenums">
<code class="language-html"><div id="luxy">
... Entire content
</div></code>
</pre>
</div>
<p>Add .luxy-el to the element for which parallax effect is to be specified.</p>
<div class="code-print"><pre class="prettyprint linenums"><code class="language-html"><div id="luxy">
<div class="luxy-el"></div>
</div></code></pre></div>
<p>Specify the speed of the parallax effect with the data-speed-y attribute and offset with the data-offset attribute.</p>
<div class="code-print"><pre class="prettyprint linenums"><code class="language-html"><div id="luxy">
<div class="luxy-el" data-speed-y="5" data-offset="-50"></div>
</div></code></pre></div>
<p>If you want to move horizontally, specify data-horizontal="1" and specify the speed in the horizontal direction with the data-speed-x attribute.</p>
<div class="code-print"><pre class="prettyprint linenums"><code class="language-html"><div id="luxy">
<div class="luxy-el" data-horizontal="1" data-speed-x="-5"></div>
</div></code></pre></div>
</div>
</div>
</div>
</div>
<div id="section05" class="vh-element" data-props="padding-top" data-values="50">
<div id="bg-section03" class="luxy-el bg-section" data-speed-y="-10"></div>
</div>
<div id="section06">
<div class="container z-depth-2">
<div class="row justify-content-center">
<div class="col-lg-8">
<h3 class="oleo title text-center mb-3">Options</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<th>wrapper</th>
<td>'#luxy'</td>
<td>Entire content wrapper element.</td>
</tr>
<tr>
<th>targets</th>
<td>'.luxy-el'</td>
<td>Parallax effect targets elements.</td>
</tr>
<tr>
<th>wrapperSpeed</th>
<td>0.08</td>
<td>Inertia scroll speed.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<footer id="footer">
<div id="copyright">
Luxy.js © 2018 Mineo Okuda. released under MIT license
</div>
</footer>
</div>
<script src="https://rawgit.com/google/code-prettify/master/loader/run_prettify.js" defer></script>
<script src="test/script.js" charset="utf-8"></script>
<script src="dist/js/luxy.js" charset="utf-8"></script>
<script>
luxy.init({
wrapper: '#luxy',
targets : '.luxy-el',
wrapperSpeed: 0.08
});
</script>
</body>
</html>