From ed161e7fb20a697ecba070ef7db4c231d700f245 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 25 Mar 2020 05:12:40 +0100 Subject: Move to my own static generator --- src/static/avatar-512x512.png | Bin 244569 -> 0 bytes src/static/avatar-64x64.png | Bin 16769 -> 0 bytes src/static/comments.js | 65 --------- src/static/style.css | 319 ------------------------------------------ 4 files changed, 384 deletions(-) delete mode 100644 src/static/avatar-512x512.png delete mode 100644 src/static/avatar-64x64.png delete mode 100644 src/static/comments.js delete mode 100644 src/static/style.css (limited to 'src/static') diff --git a/src/static/avatar-512x512.png b/src/static/avatar-512x512.png deleted file mode 100644 index fc34eee..0000000 Binary files a/src/static/avatar-512x512.png and /dev/null differ diff --git a/src/static/avatar-64x64.png b/src/static/avatar-64x64.png deleted file mode 100644 index 1406f46..0000000 Binary files a/src/static/avatar-64x64.png and /dev/null 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 @@ -var firebaseConfig = { - apiKey: "AIzaSyD3E0XtiUJI4-JIxcIPZziNLGVaTdojz20", - authDomain: "mitja-felicijan-blog.firebaseapp.com", - databaseURL: "https://mitja-felicijan-blog.firebaseio.com", - projectId: "mitja-felicijan-blog", - storageBucket: "mitja-felicijan-blog.appspot.com", - messagingSenderId: "41650892882", - appId: "1:41650892882:web:b308f0a9c47198bdf7ef8b" -}; -firebase.initializeApp(firebaseConfig); - -var database = firebase.database(); -var docPath = window.location.hostname.replace('.', '-') + '/comments' + window.location.pathname.replace('.html', ''); -var submit = document.querySelector('#submit'); -var comments = document.querySelector('.comments ul'); -var textName = document.querySelector('#name'); -var textComment = document.querySelector('#comment'); -var ref = firebase.database().ref(docPath); - -function encodeHTML(s) { - return s.replace(/&/g, '&').replace(/ -
${encodeHTML(item.name)} - ${encodeHTML(item.published)}
-
${encodeHTML(item.comment)}
- `; - comments.innerHTML += liItem; - }); - - }, function (errorObject) { - console.log("The read failed: " + errorObject.code); - }); - - submit.addEventListener('click', function (evt) { - if (textName.value && textComment.value) { - submit.disabled = true; - firebase.database().ref(docPath + '/' + Date.now()).set({ - name: textName.value, - comment: textComment.value, - published: new Date().toISOString().slice(0, 16).replace('T', ' '), - }, function (error) { - if (error) { - alert('Data could not be saved.' + error); - } else { - textName.value = ''; - textComment.value = ''; - submit.disabled = false; - } - }); - } - }); -} 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 @@ -* { - box-sizing: border-box; -} - -body { - line-height: 150%; - margin-bottom: 100px; - font-family: serif; -} - -main { - max-width: 760px; - padding: 20px 30px; -} - -nav { - margin-bottom: 50px; -} - -nav a { - display: inline-block; - margin-right: 20px; -} - -h1 { - font-size: 280%; - line-height: initial; -} - -h2 { - font-size: 200%; - line-height: initial; -} - -h3 { - font-size: 160%; - line-height: initial; -} - -img { - max-width: 100%; - margin: 30px auto; - display: block; -} - -ul.article-list li { - margin-bottom: 10px; -} - -ul.article-list li div { - display: flex; -} - -ul.article-list time { - display: inline-block; - min-width: 160px; -} - - -article .info { - font-style: oblique; -} - -pre { - overflow: auto; -} - -table { - width: 100%; -} - -table, th, td { - border: 1px solid black; - text-align: left; -} - -th, td { - padding: 5px 10px; -} - -code, pre { - font-size: 14px; -} - -code { - background: rgb(255, 241, 177); - padding: 2px 5px; -} - -pre > code { - background: unset; - padding: unset; -} - -p.modified { - font-style: oblique; - font-size: 90%; - margin-top: 50px; -} - -::selection { - background: #ff0; - color: #000; -} - -::-moz-selection { - background: #ff0; - color: #000; -} - -.comments { - margin-top: 50px; -} -.comments ul { - margin-top: 30px; - padding-left: 15px; -} -.comments ul li { - margin-bottom: 20px; -} -.comments input, -.comments textarea { - width: 100%; - padding: 10px; - margin-bottom: 10px; - font-family: inherit; - font-size: inherit; - border: 1px solid lightgray; -} -.comments textarea { - resize: vertical; - height: 100px; -} - -@media only screen and (max-width:480px) { - main { - padding: 20px; - } - - nav { - text-align: center; - margin-bottom: initial; - } - - nav a { - margin-bottom: 10px; - } - - ul.article-list { - padding-left: 20px; - - } - - ul.article-list li { - margin-bottom: 20px; - - } - - ul.article-list li div { - display: block; - margin-top: 15px; - } - - ul.article-list a { - display: block; - margin-top: 5px; - } - - h1 { - font-size: 220%; - } - - h2 { - font-size: 180%; - } - - h3 { - font-size: 160%; - } -} - -@media (prefers-color-scheme: light) { - body { - background-color: white; - color: black; - } -} - -@media (prefers-color-scheme: dark) { - body { - background-color: rgb(30, 30, 30); - color: white; - } - - a { - color: white; - } -} - -/* prism theme */ - -/** - * GHColors theme by Avi Aryan (http://aviaryan.in) - * Inspired by Github syntax coloring - */ - -code[class*="language-"], -pre[class*="language-"] { - color: #393A34; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; - direction: ltr; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - line-height: 1.2em; - - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; - } - - pre > code[class*="language-"] { - - } - - pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, - code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - background: #b3d4fc; - } - - pre[class*="language-"]::selection, pre[class*="language-"] ::selection, - code[class*="language-"]::selection, code[class*="language-"] ::selection { - background: #b3d4fc; - } - - /* Code blocks */ - pre[class*="language-"] { - padding: 1em; - margin: .5em 0; - overflow: auto; - border: 1px solid #dddddd; - background-color: white; - } - - /* Inline code */ - :not(pre) > code[class*="language-"] { - padding: .2em; - padding-top: 1px; padding-bottom: 1px; - background: #f8f8f8; - border: 1px solid #dddddd; - } - - .token.comment, - .token.prolog, - .token.doctype, - .token.cdata { - color: #999988; font-style: italic; - } - - .token.namespace { - opacity: .7; - } - - .token.string, - .token.attr-value { - color: #e3116c; - } - .token.punctuation, - .token.operator { - color: #393A34; /* no highlight */ - } - - .token.entity, - .token.url, - .token.symbol, - .token.number, - .token.boolean, - .token.variable, - .token.constant, - .token.property, - .token.regex, - .token.inserted { - color: #36acaa; - } - - .token.atrule, - .token.keyword, - .token.attr-name, - .language-autohotkey .token.selector { - color: #00a4db; - } - - .token.function, - .token.deleted, - .language-autohotkey .token.tag { - color: #9a050f; - } - - .token.tag, - .token.selector, - .language-autohotkey .token.keyword { - color: #00009f; - } - - .token.important, - .token.function, - .token.bold { - font-weight: bold; - } - - .token.italic { - font-style: italic; -} -- cgit v1.2.3