-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
170 lines (144 loc) · 3.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Foxes</title>
<script src="main.js"></script>
<meta property="og:title" content="Random Foxes" />
<meta
property="og:url"
content="https://plally.github.io/fox_pics_frontend"
/>
<meta property="og:type" content="website" />
<meta
property="og:image"
content="https://store.fox.pics/a7568838-f7bc-4481-9954-220b8843a74a.jpg"
/>
<meta
property="og:description"
content="Easilly get a random picture of a fox"
/>
<meta
name="Description"
content="A page where you can get random pictures of foxes"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {
font-size: 16px;
--nav-background-primary: #222;
}
html,
body,
.rootcontainer {
height: 100%;
margin: 0;
padding: 0;
background-color: black;
color: #fff;
}
.rootcontainer {
max-height: 100%;
display: flex;
flex-flow: column;
}
.fox-container {
background-color: black;
flex: 1;
overflow: hidden;
}
.fox-img {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.navbar {
width: 100%;
padding: 0;
margin: 0;
background-color: var(--nav-background-primary);
}
.nav-button {
border: none;
cursor: pointer;
position: relative;
background-color: var(--nav-background-primary);
color: lightgray;
float: left;
align-items: center;
padding: 1.2rem 1.2rem;
text-decoration: none;
}
@media (hover: hover) {
.nav-button:hover {
transition: 400ms;
color: orange;
}
}
.nav-button:active {
transition: 400ms;
background-color: #fff;
}
#github {
float: right;
}
.modalBackground {
background-color: rgba(0,0,0,0.7);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.modal {
background-color: var(--nav-background-primary);
position: absolute;
top: 50%;
left: 50%;
height: auto;
max-width: 75%;
width: 700px;
max-width: 80%;
padding: 10px;
border-radius: 5px;
transform: translate(-50%, -50%);
}
a:hover {
color:orange;
}
a, a:focus, a:active {
text-decoration: none;
color: inherit;
}
</style>
</head>
<body>
<div id="myapp"></div>
<script>
var app = Elm.Main.init({
node: document.getElementById("myapp")
});
async function copyToClipboard(text) {
await navigator.clipboard.writeText(text);
}
app.ports.writeClipboard.subscribe(function(message) {
copyToClipboard(message);
});
app.ports.preloadImages.subscribe(function(message) {
message.forEach(url => {
var img = new Image();
img.src = url;
img.onload = function() {
app.ports.preloadImageReceiver.send(url);
};
});
});
</script>
<noscript>
<h1>This site requires Javascript to function</h1>
</noscript>
<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "d3802023e9034233ab5568ecbc87993d", "spa": true}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>