forked from rikschennink/fitty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
49 lines (38 loc) · 920 Bytes
/
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
<!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">' + line + '</div>';
});
}
document.querySelector('main').innerHTML = html;
// is delayed a bit so it's clear when fitty kicks in
setTimeout(function(){
console.log( fitty('.fit') );
}, 1500);
</script>
</body>
</html>