-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjosh.html
191 lines (169 loc) · 3.57 KB
/
josh.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>HBD JDP</title>
<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=Patrick+Hand&family=Satisfy&display=swap" rel="stylesheet">
</head>
<style>
.card {
background-color: pink;
margin: auto;
padding: 24px;
height: 100%;
}
.title {
font-family: 'Satisfy', cursive;
font-size: 3rem;
text-align: center;
margin: 24px;
}
.container {
display: flex;
flex-direction: column;
}
.poetry {
display: flex;
flex-direction: column;
}
.btn {
width: 44px;
margin-right: 24px;
font-family: 'Patrick Hand', cursive;
font-size: 2rem;
border: none;
background-color: transparent;
}
.line {
font-size: 1.6rem;
font-family: 'Patrick Hand', cursive;
}
#refresh {
height: 100%;
margin: auto;
font-size: 5rem;
background: transparent;
border: none;
}
.xo {
font-family: 'Satisfy', cursive;
font-size: 2rem;
text-align: right;
}
@media only screen and (min-width: 600px) {
.card {
max-width: 600px;
width: 80%;
height: 80vh;
padding: 60px;
}
.title {
font-size: 4rem;
margin: revert;
}
.container {
flex-direction: row;
}
.poetry {
min-width:296px;
}
.xo {
font-size: 2.5rem;
}
}
</style>
<body>
<section class="card">
<h1 class="title">Happy Birthday, Josh!</h1>
<div class="container">
<div class="poetry">
<div style="display:flex;">
<button onclick="getJ();" class="btn">J</button>
<p id="j" class="line">Just grateful for the</p>
</div>
<div style="display:flex;">
<button onclick="getO();" class="btn">O</button>
<p id="o" class="line">Opportunity to know you</p>
</div>
<div style="display:flex;">
<button onclick="getS();" class="btn">S</button>
<p id="s" class="line">So special to</p>
</div>
<div style="display:flex;">
<button onclick="getH();" class="btn">H</button>
<p id="h" class="line">Have you as a roommate</p>
</div>
</div>
<button onclick="refresh();" id="refresh">↻</button>
</div>
<p class="xo">You're the best and ily,</br>Tarin</p>
</section>
</body>
<script>
const j = [
'Jenius',
'Just',
'Justifiably',
'Judicious',
'Judgmental',
'Joyfully'
], o = [
// 'Ohmygod',
// 'Only you could',
'Original',
'Outrageous',
'Outstanding',
'Odorous'
], s = [
'Seriously',
'Simply',
'Super',
'Singing'
], h = [
'H-amazing',
'Heartwarming',
'Hoe',
'Honest'
];
function randAdj(letter) {
let arr;
switch(letter) {
case 'j':
arr = j;
break;
case 'o':
arr = o;
break;
case 's':
arr = s;
break;
case 'h':
arr = h;
break;
}
let el = document.querySelector(`#${letter}`);
if (el && arr) el.innerText = arr[Math.floor(Math.random() * arr.length)];
};
function refresh() {
randAdj('j');
randAdj('o');
randAdj('s');
randAdj('h');
}
function getJ() {
randAdj('j');
};
function getO() {
randAdj('o');
};
function getS() {
randAdj('s');
};
function getH() {
randAdj('h');
};
</script>
</html>