aboutsummaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/static')
-rw-r--r--src/static/avatar-512x512.pngbin244569 -> 0 bytes
-rw-r--r--src/static/avatar-64x64.pngbin16769 -> 0 bytes
-rw-r--r--src/static/comments.js65
-rw-r--r--src/static/style.css319
4 files changed, 0 insertions, 384 deletions
diff --git a/src/static/avatar-512x512.png b/src/static/avatar-512x512.png
deleted file mode 100644
index fc34eee..0000000
--- a/src/static/avatar-512x512.png
+++ /dev/null
Binary files differ
diff --git a/src/static/avatar-64x64.png b/src/static/avatar-64x64.png
deleted file mode 100644
index 1406f46..0000000
--- a/src/static/avatar-64x64.png
+++ /dev/null
Binary files differ
diff --git a/src/static/comments.js b/src/static/comments.js
deleted file mode 100644
index 3f373e5..0000000
--- a/src/static/comments.js
+++ /dev/null
@@ -1,65 +0,0 @@
1var firebaseConfig = {
2 apiKey: "AIzaSyD3E0XtiUJI4-JIxcIPZziNLGVaTdojz20",
3 authDomain: "mitja-felicijan-blog.firebaseapp.com",
4 databaseURL: "https://mitja-felicijan-blog.firebaseio.com",
5 projectId: "mitja-felicijan-blog",
6 storageBucket: "mitja-felicijan-blog.appspot.com",
7 messagingSenderId: "41650892882",
8 appId: "1:41650892882:web:b308f0a9c47198bdf7ef8b"
9};
10firebase.initializeApp(firebaseConfig);
11
12var database = firebase.database();
13var docPath = window.location.hostname.replace('.', '-') + '/comments' + window.location.pathname.replace('.html', '');
14var submit = document.querySelector('#submit');
15var comments = document.querySelector('.comments ul');
16var textName = document.querySelector('#name');
17var textComment = document.querySelector('#comment');
18var ref = firebase.database().ref(docPath);
19
20function encodeHTML(s) {
21 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
22}
23
24if (submit) {
25 ref.on("value", function (snapshot) {
26 comments.innerHTML = '';
27 var commentList = Array();
28
29 // generating normal array
30 snapshot.forEach(function (item) {
31 commentList.push(item.val())
32 });
33
34 // rendering html
35 commentList.reverse().forEach(function (item) {
36 var liItem = `<li>
37 <div><b>${encodeHTML(item.name)}</b> - ${encodeHTML(item.published)}</div>
38 <div>${encodeHTML(item.comment)}</div>
39 </li>`;
40 comments.innerHTML += liItem;
41 });
42
43 }, function (errorObject) {
44 console.log("The read failed: " + errorObject.code);
45 });
46
47 submit.addEventListener('click', function (evt) {
48 if (textName.value && textComment.value) {
49 submit.disabled = true;
50 firebase.database().ref(docPath + '/' + Date.now()).set({
51 name: textName.value,
52 comment: textComment.value,
53 published: new Date().toISOString().slice(0, 16).replace('T', ' '),
54 }, function (error) {
55 if (error) {
56 alert('Data could not be saved.' + error);
57 } else {
58 textName.value = '';
59 textComment.value = '';
60 submit.disabled = false;
61 }
62 });
63 }
64 });
65}
diff --git a/src/static/style.css b/src/static/style.css
deleted file mode 100644
index d2b3203..0000000
--- a/src/static/style.css
+++ /dev/null
@@ -1,319 +0,0 @@
1* {
2 box-sizing: border-box;
3}
4
5body {
6 line-height: 150%;
7 margin-bottom: 100px;
8 font-family: serif;
9}
10
11main {
12 max-width: 760px;
13 padding: 20px 30px;
14}
15
16nav {
17 margin-bottom: 50px;
18}
19
20nav a {
21 display: inline-block;
22 margin-right: 20px;
23}
24
25h1 {
26 font-size: 280%;
27 line-height: initial;
28}
29
30h2 {
31 font-size: 200%;
32 line-height: initial;
33}
34
35h3 {
36 font-size: 160%;
37 line-height: initial;
38}
39
40img {
41 max-width: 100%;
42 margin: 30px auto;
43 display: block;
44}
45
46ul.article-list li {
47 margin-bottom: 10px;
48}
49
50ul.article-list li div {
51 display: flex;
52}
53
54ul.article-list time {
55 display: inline-block;
56 min-width: 160px;
57}
58
59
60article .info {
61 font-style: oblique;
62}
63
64pre {
65 overflow: auto;
66}
67
68table {
69 width: 100%;
70}
71
72table, th, td {
73 border: 1px solid black;
74 text-align: left;
75}
76
77th, td {
78 padding: 5px 10px;
79}
80
81code, pre {
82 font-size: 14px;
83}
84
85code {
86 background: rgb(255, 241, 177);
87 padding: 2px 5px;
88}
89
90pre > code {
91 background: unset;
92 padding: unset;
93}
94
95p.modified {
96 font-style: oblique;
97 font-size: 90%;
98 margin-top: 50px;
99}
100
101::selection {
102 background: #ff0;
103 color: #000;
104}
105
106::-moz-selection {
107 background: #ff0;
108 color: #000;
109}
110
111.comments {
112 margin-top: 50px;
113}
114.comments ul {
115 margin-top: 30px;
116 padding-left: 15px;
117}
118.comments ul li {
119 margin-bottom: 20px;
120}
121.comments input,
122.comments textarea {
123 width: 100%;
124 padding: 10px;
125 margin-bottom: 10px;
126 font-family: inherit;
127 font-size: inherit;
128 border: 1px solid lightgray;
129}
130.comments textarea {
131 resize: vertical;
132 height: 100px;
133}
134
135@media only screen and (max-width:480px) {
136 main {
137 padding: 20px;
138 }
139
140 nav {
141 text-align: center;
142 margin-bottom: initial;
143 }
144
145 nav a {
146 margin-bottom: 10px;
147 }
148
149 ul.article-list {
150 padding-left: 20px;
151
152 }
153
154 ul.article-list li {
155 margin-bottom: 20px;
156
157 }
158
159 ul.article-list li div {
160 display: block;
161 margin-top: 15px;
162 }
163
164 ul.article-list a {
165 display: block;
166 margin-top: 5px;
167 }
168
169 h1 {
170 font-size: 220%;
171 }
172
173 h2 {
174 font-size: 180%;
175 }
176
177 h3 {
178 font-size: 160%;
179 }
180}
181
182@media (prefers-color-scheme: light) {
183 body {
184 background-color: white;
185 color: black;
186 }
187}
188
189@media (prefers-color-scheme: dark) {
190 body {
191 background-color: rgb(30, 30, 30);
192 color: white;
193 }
194
195 a {
196 color: white;
197 }
198}
199
200/* prism theme */
201
202/**
203 * GHColors theme by Avi Aryan (http://aviaryan.in)
204 * Inspired by Github syntax coloring
205 */
206
207code[class*="language-"],
208pre[class*="language-"] {
209 color: #393A34;
210 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
211 direction: ltr;
212 text-align: left;
213 white-space: pre;
214 word-spacing: normal;
215 word-break: normal;
216 line-height: 1.2em;
217
218 -moz-tab-size: 4;
219 -o-tab-size: 4;
220 tab-size: 4;
221
222 -webkit-hyphens: none;
223 -moz-hyphens: none;
224 -ms-hyphens: none;
225 hyphens: none;
226 }
227
228 pre > code[class*="language-"] {
229
230 }
231
232 pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
233 code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
234 background: #b3d4fc;
235 }
236
237 pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
238 code[class*="language-"]::selection, code[class*="language-"] ::selection {
239 background: #b3d4fc;
240 }
241
242 /* Code blocks */
243 pre[class*="language-"] {
244 padding: 1em;
245 margin: .5em 0;
246 overflow: auto;
247 border: 1px solid #dddddd;
248 background-color: white;
249 }
250
251 /* Inline code */
252 :not(pre) > code[class*="language-"] {
253 padding: .2em;
254 padding-top: 1px; padding-bottom: 1px;
255 background: #f8f8f8;
256 border: 1px solid #dddddd;
257 }
258
259 .token.comment,
260 .token.prolog,
261 .token.doctype,
262 .token.cdata {
263 color: #999988; font-style: italic;
264 }
265
266 .token.namespace {
267 opacity: .7;
268 }
269
270 .token.string,
271 .token.attr-value {
272 color: #e3116c;
273 }
274 .token.punctuation,
275 .token.operator {
276 color: #393A34; /* no highlight */
277 }
278
279 .token.entity,
280 .token.url,
281 .token.symbol,
282 .token.number,
283 .token.boolean,
284 .token.variable,
285 .token.constant,
286 .token.property,
287 .token.regex,
288 .token.inserted {
289 color: #36acaa;
290 }
291
292 .token.atrule,
293 .token.keyword,
294 .token.attr-name,
295 .language-autohotkey .token.selector {
296 color: #00a4db;
297 }
298
299 .token.function,
300 .token.deleted,
301 .language-autohotkey .token.tag {
302 color: #9a050f;
303 }
304
305 .token.tag,
306 .token.selector,
307 .language-autohotkey .token.keyword {
308 color: #00009f;
309 }
310
311 .token.important,
312 .token.function,
313 .token.bold {
314 font-weight: bold;
315 }
316
317 .token.italic {
318 font-style: italic;
319}