-
Notifications
You must be signed in to change notification settings - Fork 14
/
circadients.html
378 lines (372 loc) · 7 KB
/
circadients.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
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Cicadients</title>
<style type="text/css" media="all">
h1 { margin: 1.25em 0 0; border-bottom: 1px solid #666;}
h2 {margin: 1.5em 0 0; border-bottom: 1px solid #BBB;}
p {margin: 0.5em 0;}
div[id^="d"] {
margin: 0 0 2em 0; padding: 0;
border: 1px solid gray; background: #FFF;}
#d1 {
background-image:
-webkit-linear-gradient(
0deg,
rgba(171,191,196,0.6),
rgba(171,191,196,8) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-webkit-linear-gradient(
0deg,
rgba(203,138,153,0.7),
rgba(203,138,153,0.7) 49%,
rgba(203,138,153,0.5) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-webkit-linear-gradient(
0deg,
rgba(220,209,185,0) 0%,
rgba(220,209,185,0) 20%,
rgba(220,209,185,0.4) 20%,
rgba(220,209,185,0.8) 80%,
rgba(255,0,0,0) 80%,
rgba(255,0,0,0)
)
;
background-image:
-moz-linear-gradient(
0deg,
rgba(171,191,196,0.6),
rgba(171,191,196,8) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-moz-linear-gradient(
0deg,
rgba(203,138,153,0.7),
rgba(203,138,153,0.7) 49%,
rgba(203,138,153,0.5) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-moz-linear-gradient(
0deg,
rgba(220,209,185,0) 0%,
rgba(220,209,185,0) 20%,
rgba(220,209,185,0.4) 20%,
rgba(220,209,185,0.8) 80%,
rgba(255,0,0,0) 80%,
rgba(255,0,0,0)
)
;
background-image:
-ms-linear-gradient(
0deg,
rgba(171,191,196,0.6),
rgba(171,191,196,8) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-ms-linear-gradient(
0deg,
rgba(203,138,153,0.7),
rgba(203,138,153,0.7) 49%,
rgba(203,138,153,0.5) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-ms-linear-gradient(
0deg,
rgba(220,209,185,0) 0%,
rgba(220,209,185,0) 20%,
rgba(220,209,185,0.4) 20%,
rgba(220,209,185,0.8) 80%,
rgba(255,0,0,0) 80%,
rgba(255,0,0,0)
)
;
background-image:
-o-linear-gradient(
0deg,
rgba(171,191,196,0.6),
rgba(171,191,196,8) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-o-linear-gradient(
0deg,
rgba(203,138,153,0.7),
rgba(203,138,153,0.7) 49%,
rgba(203,138,153,0.5) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
-o-linear-gradient(
0deg,
rgba(220,209,185,0) 0%,
rgba(220,209,185,0) 20%,
rgba(220,209,185,0.4) 20%,
rgba(220,209,185,0.8) 80%,
rgba(255,0,0,0) 80%,
rgba(255,0,0,0)
)
;
background-image:
linear-gradient(
90deg,
rgba(171,191,196,0.6),
rgba(171,191,196,8) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
linear-gradient(
90deg,
rgba(203,138,153,0.7),
rgba(203,138,153,0.7) 49%,
rgba(203,138,153,0.5) 50%,
rgba(255,0,0,0) 50%,
rgba(255,0,0,0)
)
,
linear-gradient(
90deg,
rgba(220,209,185,0) 0%,
rgba(220,209,185,0) 20%,
rgba(220,209,185,0.4) 20%,
rgba(220,209,185,0.8) 80%,
rgba(255,0,0,0) 80%,
rgba(255,0,0,0)
)
;
background-size:
29px 100%,
37px 100%,
53px 100%
;
background-repeat: repeat-x;
height: 200px;
}
#d2 {
background-image:
-webkit-linear-gradient(
90deg,
rgba(255,128,128,0.25),
rgba(255,128,128,0) 75%
)
,
-webkit-linear-gradient(
-1deg,
transparent,
transparent 30%,
#510A0E 35%,
#510A0E 40%,
#61100F 43%,
#B93F3A 50%,
#4B0408 55%,
#6A0F18 60%,
#651015 65%,
#510A0E 70%,
#510A0E 75%,
rgba(255,128,128,0) 80%,
transparent
)
,
-webkit-linear-gradient(
2deg,
#510A0E,
#510A0E 20%,
#61100F 25%,
#B93F3A 40%,
#4B0408 50%,
#6A0F18 70%,
#651015 80%,
#510A0E 90%,
#510A0E
)
;
background-image:
-moz-linear-gradient(
90deg,
rgba(255,128,128,0.25),
rgba(255,128,128,0) 75%
)
,
-moz-linear-gradient(
-1deg,
transparent,
transparent 30%,
#510A0E 35%,
#510A0E 40%,
#61100F 43%,
#B93F3A 50%,
#4B0408 55%,
#6A0F18 60%,
#651015 65%,
#510A0E 70%,
#510A0E 75%,
rgba(255,128,128,0) 80%,
transparent
)
,
-moz-linear-gradient(
2deg,
#510A0E,
#510A0E 20%,
#61100F 25%,
#B93F3A 40%,
#4B0408 50%,
#6A0F18 70%,
#651015 80%,
#510A0E 90%,
#510A0E
)
;
background-image:
-ms-linear-gradient(
90deg,
rgba(255,128,128,0.25),
rgba(255,128,128,0) 75%
)
,
-ms-linear-gradient(
-1deg,
transparent,
transparent 30%,
#510A0E 35%,
#510A0E 40%,
#61100F 43%,
#B93F3A 50%,
#4B0408 55%,
#6A0F18 60%,
#651015 65%,
#510A0E 70%,
#510A0E 75%,
rgba(255,128,128,0) 80%,
transparent
)
,
-ms-linear-gradient(
2deg,
#510A0E,
#510A0E 20%,
#61100F 25%,
#B93F3A 40%,
#4B0408 50%,
#6A0F18 70%,
#651015 80%,
#510A0E 90%,
#510A0E
)
;
background-image:
-o-linear-gradient(
90deg,
rgba(255,128,128,0.25),
rgba(255,128,128,0) 75%
)
,
-o-linear-gradient(
-1deg,
transparent,
transparent 30%,
#510A0E 35%,
#510A0E 40%,
#61100F 43%,
#B93F3A 50%,
#4B0408 55%,
#6A0F18 60%,
#651015 65%,
#510A0E 70%,
#510A0E 75%,
rgba(255,128,128,0) 80%,
transparent
)
,
-o-linear-gradient(
2deg,
#510A0E,
#510A0E 20%,
#61100F 25%,
#B93F3A 40%,
#4B0408 50%,
#6A0F18 70%,
#651015 80%,
#510A0E 90%,
#510A0E
)
;
background-image:
linear-gradient(
0deg,
rgba(255,128,128,0.25),
rgba(255,128,128,0) 75%
)
,
linear-gradient(
89deg,
transparent,
transparent 30%,
#510A0E 35%,
#510A0E 40%,
#61100F 43%,
#B93F3A 50%,
#4B0408 55%,
#6A0F18 60%,
#651015 65%,
#510A0E 70%,
#510A0E 75%,
rgba(255,128,128,0) 80%,
transparent
)
,
linear-gradient(
92deg,
#510A0E,
#510A0E 20%,
#61100F 25%,
#B93F3A 40%,
#4B0408 50%,
#6A0F18 70%,
#651015 80%,
#510A0E 90%,
#510A0E
)
;
background-size:
auto,
300px 100%,
109px 100%;
background-repeat: repeat-x;
height: 400px;
}
</style>
</head>
<body>
<h1>Cicadients</h1>
<p>
A reworking of the first two examples of “<a href="http://designfestival.com/the-cicada-principle-and-why-it-matters-to-web-designers/">The Cicada Principle and Why It Matters to Web Designers</a>” using CSS gradients. (The third example would be theoretically possible to do with gradients, but it would be the worst possible approach.)
</p>
<h2>Example #1</h2>
<p>Unprefixed CSS: <strong>0.59KB</strong> (604 characters, unminified). Total CSS, both prefixed and not: <strong>2.66KB</strong> (2,720 characters, unminified). Total, original images: <strong>~7KB</strong> (plus two extra server hits).</p>
<div id="d1"></div>
<h2>Example #2</h2>
<p>
This only covers the first two of the three ‘layers’ in the original example; the third layer would be easily possible but hasn’t yet been done.
</p>
<p>Unprefixed CSS: <strong>0.63KB</strong> (643 characters, unminified). Total CSS, both prefixed and not: <strong>2.81KB</strong> (2,882 characters, unminified). Total, original images: <strong>~23KB</strong> (plus two extra server hits).</p>
<div id="d2"></div>
</body>
</html>