summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/index.html b/index.html
index 53b2c2a..949b29e 100644
--- a/index.html
+++ b/index.html
@@ -129,5 +129,39 @@
129 <div id="yeah-on">Unyeah</div> 129 <div id="yeah-on">Unyeah</div>
130 </label> 130 </label>
131 </div></div></div> 131 </div></div></div>
132 <script>
133 var trailLength = 12;
134 var path = [];
135 var delay = 100;
136 var lastX = 0;
137 var lastY = 0;
138
139 function createMouseTrail() {
140 for (var i = 0; i < trailLength; i++) {
141 var div = document.createElement('div');
142 div.setAttribute('class', 'trail');
143 div.style.top = '-200px';
144 div.style.left = '-200px';
145 div.style.backgroundImage = 'url(/css/cursor.gif)';
146 div.style.backgroundSize = 'cover';
147 div.style.width = '11px';
148 div.style.height = '19px';
149 document.body.appendChild(div);
150 path.push(div);
151 }
152 }
153
154 function moveTrail(e) {
155 for (let i = 0; i < path.length; i++) {
156 setTimeout(function() {
157 path[i].style.top = (e.clientY) + 'px';
158 path[i].style.left = (e.clientX) + 'px';
159 }, i * delay);
160 }
161}
162
163 document.addEventListener('mousemove', moveTrail);
164 createMouseTrail();
165 </script>
132 </body> 166 </body>
133</html> 167</html>