This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
forked from Reinmar/warsawjs-workshop-30-spreadsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (87 loc) · 1.82 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample spreadsheet app – WarsawJS Workshop #30 – JavaScript runtime preformance</title>
<style>
body {
padding: 0;
margin: 0;
overflow: hidden;
background: #000;
}
.status-bar {
position: relative;
box-sizing: border-box;
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #DB3;
border-bottom: solid 2px #A82;
z-index: 1;
}
.status-bar h1 {
margin: 0 0 0 20px;
font-size: 30px;
}
.status-bar__current-cell {
width: 20%;
text-align: right;
margin-right: 20px;
}
.container {
position: absolute;
width: 100%;
height: calc( 100% - 50px );
padding: 0;
margin: 0;
overflow: scroll;
/* Not sure why it breaks the scrolling */
/* contain: layout; */
}
.row {
position: absolute;
width: 100%;
/* Totally deoptimises it... */
/* will-change: transform; */
/* Not sure why it breaks the scrolling */
/* contain: layout; */
}
.cell {
position: absolute;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
background: white;
/* Totally deoptimises it... */
/* will-change: transform; */
/* contain: layout; */
}
.cell.selected {
background: #68F;
}
/* Hide excessive columns to not affect painting too much. See DISPLAY_COLUMNS2. */
.cell:nth-child(n+38) {
display: none;
}
.row[data-row="0"] .cell {
background: #CCC;
}
</style>
</head>
<body>
<div class="status-bar">
<h1><a href="https://youtu.be/NC_Bev1TTM4?t=22">Toby, the spreadsheet</a></h1>
<div class="status-bar__actions">
<button onclick="initToby()">Init</button>
<button onclick="destroyToby()">Destroy</button>
</div>
<div class="status-bar__current-cell"></div>
</div>
<div class="container"></div>
<script src="dist/index.js"></script>
</body>
</html>