-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
146 lines (123 loc) · 2.94 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Typed USA States | Demo</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"
/>
<script
src="https://unpkg.com/requirejs"
integrity="sha384-9M3Wd+wRkBqNHxK8F7Wg3Xs1Du/JXnCXgVdJ+G6KkYBvGol8vSgEiBdd8+MTaYtk"
crossorigin="anonymous"
></script>
<script
src="https://unpkg.com/scriptex-socials"
async
integrity="sha384-FDS8WECJvE4bGb+arLPh3DSv0mrVHD+hJRf+UaM6rVMT+wBleSgUlog90rrtgHH1"
crossorigin="anonymous"
></script>
<style>
* {
box-sizing: border-box;
}
html,
body,
main {
height: 100%;
}
body {
font-family: sans-serif;
font-size: 0.875rem;
line-height: 1.25;
text-align: center;
margin: 0;
}
h1,
h2 {
margin: 0 0 1rem;
}
main {
padding: 1rem 0.5rem;
}
.result {
width: 100%;
height: calc(100% - 5rem);
display: flex;
flex-flow: row nowrap;
overflow: auto;
}
.result div {
max-width: calc(100% / 3);
height: 100%;
flex: 0 0 calc(100% / 3);
padding: 0 0.5rem;
}
.result pre {
text-align: left;
height: calc(100% - 2.640625rem);
padding: 1rem;
overflow: auto;
background-color: #ccc;
}
@media (max-width: 1199px) {
.result div {
max-width: 50%;
flex: 0 0 50%;
}
}
@media (max-width: 767px) {
.result div {
max-width: 75vw;
flex: 0 0 75vw;
}
}
</style>
</head>
<body>
<main>
<a
href="https://github.com/scriptex/typed-usa-states"
title="See code on Github"
class="github-fork-ribbon"
data-ribbon="See code on Github"
>
See code on Github
</a>
<h1>Typed USA States</h1>
<div id="result" class="result"></div>
<social-links></social-links>
</main>
<script>
var html = '';
var exports = {};
require([
'./dist/cities.js',
'./dist/states-full.js',
'./dist/states-with-area.js',
'./dist/states-with-counties.js',
'./dist/states-with-population.js',
'./dist/states-with-zipcodes.js',
'./dist/states.js'
], function () {
// The exports object from above gets populated
console.log(exports.usaCities);
console.log(exports.usaStates);
console.log(exports.usaStatesFull);
console.log(exports.usaStatesWithArea);
console.log(exports.usaStatesWithCounties);
console.log(exports.usaStatesWithPopulation);
console.log(exports.usaStatesWithZipCodes);
Object.keys(exports).forEach(function (key) {
const title = '<h2>' + key + '</h2>';
const content = '<pre><code>' + JSON.stringify(exports[key], null, 2) + '</code></pre>';
const markup = '<div>' + title + content + '</div>';
html += markup;
});
document.getElementById('result').innerHTML = html;
});
</script>
</body>
</html>