-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
180 lines (165 loc) · 6.66 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>She was a star...</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<meta
name="description"
content="Find out what kind of star you once were!"
/>
<meta property="og:title" content="She was a star..." />
<meta
property="og:description"
content="Find out what kind of star you once were!"
/>
<meta property="og:image" content="https://placekitten.com/1200/627" />
<meta property="og:url" content="https://shewasastar.com" />
<meta name="twitter:title" content="She was a star..." />
<meta
name="twitter:description"
content="Find out what kind of star you once were!"
/>
<meta name="twitter:image" content="https://placekitten.com/1200/627" />
<meta name="twitter:card" content="summary_large_image" />
</head>
<body>
<main>
<div class="intro">
<h1>Be the Star</h1>
<p>
Now's your chance to be that former star who now lives in [obscure
state of your choosing].
</p>
<p>
Add your headshot and see right before your eyes the star you once
were. Then feel free to screenshot it and share with all your friends.
</p>
<form>
<label
>Add your headshot: <input id="file-upload" type="file"
/></label>
<label
>Select your State:
<select id="select-state">
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana">Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota" selected>Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option>
</select>
</label>
</form>
</div>
<div class="star">
<div class="header">
<h1>Sponsored Stories</h1>
<p>Ads by Yahoo</p>
</div>
<img
id="image"
src="https://placekitten.com/343/150"
alt="Headshot of that former star"
/>
<h2>
She Was A Star, Now She Works In
<span id="display-state">Minnesota</span>
</h2>
<p>itsTheVibe</p>
</div>
<div class="footer">
<p>
This website does not use any cookies or other tracking entities, and
files loaded into the page are retained solely in the client browser
session. They are not uploaded to any server or service.
</p>
<p>
Source code available
<a href="https://github.com/zahnster/shewasastar" target="blank">
here</a
>.
</p>
<p>
Made by
<a href="https://twitter.com/zahnster" target="blank">Jade Pennig</a>.
</p>
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function () {
const imageField = document.getElementById("file-upload");
const imageEl = document.getElementById("image");
const select = document.getElementById("select-state");
const stateDisplay = document.getElementById("display-state");
imageField.addEventListener("change", handleFiles);
select.addEventListener("change", function (event) {
stateDisplay.innerText = event.target.value;
});
function handleFiles(ev) {
const files = ev.target.files;
const file = files[0];
if (file.type.startsWith("image/")) {
const reader = new FileReader();
reader.onload = (function () {
return function (e) {
image.src = e.target.result;
};
})(image);
reader.readAsDataURL(file);
}
}
});
</script>
</body>
</html>