on master help sign in
Merge pull request #192 from urbit/chore/style-update

Chore/style update

commit519b79b4cb3e1505a4cb8a2a0869a64059dceca5 authorMatilde Park <matilde@tlon.io> dateThu 10 Oct 2019, 19:14 (7 years ago) parent5638fbd74b5b87
8 files changed+728−187
content/understanding-urbit/simple-durable-yours.md+2−2 sass/_main.scss+7−3 sass/grid.scss+120−114 static/viewport-units-buggyfill.js+472 templates/base.html+4 templates/essays/post.html+1−1 templates/index.html+121−66 templates/understanding-urbit/list.html+1−1
content/understanding-urbit/simple-durable-yours.md+2−2
@@ -8,13 +8,13 @@ We live in a world dense with computers. We wake up and look at them, we see the
88
99But our computers are a mess.
1010
11−{{ oversize(url="https://media.urbit.org/site/understanding-urbit/simple-durable-yours/sdy-1.svg") }}
11+![](https://media.urbit.org/site/understanding-urbit/simple-durable-yours/sdy-1.svg)
1212
1313We spend all our time switching between services, juggling logins and different interfaces. And once we’re logged in, the services we use harvest our data, spy on us and often shut down with little warning.
1414
1515If computers are going to be a part of our lives for generations to come, we need a sound foundation for them. We need a _system_, not a grab bag of apps and services. Urbit is that system.
1616
17−<picture class="full mt4 mb4 c3-11-lg">
17+<picture class="full mt4 mb4 c4-10-lg measure">
1818<source srcset="https://media.urbit.org/site/understanding-urbit/simple-durable-yours/sdy-2.png,
1919https://media.urbit.org/site/understanding-urbit/simple-durable-yours/sdy-2%402x.png 2x">
2020<img src="https://media.urbit.org/site/understanding-urbit/simple-durable-yours/sdy-2%402x.png"/>
sass/_main.scss+7−3
@@ -47,6 +47,9 @@ body {
4747 @extend .grid12, .mh4;
4848 font-size: 1rem;
4949 color: #000;
50+ // Something about the main page video is causing the page to overflow.
51+ max-width:100vw;
52+ overflow-x:hidden;
5053}
5154
5255nav {
@@ -143,7 +146,7 @@ footer nav {
143146
144147body.essay {
145148 h1 {
146− @extend .f1, .fw3;
149+ font-size: 1rem;
147150 max-width: 95vw;
148151 }
149152 &:not(.bg-white) {
@@ -172,6 +175,7 @@ body.essay {
172175 }
173176 article > *:not(figure):not(picture) {
174177 grid-area: auto / 4 / auto / 10;
178+ max-width: 30em;
175179 }
176180}
177181
@@ -537,14 +541,14 @@ hr {
537541.vid-insert-wrap {
538542 position: relative;
539543 width: 100vw;
540− height: 850px;
544+ height: 100vh;
541545}
542546
543547.vid-insert {
544548 position: absolute;
545549 right: 0;
546550 bottom: 0;
547− // USE CONTAINER TO CONTROL HEIGHT + WIDTH
551+ // Use .vid-insert-wrap to control height + width
548552 width: 100%;
549553 height: 100%;
550554 object-fit: cover;
sass/grid.scss+120−114
@@ -5,9 +5,15 @@
55 display: grid;
66 grid-template-columns: repeat(12, [col-start] 1fr);
77 grid-auto-rows: auto;
8− column-gap: 32px;
8+ column-gap: 16px;
9+ @media screen and (min-width: 34.375em) {
10+ column-gap: 32px;
11+ }
12+ @media screen and (min-width: 60em) {
13+ column-gap: 64px;
14+ }
915 }
10−
16+
1117 .grid8 {
1218 display: grid;
1319 grid-template-columns: repeat(8, [col-start] 1fr);
@@ -15,35 +21,35 @@
1521 gap: 1px;
1622 width: 100%;
1723 }
18−
24+
1925 .full {
2026 grid-area: auto / 1 / auto / 13;
2127 }
22−
28+
2329 .half-1 {
2430 grid-area: auto / 1 / auto / 7;
2531 }
26−
32+
2733 .half-2 {
2834 grid-area: auto / 7 / auto / 13;
2935 }
30−
36+
3137 .fourth-1 {
3238 grid-area: auto / 1 / auto / 4;
3339 }
34−
40+
3541 .fourth-2 {
3642 grid-area: auto / 4 / auto / 7;
3743 }
38−
44+
3945 .fourth-3 {
4046 grid-area: auto / 7 / auto / 10;
4147 }
42−
48+
4349 .fourth-4 {
4450 grid-area: auto / 10 / auto / 13;
4551 }
46−
52+
4753 @media only screen and (min-width: 34.375em) {
4854 .full-ns {
4955 grid-area: auto / 1 / auto / 13;
@@ -67,7 +73,7 @@
6773 grid-area: auto / 10 / auto / 13;
6874 }
6975 }
70−
76+
7177 @media only screen and (min-width: 46.875em) and (max-width: 60em) {
7278 .full-md {
7379 grid-area: auto / 1 / auto / 13;
@@ -91,7 +97,7 @@
9197 grid-area: auto / 10 / auto / 13;
9298 }
9399 }
94−
100+
95101 @media only screen and (min-width: 60em) {
96102 .full-lg {
97103 grid-area: auto / 1 / auto / 13;
@@ -115,477 +121,477 @@
115121 grid-area: auto / 10 / auto / 13;
116122 }
117123 }
118−
124+
119125 .gap1 {
120126 width: 1px;
121127 }
122−
128+
123129 .gap2 {
124130 width: 2px;
125131 }
126−
132+
127133 .gap4 {
128134 width: 4px;
129135 }
130−
136+
131137 .gap8 {
132138 width: 8px;
133139 }
134−
140+
135141 .gap12 {
136142 width: 12px;
137143 }
138−
144+
139145 .gap16 {
140146 width: 16px;
141147 }
142−
148+
143149 .gap24 {
144150 width: 24px;
145151 }
146−
152+
147153 .gap32 {
148154 width: 32px;
149155 }
150−
156+
151157 .fr1 {
152158 width: 1fr;
153159 }
154−
160+
155161 .fr2 {
156162 width: 2fr;
157163 }
158−
164+
159165 .fr3 {
160166 width: 3fr;
161167 }
162−
168+
163169 .fr4 {
164170 width: 4fr;
165171 }
166−
172+
167173 .fr5 {
168174 width: 5fr;
169175 }
170−
176+
171177 .fr6 {
172178 width: 6fr;
173179 }
174−
180+
175181 .fr7 {
176182 width: 7fr;
177183 }
178−
184+
179185 .fr8 {
180186 width: 8fr;
181187 }
182−
188+
183189 .fr9 {
184190 width: 9fr;
185191 }
186−
192+
187193 .fr10 {
188194 width: 10fr;
189195 }
190−
196+
191197 .fr11 {
192198 width: 11fr;
193199 }
194−
200+
195201 .fr12 {
196202 width: 12fr;
197203 }
198−
204+
199205 .c1-2 {
200206 grid-column-start: 1;
201207 grid-column-end: 2;
202208 }
203−
209+
204210 .c1-3 {
205211 grid-column-start: 1;
206212 grid-column-end: 3;
207213 }
208−
214+
209215 .c1-4 {
210216 grid-column-start: 1;
211217 grid-column-end: 4;
212218 }
213−
219+
214220 .c1-5 {
215221 grid-column-start: 1;
216222 grid-column-end: 5;
217223 }
218−
224+
219225 .c1-6 {
220226 grid-column-start: 1;
221227 grid-column-end: 6;
222228 }
223−
229+
224230 .c1-7 {
225231 grid-column-start: 1;
226232 grid-column-end: 7;
227233 }
228−
234+
229235 .c1-8 {
230236 grid-column-start: 1;
231237 grid-column-end: 8;
232238 }
233−
239+
234240 .c1-9 {
235241 grid-column-start: 1;
236242 grid-column-end: 9;
237243 }
238−
244+
239245 .c1-10 {
240246 grid-column-start: 1;
241247 grid-column-end: 10;
242248 }
243−
249+
244250 .c1-11 {
245251 grid-column-start: 1;
246252 grid-column-end: 11;
247253 }
248−
254+
249255 .c1-12 {
250256 grid-column-start: 1;
251257 grid-column-end: 12;
252258 }
253−
259+
254260 .c1-13 {
255261 grid-column-start: 1;
256262 grid-column-end: 13;
257263 }
258−
264+
259265 .c2-3 {
260266 grid-column-start: 2;
261267 grid-column-end: 3;
262268 }
263−
269+
264270 .c2-4 {
265271 grid-column-start: 2;
266272 grid-column-end: 4;
267273 }
268−
274+
269275 .c2-5 {
270276 grid-column-start: 2;
271277 grid-column-end: 5;
272278 }
273−
279+
274280 .c2-6 {
275281 grid-column-start: 2;
276282 grid-column-end: 6;
277283 }
278−
284+
279285 .c2-7 {
280286 grid-column-start: 2;
281287 grid-column-end: 7;
282288 }
283−
289+
284290 .c2-8 {
285291 grid-column-start: 2;
286292 grid-column-end: 8;
287293 }
288−
294+
289295 .c2-9 {
290296 grid-column-start: 2;
291297 grid-column-end: 9;
292298 }
293−
299+
294300 .c2-10 {
295301 grid-column-start: 2;
296302 grid-column-end: 10;
297303 }
298−
304+
299305 .c2-11 {
300306 grid-column-start: 2;
301307 grid-column-end: 11;
302308 }
303−
309+
304310 .c2-12 {
305311 grid-column-start: 2;
306312 grid-column-end: 12;
307313 }
308−
314+
309315 .c2-13 {
310316 grid-column-start: 2;
311317 grid-column-end: 13;
312318 }
313−
319+
314320 .c3-4 {
315321 grid-column-start: 3;
316322 grid-column-end: 4;
317323 }
318−
324+
319325 .c3-5 {
320326 grid-column-start: 3;
321327 grid-column-end: 5;
322328 }
323−
329+
324330 .c3-6 {
325331 grid-column-start: 3;
326332 grid-column-end: 6;
327333 }
328−
334+
329335 .c3-7 {
330336 grid-column-start: 3;
331337 grid-column-end: 7;
332338 }
333−
339+
334340 .c3-8 {
335341 grid-column-start: 3;
336342 grid-column-end: 8;
337343 }
338−
344+
339345 .c3-9 {
340346 grid-column-start: 3;
341347 grid-column-end: 9;
342348 }
343−
349+
344350 .c3-10 {
345351 grid-column-start: 3;
346352 grid-column-end: 10;
347353 }
348−
354+
349355 .c3-11 {
350356 grid-column-start: 3;
351357 grid-column-end: 11;
352358 }
353−
359+
354360 .c3-12 {
355361 grid-column-start: 3;
356362 grid-column-end: 12;
357363 }
358−
364+
359365 .c3-13 {
360366 grid-column-start: 3;
361367 grid-column-end: 13;
362368 }
363−
369+
364370 .c4-5 {
365371 grid-column-start: 4;
366372 grid-column-end: 5;
367373 }
368−
374+
369375 .c4-6 {
370376 grid-column-start: 4;
371377 grid-column-end: 6;
372378 }
373−
379+
374380 .c4-7 {
375381 grid-column-start: 4;
376382 grid-column-end: 7;
377383 }
378−
384+
379385 .c4-8 {
380386 grid-column-start: 4;
381387 grid-column-end: 8;
382388 }
383−
389+
384390 .c4-9 {
385391 grid-column-start: 4;
386392 grid-column-end: 9;
387393 }
388−
394+
389395 .c4-10 {
390396 grid-column-start: 4;
391397 grid-column-end: 10;
392398 }
393−
399+
394400 .c4-11 {
395401 grid-column-start: 4;
396402 grid-column-end: 11;
397403 }
398−
404+
399405 .c4-12 {
400406 grid-column-start: 4;
401407 grid-column-end: 12;
402408 }
403−
409+
404410 .c4-13 {
405411 grid-column-start: 4;
406412 grid-column-end: 13;
407413 }
408−
414+
409415 .c5-6 {
410416 grid-column-start: 5;
411417 grid-column-end: 6;
412418 }
413−
419+
414420 .c5-7 {
415421 grid-column-start: 5;
416422 grid-column-end: 7;
417423 }
418−
424+
419425 .c5-8 {
420426 grid-column-start: 5;
421427 grid-column-end: 8;
422428 }
423−
429+
424430 .c5-9 {
425431 grid-column-start: 5;
426432 grid-column-end: 9;
427433 }
428−
434+
429435 .c5-10 {
430436 grid-column-start: 5;
431437 grid-column-end: 10;
432438 }
433−
439+
434440 .c5-11 {
435441 grid-column-start: 5;
436442 grid-column-end: 11;
437443 }
438−
444+
439445 .c5-12 {
440446 grid-column-start: 5;
441447 grid-column-end: 12;
442448 }
443−
449+
444450 .c5-13 {
445451 grid-column-start: 5;
446452 grid-column-end: 13;
447453 }
448−
454+
449455 .c6-7 {
450456 grid-column-start: 6;
451457 grid-column-end: 7;
452458 }
453−
459+
454460 .c6-8 {
455461 grid-column-start: 6;
456462 grid-column-end: 8;
457463 }
458−
464+
459465 .c6-9 {
460466 grid-column-start: 6;
461467 grid-column-end: 9;
462468 }
463−
469+
464470 .c6-10 {
465471 grid-column-start: 6;
466472 grid-column-end: 10;
467473 }
468−
474+
469475 .c6-11 {
470476 grid-column-start: 6;
471477 grid-column-end: 11;
472478 }
473−
479+
474480 .c6-12 {
475481 grid-column-start: 6;
476482 grid-column-end: 12;
477483 }
478−
484+
479485 .c6-13 {
480486 grid-column-start: 6;
481487 grid-column-end: 13;
482488 }
483−
489+
484490 .c7-8 {
485491 grid-column-start: 7;
486492 grid-column-end: 8;
487493 }
488−
494+
489495 .c7-9 {
490496 grid-column-start: 7;
491497 grid-column-end: 9;
492498 }
493−
499+
494500 .c7-10 {
495501 grid-column-start: 7;
496502 grid-column-end: 10;
497503 }
498−
504+
499505 .c7-11 {
500506 grid-column-start: 7;
501507 grid-column-end: 11;
502508 }
503−
509+
504510 .c7-12 {
505511 grid-column-start: 7;
506512 grid-column-end: 12;
507513 }
508−
514+
509515 .c7-13 {
510516 grid-column-start: 7;
511517 grid-column-end: 13;
512518 }
513−
519+
514520 .c8-9 {
515521 grid-column-start: 8;
516522 grid-column-end: 9;
517523 }
518−
524+
519525 .c8-10 {
520526 grid-column-start: 8;
521527 grid-column-end: 10;
522528 }
523−
529+
524530 .c8-11 {
525531 grid-column-start: 8;
526532 grid-column-end: 11;
527533 }
528−
534+
529535 .c8-12 {
530536 grid-column-start: 8;
531537 grid-column-end: 12;
532538 }
533−
539+
534540 .c8-13 {
535541 grid-column-start: 8;
536542 grid-column-end: 13;
537543 }
538−
544+
539545 .c9-10 {
540546 grid-column-start: 9;
541547 grid-column-end: 10;
542548 }
543−
549+
544550 .c9-11 {
545551 grid-column-start: 9;
546552 grid-column-end: 11;
547553 }
548−
554+
549555 .c9-12 {
550556 grid-column-start: 9;
551557 grid-column-end: 12;
552558 }
553−
559+
554560 .c9-13 {
555561 grid-column-start: 9;
556562 grid-column-end: 13;
557563 }
558−
564+
559565 .c10-11 {
560566 grid-column-start: 10;
561567 grid-column-end: 11;
562568 }
563−
569+
564570 .c10-12 {
565571 grid-column-start: 10;
566572 grid-column-end: 12;
567573 }
568−
574+
569575 .c10-13 {
570576 grid-column-start: 10;
571577 grid-column-end: 13;
572578 }
573−
579+
574580 .c11-12 {
575581 grid-column-start: 11;
576582 grid-column-end: 12;
577583 }
578−
584+
579585 .c11-13 {
580586 grid-column-start: 11;
581587 grid-column-end: 13;
582588 }
583−
589+
584590 .c12-13 {
585591 grid-column-start: 12;
586592 grid-column-end: 13;
587593 }
588−
594+
589595 @media only screen and (min-width: 550px) {
590596 .c1-2-ns {
591597 grid-column-start: 1;
@@ -900,7 +906,7 @@
900906 grid-column-end: 13;
901907 }
902908 }
903−
909+
904910 @media only screen and (min-width: 750px) and (max-width: 960px) {
905911 .c1-2-md {
906912 grid-column-start: 1;
@@ -1215,7 +1221,7 @@
12151221 grid-column-end: 13;
12161222 }
12171223 }
1218−
1224+
12191225 @media only screen and (min-width: 960px) {
12201226 .c1-2-lg {
12211227 grid-column-start: 1;
@@ -1529,4 +1535,4 @@
15291535 grid-column-start: 12;
15301536 grid-column-end: 13;
15311537 }
1532− }
1538+ }
static/viewport-units-buggyfill.jsnew file+472
@@ -0,0 +1,472 @@
1+/*!
2+ * viewport-units-buggyfill v0.6.2
3+ * @web: https://github.com/rodneyrehm/viewport-units-buggyfill/
4+ * @author: Rodney Rehm - http://rodneyrehm.de/en/
5+ */
6+
7+(function() {
8+ (function(root, factory) {
9+ 'use strict';
10+ if (typeof define === 'function' && define.amd) {
11+ // AMD. Register as an anonymous module.
12+ define([], factory);
13+ } else if (typeof exports === 'object') {
14+ // Node. Does not work with strict CommonJS, but
15+ // only CommonJS-like enviroments that support module.exports,
16+ // like Node.
17+ module.exports = factory();
18+ } else {
19+ // Browser globals (root is window)
20+ root.viewportUnitsBuggyfill = factory();
21+ }
22+ }(this, function() {
23+ 'use strict';
24+ /* global document, window, navigator, location, XMLHttpRequest, XDomainRequest, CustomEvent */
25+
26+ var initialized = false;
27+ var options;
28+ var userAgent = window.navigator.userAgent;
29+ var viewportUnitExpression = /([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g;
30+ var urlExpression = /(https?:)?\/\//
31+ var forEach = [].forEach;
32+ var dimensions;
33+ var declarations;
34+ var styleNode;
35+ var isBuggyIE = /MSIE [0-9]\./i.test(userAgent);
36+ var isOldIE = /MSIE [0-8]\./i.test(userAgent);
37+ var isOperaMini = userAgent.indexOf('Opera Mini') > -1;
38+
39+ var isMobileSafari = /(iPhone|iPod|iPad).+AppleWebKit/i.test(userAgent) && (function() {
40+ // Regexp for iOS-version tested against the following userAgent strings:
41+ // Example WebView UserAgents:
42+ // * iOS Chrome on iOS8: "Mozilla/5.0 (iPad; CPU OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/39.0.2171.50 Mobile/12B410 Safari/600.1.4"
43+ // * iOS Facebook on iOS7: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D201 [FBAN/FBIOS;FBAV/12.1.0.24.20; FBBV/3214247; FBDV/iPhone6,1;FBMD/iPhone; FBSN/iPhone OS;FBSV/7.1.1; FBSS/2; FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5]"
44+ // Example Safari UserAgents:
45+ // * Safari iOS8: "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4"
46+ // * Safari iOS7: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A4449d Safari/9537.53"
47+ var iOSversion = userAgent.match(/OS (\d+)/);
48+ // viewport units work fine in mobile Safari and webView on iOS 8+
49+ return iOSversion && iOSversion.length > 1 && parseInt(iOSversion[1]) < 10;
50+ })();
51+
52+ var isBadStockAndroid = (function() {
53+ // Android stock browser test derived from
54+ // http://stackoverflow.com/questions/24926221/distinguish-android-chrome-from-stock-browser-stock-browsers-user-agent-contai
55+ var isAndroid = userAgent.indexOf(' Android ') > -1;
56+ if (!isAndroid) {
57+ return false;
58+ }
59+
60+ var isStockAndroid = userAgent.indexOf('Version/') > -1;
61+ if (!isStockAndroid) {
62+ return false;
63+ }
64+
65+ var versionNumber = parseFloat((userAgent.match('Android ([0-9.]+)') || [])[1]);
66+ // anything below 4.4 uses WebKit without *any* viewport support,
67+ // 4.4 has issues with viewport units within calc()
68+ return versionNumber <= 4.4;
69+ })();
70+
71+ // added check for IE10, IE11 and Edge < 20, since it *still* doesn't understand vmax
72+ // http://caniuse.com/#feat=viewport-units
73+ if (!isBuggyIE) {
74+ isBuggyIE = !!navigator.userAgent.match(/MSIE 10\.|Trident.*rv[ :]*1[01]\.| Edge\/1\d\./);
75+ }
76+
77+ // Polyfill for creating CustomEvents on IE9/10/11
78+ // from https://github.com/krambuhl/custom-event-polyfill
79+ try {
80+ // eslint-disable-next-line no-new, no-use-before-define
81+ new CustomEvent('test');
82+ } catch (e) {
83+ var CustomEvent = function(event, params) {
84+ var evt;
85+ params = params || {
86+ bubbles: false,
87+ cancelable: false,
88+ detail: undefined,
89+ };
90+
91+ evt = document.createEvent('CustomEvent');
92+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
93+ return evt;
94+ };
95+ CustomEvent.prototype = window.Event.prototype;
96+ window.CustomEvent = CustomEvent; // expose definition to window
97+ }
98+
99+ function debounce(func, wait) {
100+ var timeout;
101+ return function() {
102+ var context = this;
103+ var args = arguments;
104+ var callback = function() {
105+ func.apply(context, args);
106+ };
107+
108+ clearTimeout(timeout);
109+ timeout = setTimeout(callback, wait);
110+ };
111+ }
112+
113+ // from http://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t
114+ function inIframe() {
115+ try {
116+ return window.self !== window.top;
117+ } catch (e) {
118+ return true;
119+ }
120+ }
121+
122+ function initialize(initOptions) {
123+ if (initialized) {
124+ return;
125+ }
126+
127+ if (initOptions === true) {
128+ initOptions = {
129+ force: true,
130+ };
131+ }
132+
133+ options = initOptions || {};
134+ options.isMobileSafari = isMobileSafari;
135+ options.isBadStockAndroid = isBadStockAndroid;
136+
137+ if (options.ignoreVmax && !options.force && !isOldIE) {
138+ // modern IE (10 and up) do not support vmin/vmax,
139+ // but chances are this unit is not even used, so
140+ // allow overwriting the "hacktivation"
141+ // https://github.com/rodneyrehm/viewport-units-buggyfill/issues/56
142+ isBuggyIE = false;
143+ }
144+
145+ if (isOldIE || (!options.force && !isMobileSafari && !isBuggyIE && !isBadStockAndroid && !isOperaMini && (!options.hacks || !options.hacks.required(options)))) {
146+ // this buggyfill only applies to mobile safari, IE9-10 and the Stock Android Browser.
147+ if (window.console && isOldIE) {
148+ console.info('viewport-units-buggyfill requires a proper CSSOM and basic viewport unit support, which are not available in IE8 and below');
149+ }
150+
151+ return {
152+ init: function() {},
153+ };
154+ }
155+
156+ // fire a custom event that buggyfill was initialize
157+ window.dispatchEvent(new CustomEvent('viewport-units-buggyfill-init'));
158+
159+ options.hacks && options.hacks.initialize(options);
160+
161+ initialized = true;
162+ styleNode = document.createElement('style');
163+ styleNode.id = 'patched-viewport';
164+ document[options.appendToBody ? 'body' : 'head'].appendChild(styleNode);
165+
166+ // Issue #6: Cross Origin Stylesheets are not accessible through CSSOM,
167+ // therefore download and inject them as <style> to circumvent SOP.
168+ importCrossOriginLinks(function() {
169+ var _refresh = debounce(refresh, options.refreshDebounceWait || 100);
170+ // doing a full refresh rather than updateStyles because an orientationchange
171+ // could activate different stylesheets
172+ window.addEventListener('orientationchange', _refresh, true);
173+ // orientationchange might have happened while in a different window
174+ window.addEventListener('pageshow', _refresh, true);
175+
176+ if (options.force || isBuggyIE || inIframe()) {
177+ window.addEventListener('resize', _refresh, true);
178+ options._listeningToResize = true;
179+ }
180+
181+ options.hacks && options.hacks.initializeEvents(options, refresh, _refresh);
182+
183+ refresh();
184+ });
185+ }
186+
187+ function updateStyles() {
188+ styleNode.textContent = getReplacedViewportUnits();
189+ // move to the end in case inline <style>s were added dynamically
190+ styleNode.parentNode.appendChild(styleNode);
191+ // fire a custom event that styles were updated
192+ window.dispatchEvent(new CustomEvent('viewport-units-buggyfill-style'));
193+ }
194+
195+ function refresh() {
196+ if (!initialized) {
197+ return;
198+ }
199+
200+ findProperties();
201+
202+ // iOS Safari will report window.innerWidth and .innerHeight as 0 unless a timeout is used here.
203+ // TODO: figure out WHY innerWidth === 0
204+ setTimeout(function() {
205+ updateStyles();
206+ }, 1);
207+ }
208+
209+ // http://stackoverflow.com/a/23613052
210+ function processStylesheet(ss) {
211+ // cssRules respects same-origin policy, as per
212+ // https://code.google.com/p/chromium/issues/detail?id=49001#c10.
213+ try {
214+ if (!ss.cssRules) { return; }
215+ } catch (e) {
216+ if (e.name !== 'SecurityError') { throw e; }
217+ return;
218+ }
219+ // ss.cssRules is available, so proceed with desired operations.
220+ var rules = [];
221+ for (var i = 0; i < ss.cssRules.length; i++) {
222+ var rule = ss.cssRules[i];
223+ rules.push(rule);
224+ }
225+ return rules;
226+ }
227+
228+ function findProperties() {
229+ declarations = [];
230+ forEach.call(document.styleSheets, function(sheet) {
231+ var cssRules = processStylesheet(sheet);
232+
233+ if (!cssRules || sheet.ownerNode.id === 'patched-viewport' || sheet.ownerNode.getAttribute('data-viewport-units-buggyfill') === 'ignore') {
234+ // skip entire sheet because no rules are present, it's supposed to be ignored or it's the target-element of the buggyfill
235+ return;
236+ }
237+
238+ if (sheet.media && sheet.media.mediaText && window.matchMedia && !window.matchMedia(sheet.media.mediaText).matches) {
239+ // skip entire sheet because media attribute doesn't match
240+ return;
241+ }
242+
243+ forEach.call(cssRules, findDeclarations);
244+ });
245+
246+ return declarations;
247+ }
248+
249+ function findDeclarations(rule) {
250+ if (rule.type === 7) {
251+ var value;
252+
253+ // there may be a case where accessing cssText throws an error.
254+ // I could not reproduce this issue, but the worst that can happen
255+ // this way is an animation not running properly.
256+ // not awesome, but probably better than a script error
257+ // see https://github.com/rodneyrehm/viewport-units-buggyfill/issues/21
258+ try {
259+ value = rule.cssText;
260+ } catch (e) {
261+ return;
262+ }
263+
264+ viewportUnitExpression.lastIndex = 0;
265+ if (viewportUnitExpression.test(value) && !urlExpression.test(value)) {
266+ // KeyframesRule does not have a CSS-PropertyName
267+ declarations.push([rule, null, value]);
268+ options.hacks && options.hacks.findDeclarations(declarations, rule, null, value);
269+ }
270+
271+ return;
272+ }
273+
274+ if (!rule.style) {
275+ if (!rule.cssRules) {
276+ return;
277+ }
278+
279+ forEach.call(rule.cssRules, function(_rule) {
280+ findDeclarations(_rule);
281+ });
282+
283+ return;
284+ }
285+
286+ forEach.call(rule.style, function(name) {
287+ var value = rule.style.getPropertyValue(name);
288+ // preserve those !important rules
289+ if (rule.style.getPropertyPriority(name)) {
290+ value += ' !important';
291+ }
292+
293+ viewportUnitExpression.lastIndex = 0;
294+ if (viewportUnitExpression.test(value)) {
295+ declarations.push([rule, name, value]);
296+ options.hacks && options.hacks.findDeclarations(declarations, rule, name, value);
297+ }
298+ });
299+ }
300+
301+ function getReplacedViewportUnits() {
302+ dimensions = getViewport();
303+
304+ var css = [];
305+ var buffer = [];
306+ var open;
307+ var close;
308+
309+ declarations.forEach(function(item) {
310+ var _item = overwriteDeclaration.apply(null, item);
311+ var _open = _item.selector.length ? (_item.selector.join(' {\n') + ' {\n') : '';
312+ var _close = new Array(_item.selector.length + 1).join('\n}');
313+
314+ if (!_open || _open !== open) {
315+ if (buffer.length) {
316+ css.push(open + buffer.join('\n') + close);
317+ buffer.length = 0;
318+ }
319+
320+ if (_open) {
321+ open = _open;
322+ close = _close;
323+ buffer.push(_item.content);
324+ } else {
325+ css.push(_item.content);
326+ open = null;
327+ close = null;
328+ }
329+
330+ return;
331+ }
332+
333+ if (_open && !open) {
334+ open = _open;
335+ close = _close;
336+ }
337+
338+ buffer.push(_item.content);
339+ });
340+
341+ if (buffer.length) {
342+ css.push(open + buffer.join('\n') + close);
343+ }
344+
345+ // Opera Mini messes up on the content hack (it replaces the DOM node's innerHTML with the value).
346+ // This fixes it. We test for Opera Mini only since it is the most expensive CSS selector
347+ // see https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors
348+ if (isOperaMini) {
349+ css.push('* { content: normal !important; }');
350+ }
351+
352+ return css.join('\n\n');
353+ }
354+
355+ function overwriteDeclaration(rule, name, value) {
356+ var _value;
357+ var _selectors = [];
358+
359+ _value = value.replace(viewportUnitExpression, replaceValues);
360+
361+ if (options.hacks) {
362+ _value = options.hacks.overwriteDeclaration(rule, name, _value);
363+ }
364+
365+ if (name) {
366+ // skipping KeyframesRule
367+ _selectors.push(rule.selectorText);
368+ _value = name + ': ' + _value + ';';
369+ }
370+
371+ var _rule = rule.parentRule;
372+ while (_rule) {
373+ if (_rule.media) {
374+ _selectors.unshift('@media ' + _rule.media.mediaText);
375+ } else if (_rule.conditionText) {
376+ _selectors.unshift('@supports ' + _rule.conditionText);
377+ }
378+
379+ _rule = _rule.parentRule;
380+ }
381+
382+ return {
383+ selector: _selectors,
384+ content: _value,
385+ };
386+ }
387+
388+ function replaceValues(match, number, unit) {
389+ var _base = dimensions[unit];
390+ var _number = parseFloat(number) / 100;
391+ return (_number * _base) + 'px';
392+ }
393+
394+ function getViewport() {
395+ var vh = window.innerHeight;
396+ var vw = window.innerWidth;
397+
398+ return {
399+ vh: vh,
400+ vw: vw,
401+ vmax: Math.max(vw, vh),
402+ vmin: Math.min(vw, vh),
403+ };
404+ }
405+
406+ function importCrossOriginLinks(next) {
407+ var _waiting = 0;
408+ var decrease = function() {
409+ _waiting--;
410+ if (!_waiting) {
411+ next();
412+ }
413+ };
414+
415+ forEach.call(document.styleSheets, function(sheet) {
416+ if (!sheet.href || origin(sheet.href) === origin(location.href) || sheet.ownerNode.getAttribute('data-viewport-units-buggyfill') === 'ignore') {
417+ // skip <style> and <link> from same origin or explicitly declared to ignore
418+ return;
419+ }
420+
421+ _waiting++;
422+ convertLinkToStyle(sheet.ownerNode, decrease);
423+ });
424+
425+ if (!_waiting) {
426+ next();
427+ }
428+ }
429+
430+ function origin(url) {
431+ return url.slice(0, url.indexOf('/', url.indexOf('://') + 3));
432+ }
433+
434+ function convertLinkToStyle(link, next) {
435+ getCors(link.href, function() {
436+ var style = document.createElement('style');
437+ style.media = link.media;
438+ style.setAttribute('data-href', link.href);
439+ style.textContent = this.responseText;
440+ link.parentNode.replaceChild(style, link);
441+ next();
442+ }, next);
443+ }
444+
445+ function getCors(url, success, error) {
446+ var xhr = new XMLHttpRequest();
447+ if ('withCredentials' in xhr) {
448+ // XHR for Chrome/Firefox/Opera/Safari.
449+ xhr.open('GET', url, true);
450+ } else if (typeof XDomainRequest !== 'undefined') {
451+ // XDomainRequest for IE.
452+ xhr = new XDomainRequest();
453+ xhr.open('GET', url);
454+ } else {
455+ throw new Error('cross-domain XHR not supported');
456+ }
457+
458+ xhr.onload = success;
459+ xhr.onerror = error;
460+ xhr.send();
461+ return xhr;
462+ }
463+
464+ return {
465+ version: '0.6.1',
466+ findProperties: findProperties,
467+ getCss: getReplacedViewportUnits,
468+ init: initialize,
469+ refresh: refresh,
470+ };
471+ }));
472+})();
templates/base.html+4
@@ -45,6 +45,10 @@
4545 })();
4646 </script>
4747 <!-- END MATOMO -->
48+ <!-- START VH UNIT BUGGYFILL -->
49+ <script src="{{ get_url(path="viewport-units-buggyfill.js") | safe }}"></script>
50+ <script>window.viewportUnitsBuggyfill.init();</script>
51+ <!-- END VH UNIT BUGGYFILL -->
4852
4953 </head>
5054 <body {% block bodyclasses %} {% endblock bodyclasses %}>
templates/essays/post.html+1−1
@@ -26,7 +26,7 @@
2626 {% include "partials/navigation-search.html" %}
2727</nav>
2828
29−<h1 class="mb4 full mt3 c4-12-lg">{{ page.title }}</h1>
29+<h1 class="mb4 full mt4 c4-12-lg fw6">{{ page.title }}</h1>
3030{% if page.extra.author %}
3131<span class="dib full c4-12-lg" rel="author"> {{ page.extra.author }}
3232 {% if page.extra.ship %}
templates/index.html+121−66
@@ -1,8 +1,8 @@
11{% extends "base.html" %}
22<!--External links are differentiated on home page.-->
33{% block templatestyles %}
4−a[href*="//"]:not([href*="{{config.base_url | safe}}"])::after {
5−content: " ↗";
4+<!-- a[href*="//"]:not([href*="{{config.base_url | safe}}"])::after {
5+content: " ↗"; -->
66}
77{% endblock templatestyles %}
88{% block bodyclasses %}class="index"{% endblock bodyclasses %}
@@ -12,90 +12,145 @@ content: " ↗";
1212{% block content %}
1313
1414<section class="full p0 vid-insert-wrap full-bleed">
15−
1615 <video class="vid-insert bg-black" autoplay muted loop>
1716 <source
1817 src="https://storage.googleapis.com/media.urbit.org/site/sea30-1440.mp4"
19− type="video/mp4">
18+ type="video/mp4"/>
2019 Your browser does not support the video tag.
2120 </video>
2221
23− <div class='grid12' style='height: 100%; width:100%;'>
24− <div class='full c4-10-lg flex items-center align-center z10 white'>
22+ <div class="grid12" style="height: 100%; width:100%;">
23+ <div class="full c2-7-md c3-7-lg flex items-center align-center z10 white">
2524 Urbit is your last computer.
2625 </div>
2726 </div>
2827 <!-- VIMEO VERSION KEPT AS SHIM -->
2928 <!-- <iframe src="https://player.vimeo.com/video/365353672?background=1"
30− class="w-100 ma0 h-100" frameborder="0" allow="autoplay;fullscreen" allowfullscreen="" style="
31−"></iframe> -->
29+ class="w-100 ma0 h-100" frameborder="0" allow="autoplay;fullscreen" allowfullscreen="" style="
30+ "></iframe> -->
3231</section>
3332
34−<nav class="home full c4-10-lg mt6 mb5 grid12">
35− <section class="full half-1-md half-1-lg">
33+<!-- <nav class="full-bleed full grid12"> -->
34+
35+<section class="full c2-7-md c3-7-lg mt6">
36+ <p class="lh-copy mt1 mb4">
37+ It's a simple, durable computer you own 100% and forever.
38+ </p>
39+</section>
3640
37− <ul>
38− <li><a href="/understanding-urbit/">Introduction -></a></li>
41+<section class="full c2-7-md c3-7-lg mt6">
42+ <ul class="list">
43+ <li class="">
44+ <a class="bb b--black" href="/understanding-urbit/">Introduction</a>
45+ </li>
46+ <li class="mt3">
47+ <a class="blue2 bb b--blue" href="/docs">Docs</a>
48+ </li>
49+ <li class="mt3">
50+ <a class="green2 bb b--green" href="/install">Install</a>
51+ </li>
52+ </ul>
53+</section>
3954
40− <li class="mt4"><a href="/essays">Essays</a></li>
41− <li><a href="/updates/">Updates</a></li>
42− <li><a href="/media">Media</a></li>
43− <li><a href="/faq/">FAQ</a></li>
55+<section class="full c2-7-md c3-7-lg mt6">
56+ <h1 class="mb3">Understanding Urbit</h1>
57+ <p class="lh-copy mt1">This sequence of posts will give you a high-level overview of Urbit. They take about <code>~12m</code> to read.</p>
58+ <ul class="list">
59+ <li class="mt3">
60+ <a class="b--black bb" href="/understanding-urbit/">Introduction</a>
61+ </li>
62+ {% set posts = get_section(path="understanding-urbit/_index.md") %} {%
63+ for page in posts.pages %}
64+ <li class="mt3">
65+ <a
66+ class="b--black bb"
67+ href="{{ page.permalink }}">
68+ {{ page.title }}
69+ </a>
70+ </li>
71+ {% endfor %}
72+ </ul>
73+</section>
4474
45− <li class="mt4"><a class="blue2" href="/docs">Docs ↗</a></li>
46− <li><a class="green2" href="/install">Install ↗</a></li>
47− </ul>
75+<section class="full c7-12-md c7-11-lg mt6">
76+ <h1 class="mb3">Learn More</h1>
77+ <ul class="list">
78+ <li class="mt3">
79+ <a class="b--black bb" href="/essays">Essays</a>
80+ </li>
81+ <li class="mt3">
82+ <a class="b--black bb" href="/updates/">Updates</a>
83+ </li>
84+ <li class="mt3">
85+ <a class="b--black bb" href="/media">Media</a>
86+ </li>
87+ <li class="mt3">
88+ <a class="b--black bb" href="/faq/">FAQ</a>
89+ </li>
90+ </ul>
91+</section>
4892
49− </section>
93+<section class="full c2-7-md c3-7-lg mv6">
94+ <h1 class="mb3">Follow Us</h1>
95+ <p class="lh-copy mt1 mb4">Urbit is actively being built, explored, and experimented with.
96+ To follow our progress you can:
97+ </p>
98+ <ul class="list">
99+ <li class="mt2">
100+ Follow us on <a class="b--black bb" href="https://twitter.com/urbit">Twitter</a>
101+ </li>
102+ <li class="mt2">
103+ Explore the code on
104+ <a class="b--black bb" href="https://github.com/urbit/urbit">GitHub</a>
105+ </li>
106+ <li class="mt2">
107+ Ask questions in our <a class="b--black bb" href="https://discord.gg/bkEX6EU">Discord</a>
108+ </li>
109+ </ul>
110+ <p class="lh-copy">
111+ or boot Urbit and join <code>~dopzod/urbit-help</code>
112+ </p>
113+</section>
50114
51− <aside class="half-2-md half-2-lg full mt0-l mt0-xl mt4" id="newsletter-subscribe-top">
52− <p class="lh-copy mt1 mb3">We send regular updates about our project. Enter your email to get them.</p>
53− <iframe name="nothing" style="display:none;"></iframe>
54− <form action="https://urbit.us11.list-manage.com/subscribe/post?u=972a03db9e0c6c25bb58de8c8&amp;amp;id=be143888d2"
55− method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate form"
56− target="_blank" novalidate>
57− <div class="input-group" id="mc_embed_signup_scroll">
58− <div class="mc-field-group w-100 relative">
59− <input class="bg-white black b--black ba pa3 w-100 mb2 br0" type="email" name="EMAIL" id="mce-EMAIL"
60− placeholder="your@email.com">
61− <button id="mc-embedded-subscribe" class="dib bn absolute"
62− style="font-family: 'Inter UI', san-serif; right: 3px; top: 15px; -webkit-appearance: none; background: transparent;" type="submit"
63− name="subscribe" onclick="_paq.push(['trackEvent', 'Mailing List', 'Subscribe'])"><span class="fr pr1">-></span>
115+<section
116+ class="full c7-12-md c7-11-lg mb6 mt6-xl mt6-l mt6-m"
117+ id="newsletter-subscribe-top">
118+ <h1 class="mb3">Stay Up to Date</h1>
119+ <p class="lh-copy mt1 mb3">
120+ We send regular updates about our project. Enter your email to get them.
121+ </p>
122+ <iframe name="nothing" style="display:none;"></iframe>
123+ <form
124+ action="https://urbit.us11.list-manage.com/subscribe/post?u=972a03db9e0c6c25bb58de8c8&amp;amp;id=be143888d2"
125+ method="post"
126+ id="mc-embedded-subscribe-form"
127+ name="mc-embedded-subscribe-form"
128+ class="validate form"
129+ target="_blank"
130+ novalidate>
131+ <div class="input-group" id="mc_embed_signup_scroll">
132+ <div class="mc-field-group w-100 relative">
133+ <input
134+ class="bg-white black b--black ba pa3 w-100 mb2 br0"
135+ type="email"
136+ name="EMAIL"
137+ id="mce-EMAIL"
138+ placeholder="your@email.com"/>
139+ <button
140+ id="mc-embedded-subscribe"
141+ class="dib bn absolute bg-transparent"
142+ style="font-family: 'Inter UI', san-serif; right: 3px; top: 15px; -webkit-appearance: none;"
143+ type="submit"
144+ name="subscribe"
145+ onclick="_paq.push(['trackEvent', 'Mailing List', 'Subscribe'])">
146+ <span class="fr pr1">-></span>
64147 </button>
65148 </div>
66− </form>
67− </aside>
68−</nav>
69−
70−<article class="full-bleed full grid12 mt6">
71−
72− <nav class="full grid12 mt4 mb6">
73− <section class="full c4-7-lg">
74− <h1>Understanding Urbit</h1>
75− <p class="lh-copy mt1">This sequence of posts will give you a high-level overview of Urbit. They take about <span class="mono">~12m</span> to read.</p>
76− <ul class="full c4-7-lg">
77− <li class="mt2"><a class="b--black bb" href="/understanding-urbit">Introduction</a></li>
78− {% set posts = get_section(path="understanding-urbit/_index.md") %}
79− {% for page in posts.pages %}
80− <li class="mt2"><a class="b--black bb" href="{{ page.permalink }}">{{ page.title }}</a></li>
81− {% endfor %}
82− </ul>
83− </section>
84−
85− <section class="full c7-10-lg mt4 mt0-xl">
86− <h1 class="mb3">Follow the Project</h1>
87− <p class="lh-copy mt1 mb4">Urbit is actively being built, explored, and experimented with.
88− To follow our progress you can:
89− </p>
90− <ul>
91− <li class="mt2">Follow us on <a href="https://twitter.com/urbit">Twitter</a></li>
92− <li class="mt2">Explore the code on <a href="https://github.com/urbit/urbit">GitHub</a></li>
93− <li class="mt2">Ask questions in our <a href="https://discord.gg/bkEX6EU">Discord</a></li>
94− </ul>
95− <p class="lh-copy">or boot Urbit and join <code class="db">~dopzod/urbit-help</code></p>
96− </section>
149+ </div>
150+ </form>
151+</section>
97152
98− </nav>
99−</article>
153+ <!-- </nav> -->
154+<!-- </article> -->
100155{% include "partials/footer.html" %}
101156{% endblock content %}
templates/understanding-urbit/list.html+1−1
@@ -16,7 +16,7 @@
1616 {% endfor %}
1717</nav>
1818<!-- content -->
19−<h1 class="mb4 full mt3 f2 fw3 c4-10-lg">Introduction</h1>
19+<h1 class="mb4 full mt4 c4-12-lg fw6">Introduction</h1>
2020<section class="full-bleed full grid12">
2121 <section id="introduction" class=" c4-10-lg full lh-copy">
2222 <figure class="mt0">