-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
144 lines (131 loc) · 3.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>localhost:3000</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-R5HH1F5KDM');
</script>
<script
type="module"
src="https://cdn.jsdelivr.net/gh/vanillawc/wc-markdown@1/index.js"
></script>
<script
type="text/javascript"
src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js"
></script>
<script
type="text/javascript"
src="https://unpkg.com/@webcomponents/[email protected]/custom-elements-es5-adapter.js"
></script>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-R5HH1F5KDM"
></script>
</head>
<body>
<div class="owner">
<wc-markdown class="dude"># Sup Dudes</wc-markdown>
<wc-markdown class="jokes" id="jokerville"></wc-markdown>
<img
aria-label="A picture of a possum"
onclick="dataLayer.push({'event': 'the-possums-have-clicked'});"
id="awesome"
class="possum"
/>
<div><a href="resume.html">i sometimes have a job</a></div>
<div>
<a href="https://github.com/samrocksc/radjokes">update my site</a>
</div>
<div>
<a rel="me" href="https://fosstodon.org/@samrocksc">anti-social</a>
</div>
</div>
<style>
.owner {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
align-items: center;
}
.possum {
width: 80%;
max-width: 500px;
}
@media only screen and (max-width: 360px) {
.possum {
width: 100%;
}
}
@media only screen and (max-width: 1366px) {
.possum {
width: 80%;
}
}
.possum:hover {
filter: grayscale(1);
-webkit-transition: filter 0.15s ease-in;
-moz-transition: filter 0.15s ease-in;
-ms-transition: filter 0.15s ease-in;
-o-transition: filter 0.15s ease-in;
transition: filter 0.15s ease-in;
}
.jokes:hover {
background-image: linear-gradient(
to left,
violet,
indigo,
green,
blue,
black,
orange,
red
);
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
color: transparent;
font-size: 1.5em;
-webkit-transition: font-size 1s ease-out;
-moz-transition: font-size 1s ease-out;
-ms-transition: font-size 1s ease-out;
-o-transition: font-size 1s ease-out;
transition: font-size 1s ease-out;
}
</style>
<script>
const getRADomInt = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.round(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
};
const button = document.body.querySelector('.possum');
button.addEventListener('click', () => {
gtag('event', 'cool', {});
});
const swapImage = () =>
document
.getElementById('awesome')
.setAttribute('src', `${getRADomInt(1, 8)}.jpg`);
console.log(`url: ${window.location.protocol}//${window.location.host}/api/awesome`)
const thing = async () => {
const res = await fetch(
`${window.location.protocol}//${window.location.host}/api/awesome`
)
const data = await res.json();
document.getElementById('jokerville').innerHTML = data.joke;
};
thing();
swapImage();
</script>
</body>
</html>