-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkoch-code.html
More file actions
252 lines (248 loc) · 8.96 KB
/
Copy pathkoch-code.html
File metadata and controls
252 lines (248 loc) · 8.96 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="theme-color" content="#000000" />
<link rel="canonical" href="https://markupmonks.com/koch-code.html" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Markup Monks" />
<meta property="og:title" content="Koch Code - Markup Monks" />
<meta property="og:description" content="A grid tiled edge-to-edge where every line segment is its own animated Koch curve, with organically drifting recursion depth." />
<meta property="og:url" content="https://markupmonks.com/koch-code.html" />
<meta property="og:image" content="https://markupmonks.com/android-chrome-512x512.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Koch Code - Markup Monks" />
<meta name="twitter:description" content="A grid tiled edge-to-edge where every line segment is its own animated Koch curve, with organically drifting recursion depth." />
<meta name="twitter:image" content="https://markupmonks.com/android-chrome-512x512.png" />
<meta name="description" content="A grid tiled edge-to-edge where every line segment is its own animated Koch curve, with organically drifting recursion depth." />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@100;300;400;600;700&display=swap"
rel="stylesheet" />
<link href="dist/css/style.css" rel="stylesheet" />
<script type="module" src="dist/js/components/mm-kochcode.js"></script>
<script type="module" src="dist/js/components/ui-elements/side-bar.js"></script>
<script type="module" src="dist/js/koch-code.js"></script>
<script type="module" src="dist/js/utils/title-card.js"></script>
<title>Koch Code - Markup Monks</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B0BEV3T4NK"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-B0BEV3T4NK');
</script>
</head>
<body>
<div class="content" data-content>
<side-bar></side-bar>
<section class="fractals">
<header class="fractals__header fractals__header--full-view" data-title-card>
<button type="button" class="title-card__close" data-close-title aria-label="Close title">×</button>
<h1 class="fractals__main-header">Koch Code</h1>
<h5 class="fractals__sub-header">
Web component for Koch Code
</h5>
<p class="intro__details code">
Usage:
<code><mm-kochcode grid-cols="14" grid-rows="11" levels="4"></mm-kochcode>
</code>
</p>
</header>
<button type="button" class="title-card__open" data-open-title></button>
<div class="koch-grid">
<mm-kochcode class="koch-grid__canvas" data-koch-el grid-cols="14" grid-rows="11" levels="4"
showgrowth="false"></mm-kochcode>
</div>
<div class="koch-controls collapsed" data-koch-controls>
<button type="button" class="koch-controls__close" data-close-controls aria-label="Close toolbar">×</button>
<div class="koch-controls__group">
<label>
Grid Columns:
<input type="range" min="2" max="16" value="14" step="1" data-grid-cols>
<span class="koch-controls__value" data-grid-cols-value>14</span>
</label>
<label>
Grid Rows:
<input type="range" min="2" max="12" value="11" step="1" data-grid-rows>
<span class="koch-controls__value" data-grid-rows-value>11</span>
</label>
</div>
<div class="koch-controls__group">
<label>
Max Detail:
<input type="range" min="0" max="4" value="4" step="1" data-max-levels>
<span class="koch-controls__value" data-max-levels-value>4</span>
</label>
<label>
Animation Speed:
<input type="range" min="0" max="5" value="4" step="0.1" data-anim-speed>
<span class="koch-controls__value" data-anim-speed-value>4.0x</span>
</label>
</div>
<div class="koch-controls__buttons">
<button type="button" class="koch-controls__play-pause" data-play-pause>Pause</button>
</div>
</div>
<button type="button" class="koch-controls__open visible" data-open-controls>Open Toolbar</button>
</section>
</div>
<style>
.koch-grid {
position: absolute;
top: 0;
left: 0;
width: 100dvw;
height: 100dvh;
overflow: hidden;
}
.koch-grid__canvas {
display: grid;
width: 100%;
height: 100%;
}
.koch-controls {
position: fixed;
z-index: 99;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
background: rgba(20, 20, 24, 0.16);
backdrop-filter: blur(2px) saturate(165%);
-webkit-backdrop-filter: blur(2px) saturate(165%);
border: 1px solid rgba(255, 255, 255, 0.28);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3);
padding: 16px;
border-radius: 24px;
color: rgba(255, 255, 255, 0.72);
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.35);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
width: 90%;
max-width: 460px;
text-align: center;
font-family: 'IBM Plex Sans', sans-serif;
transition: opacity 0.3s ease, transform 0.3s ease;
transform-origin: bottom center;
}
.koch-controls.collapsed {
opacity: 0;
transform: translateX(-50%) scale(0.85) translateY(10px);
pointer-events: none;
}
.koch-controls__close {
position: absolute;
top: 8px;
right: 8px;
width: 22px;
height: 22px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 50%;
color: inherit;
font-size: 14px;
line-height: 1;
cursor: pointer;
transition: background 0.2s ease;
}
.koch-controls__close:hover {
background: rgba(255, 255, 255, 0.2);
}
.koch-controls__open {
position: fixed;
z-index: 99;
bottom: 10px;
left: 50%;
background: rgba(20, 20, 24, 0.16);
backdrop-filter: blur(2px) saturate(165%);
-webkit-backdrop-filter: blur(2px) saturate(165%);
border: 1px solid rgba(255, 255, 255, 0.28);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3);
padding: 10px 22px;
border-radius: 20px;
color: rgba(255, 255, 255, 0.72);
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.35);
font: inherit;
cursor: pointer;
opacity: 0;
transform: translateX(-50%) scale(0.85);
pointer-events: none;
transition: opacity 0.3s ease, transform 0.3s ease;
transform-origin: bottom center;
}
.koch-controls__open.visible {
opacity: 1;
transform: translateX(-50%) scale(1);
pointer-events: auto;
}
.koch-controls__open:hover {
background: rgba(20, 20, 24, 0.3);
}
.koch-controls__group {
display: flex;
flex-wrap: wrap;
gap: 10px 20px;
justify-content: center;
width: 100%;
}
.koch-controls label {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
justify-content: center;
font-size: 14px;
}
.koch-controls input[type="range"] {
accent-color: rgba(255, 255, 255, 0.85);
}
.koch-controls__value {
min-width: 3.5em;
display: inline-block;
}
.koch-controls__buttons {
display: flex;
gap: 10px;
}
.koch-controls__play-pause {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 14px;
color: inherit;
font: inherit;
font-size: 14px;
padding: 6px 20px;
cursor: pointer;
transition: background 0.2s ease;
}
.koch-controls__play-pause:hover {
background: rgba(255, 255, 255, 0.2);
}
@media (max-width: 600px) {
.koch-controls {
width: 95%;
bottom: 20px;
padding: 12px;
border-radius: 20px;
}
.koch-controls__group {
flex-direction: column;
align-items: center;
}
.koch-controls__open {
bottom: 20px;
}
}
</style>
</body>
</html>