-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
289 lines (252 loc) · 8.04 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!DOCTYPE html>
<html lang="en">
<head>
<title>JAMStack deployed site</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
background-image: radial-gradient(
circle,
rgba(246, 246, 246, 0.5),
#fff
);
margin: 0;
--border-radius: 5px;
}
console {
margin: auto;
--console-border-radius: 4px;
--console-color-green: rgb(53, 205, 75);
--console-color-yellow: rgb(253, 188, 64);
--console-color-red: rgb(252, 99, 94);
--console-color-text: rgb(199, 199, 199);
--console-default-margin: 3px;
display: block;
width: 60%;
min-width: 500px;
font-family: Monaco, monospace;
position: absolute;
left: 50%;
top: 40%;
transform: translate(-50%, -40%);
}
console > header {
box-sizing: border-box;
background-color: rgb(246, 246, 246);
height: 23px;
width: 100%;
display: block;
border-top-left-radius: var(--console-border-radius);
border-top-right-radius: var(--console-border-radius);
border: 1px solid rgba(178, 178, 178, 0.5);
}
console > header,
.title {
text-align: center;
color: black;
font-family: sans-serif;
font-size: 14px;
vertical-align: middle;
}
.login-message {
margin-left: var(--console-default-margin);
margin-top: var(--console-default-margin);
color: var(--console-color-text);
}
.circle {
border-radius: 50%;
width: 12px;
height: 12px;
}
.window-command-block {
display: block;
margin-left: 7px;
}
.window-command-block > .entry {
display: block;
float: left;
margin: 5px;
}
.minimize {
background-color: rgb(253, 188, 64);
}
.maximize {
background-color: rgb(53, 205, 75);
}
.close {
background-color: rgb(252, 99, 94);
}
console > screen {
background: #000;
color: #fff;
font-size: 12px;
overflow-y: scroll;
display: block;
height: 100%;
border-bottom-left-radius: var(--console-border-radius);
border-bottom-right-radius: var(--console-border-radius);
}
.command-blocks {
margin-left: 7px;
margin-right: 7px;
margin-bottom: 10px;
}
.command-block > .working-directory {
float: left;
margin-right: 5px;
}
.command-block {
margin-left: 3px;
}
.command-block > .command {
color: lightseagreen;
margin-left: 3px;
}
.command-block > .command > .cursor {
color: var(--console-color-text);
width: 2px;
background-color: var(--console-color-text);
}
.command-block > .command-result {
color: var(--console-color-text);
margin-bottom: 1em;
margin-top: 1em;
}
.git-add {
margin-left: 50px;
color: rgb(0, 168, 28);
}
.path {
color: rgb(99, 110, 204);
}
.path-arrow-red {
color: var(--console-color-red);
}
.path-arrow-green {
color: var(--console-color-green);
}
.path-arrow-yellow {
color: var(--console-color-yellow);
}
.apple-shadow {
background: #f5f5f5;
border-radius: 5px;
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
box-sizing: border-box;
}
</style>
</head>
<body>
<script>
const apiUrlBase = 'https://jamon-api.codecentric.rocks/dev/';
function getRemoteData(path) {
return fetch(apiUrlBase + path).then(function(response) {
return response.json();
});
}
function getDeployedPlatformDescription(platform) {
// try to discover the platform based on the subdomain
if (!platform) {
platform = window.location.hostname.split('.', 1).join();
}
return getRemoteData('description?platform=' + platform);
}
function getUserGeoLocation() {
return getRemoteData('ip');
}
document.addEventListener('DOMContentLoaded', function() {
getDeployedPlatformDescription().then(function(result) {
if (result && result.description) {
const el = document.querySelector('.command-result.description');
el.innerText = result.description;
}
});
getUserGeoLocation().then(function(result) {
if (result && result.userCountry) {
const el = document.querySelector(
'.command-result > .geo-location'
);
el.innerText = result.userCountry.emoji + result.userCountry.name;
}
});
});
</script>
<console class="apple-shadow">
<header>
<span class="window-command-block">
<span class="entry circle close"></span>
<span class="entry circle minimize"></span>
<span class="entry circle maximize"></span>
</span>
<span
class="title"
title="Profile: a coder's dream
Command: /Applications/iTerm.app/Contents/MacOS/iTerm2"
>
JAMStack deploy
</span>
</header>
<screen>
<div class="login-message">
Last login: Thu Dec 22 00:26:31 on ttys002<br />
Your analyst has you mixed up with another patient. Don't believe a
thing he tells you.
</div>
<span class="command-blocks">
<div class="command-block">
<span class="working-directory">
<span class="path">~/d/g/jamon </span>
<span class="path-arrow-red">❯</span
><span class="path-arrow-yellow">❯</span
><span class="path-arrow-green">❯</span>
</span>
<span class="command">whoami</span>
<div class="command-result">
JAMStack dev from
<span class="geo-location">an uknown location</span>
</div>
</div>
<div class="command-block">
<span class="working-directory">
<span class="path">~/d/g/jamon </span>
<span class="path-arrow-red">❯</span
><span class="path-arrow-yellow">❯</span
><span class="path-arrow-green">❯</span>
</span>
<span class="command">git status</span>
<div class="command-result">
On branch master<br />
Your branch is up-to-date with 'origin/master'.<br />
Changes to be committed: <br />
(use "git reset HEAD <file>..." to unstage)<br />
<p class="git-add">new file: deployment.md</p>
</div>
</div>
<div class="command-block">
<span class="working-directory">
<span class="path">~/d/g/jamon </span>
<span class="path-arrow-red">❯</span
><span class="path-arrow-yellow">❯</span
><span class="path-arrow-green">❯</span>
</span>
<span class="command">cat deployment.md</span>
<div class="command-result description">
If you are seing this, then something went wrong with getting the
description on the used hosting solution. <br /><br />
Oh well, at least the site is online...
</div>
</div>
<div class="command-block">
<span class="working-directory">
<span class="path">~/d/g/jamon </span>
<span class="path-arrow-red">❯</span
><span class="path-arrow-yellow">❯</span
><span class="path-arrow-green">❯</span>
</span>
<span class="command"> <span class="cursor"> </span> </span>
</div>
</span>
</screen>
</console>
</body>
</html>