-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex6.html
165 lines (130 loc) · 4.61 KB
/
index6.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
<!DOCTYPE html>
<html>
<head>
<title>Fonts [Nov 11th 2014]</title>
<script type="text/javascript">
//s cope the global variables to Eventbrite rather than to window
window.EB = window.EB || {};
EB.renderFonts = function(fonts) {
// base64:
// family: 'Benton Sans',
// weight: '400',
// style: 'italic'
// expects a list of things with a base64_font, a font_family and font_weight and font_style
var style = document.createElement('style');
var fontRules = "";
for (var i = 0, font; font = fonts[i]; i++) {
// for every font, cycle through and create font rules
fontRules += (
"@font-face {" +
" font-family: '" + font.family + "';" +
" font-weight: " + font.weight + ";" +
" font-style: " + font.style +";" +
" src: url(data:application/font-woff;base64," + font.base64 + ") format('woff');" +
"}\n"
);
}
//
style.innerHTML = fontRules;
document.getElementsByTagName('head')[0].appendChild(style);
document.documentElement.className += ' font-has-loaded';
};
if (window.localStorage) {
(function(){
var fonts = JSON.parse(localStorage.getItem('fonts'));
if (fonts) {
// if the font is already stored in localstorage then render the fonts
EB.renderFonts(fonts);
} else {
// by default try and render the font
EB.customFontsEnabled = true;
// asynchronously load the javascript
var script = document.createElement('script');
script.src = "fonts6.js";
document.getElementsByTagName('head')[0].appendChild(script);
// if the font takes more than 3000ms (3 seconds) to load then don't load it this time and just keep trying to get it in local storage but dont do the flash to the new font
setTimeout( function() {
customFontsEnabled = false;
}, 3000);
}
})();
}
</script>
<style type="text/css">
body {
/* standard */
font-family: "Benton Sans", helvetica, sans-serif;
}
.bentonsans {
/* fallback during load of font ?? */
font-family: Avenir, Roboto, "Helvetica Neue", Helvetica, Arial, sans serif;
}
.font-has-loaded .bentonsans {
/* ideal size and state for font */
font-family: "Benton Sans", Avenir, Roboto, "Helvetica Neue", Helvetica, Arial, sans serif;
}
.text-heading-mega {
font-size: 65px;
line-height: 70px;
font-weight: 700;
color: #030303;
}
.text-heading-epic {
font-size: 45px;
line-height: 50px;
font-weight: 700;
color: #030303;
}
.text-heading-primary {
font-size: 35px;
line-height: 40px;
font-weight: 700;
color: #030303;
}
.text-heading-secondary {
font-size: 25px;
line-height: 40px;
font-weight: 400;
color: #636363;
}
.text-heading-tertiary {
font-size: 20px;
line-height: 25px;
font-weight: 400;
color: #636363;
}
.text-body {
font-size: 15px;
line-height: 25px;
color: #636363;
}
.label {
font-size: 12px;
line-height: 15px;
font-weight: 700;
text-transform: uppercase;
color: #030303;
}
.supplementary {
font-size: 12px;
line-height: 15px;
font-weight: 400;
color: #acacbf;
}
.italic {
font-style: italic;
}
</style>
</head>
<body class="bentonsans">
<h1 class="text-heading-mega">Typography</h1>
<h2 class="text-heading-mega">Mega</h2>
<h2 class="text-heading-epic">Epic</h2>
<h2 class="text-heading-primary">Primary</h2>
<h2 class="text-heading-secondary">Secondary</h2>
<h2 class="text-heading-tertiary">Tertiary</h2>
<p class="text-body">Body</p>
<label class="label">Label</label>
<p class="supplementary">Supplementary</p>
</body>
</html>