forked from rikschennink/fitty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
60 lines (45 loc) · 1.08 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Fitty Test Page</title>
<style>
/* uncomment to test pre-style logic */
.fit {
display:inline-block;
white-space:nowrap;
}
</style>
</head>
<body>
<main></main>
<script src="dist/fitty.min.js"></script>
<script>
var lines = [
'Integer',
'Lorem ipsum dolor sit amet.',
'consectetur adipiscing elit.',
'Maecenas elementum purus nec felis pellentesque, eget volutpat mauris vestibulum.'
];
var html = '';
for (i=0;i<25;i++) {
lines.forEach(function(line) {
html += '<div class="fit" style="color:red;">' + line + '</div>';
});
}
document.querySelector('main').innerHTML = html;
var fitties = [];
// is delayed a bit so it's clear when fitty kicks in
setTimeout(function(){
fitties = fitty('.fit');
console.log( fitties );
setTimeout(function(){
fitties.forEach(f => {
f.unsubscribe();
})
}, 3000);
}, 1500);
</script>
</body>
</html>