-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
50 lines (44 loc) · 1.04 KB
/
index.js
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
import './styles.css';
import fitText from '../src/index.js';
document.addEventListener('DOMContentLoaded', () => {
const test1 = document.getElementById('test1');
const el = test1.querySelector('.el');
fitText({
el,
maxWidth: 100,
maxHeight: 100,
afterFit: console.log,
});
const test2 = document.getElementById('test2');
const el2 = test2.querySelector('.el');
fitText({
el: el2,
box: test2,
afterFit: console.log,
});
const test3 = document.getElementById('test3');
const el3 = test3.querySelector('.el');
fitText({
el: el3,
box: test3,
boxWidthOnly: true,
afterFit: console.log,
});
const test4 = document.getElementById('test4');
const el4 = test4.querySelector('.el');
fitText({
el: el4,
box: test4,
singleLine: true,
boxWidthOnly: true,
afterFit: console.log,
});
const test5 = document.getElementById('test5');
const el5 = test5.querySelector('.el');
fitText({
el: el5,
box: test5,
clipOnly: true,
afterFit: console.log,
});
});