-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (47 loc) · 1.97 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
<!DOCTYPE html>
<html>
<head>
<script type=module>
import {RepulsiveElements} from './RepulsiveElements.js'
const fluffy = new RepulsiveElements( document.getElementById('someText'),{textSplitter:' '})
const fluffy2 = new RepulsiveElements(document.getElementById('someText2'))
new RepulsiveElements(document.getElementById('friction'),{friction:0.9})
new RepulsiveElements(document.getElementById('explosive'),{mouseK:0.9})
new RepulsiveElements(document.getElementById('hello'),{mouseK:50,friction:0.9})
new RepulsiveElements(document.getElementById('alliteration'),{textSplitter:'p'})
console.log('f1',fluffy)
console.log('f2',fluffy2)
</script>
</head>
<body>
<a href="https://github.com/m0ose/RepulsiveElements" style='position: absolute;top: 0px;right: 0px;'><img loading="lazy" width="149" height="149" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_red_aa0000.png?resize=149%2C149" class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a> <br>
<h1 id='hello'>RepulsiveElements v0.1</h1>
<div id='someText'>
how are you doing?
<br>
<h3>Hover the mouse over this.</h3>
<br>
<a href='javascript:null'> And it works with links.</a>
<br>
</div>
<div id='someText2'>
So, words aren't enough.
<br>
You want each letter to move around huh.
<br>
<div>Nested elements work<span> <i>most of </i><span> the time too, even with <a href='javascript:null'> a link</a></span></span>
</div>
</div>
</div>
<hr>
<div><b>Options:</b></div>
<div id='friction'><b>Friction Coefficiant</b>=0.9</div>
<div id='explosive'><b>mouseK</b>=0.9</div>
<div><b>textSplitter</b>='p' <span id='alliteration'>peter piper picked a peck of pickled peppers</span></div>
<hr>
<div><b>Usage:</b></div>
<code>
new RepulsiveElements(document.getElementById('someElement'))
</code>
</body>
</html>