-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (39 loc) · 1003 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href='https://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'>
</head>
<body>
<div>
<!-- 'line-break: strict' THIS IS THE MOST IMPORTANT PIECE! -->
<textarea style="display: inline-block;
width: 400px;
height: 200px;
background: #fafafa;
border: none;
margin: 0;
padding: 0;
line-break: strict;
font-family: 'Reenie Beanie';
font-size: 31px;" wrap="hard">Lorem,
ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.
-Travis</textarea>
</div>
<div>
<button type="button" id="update">Update</button>
</div>
<hr>
<script src="./linebreak-algorithm.js" type="text/javascript"></script>
<script type="text/javascript">
var t = document.getElementsByTagName('textarea')[0];
window.onload = function() {
applyLineBreaks(t);
var btn = document.getElementById('update');
btn.onclick = function() {
applyLineBreaks(t);
}
}
</script>
</body>
</html>