cabin

Source code for personal website
git clone git://git.dimitrijedobrota.com/cabin.git
Log | Files | Refs

commit 0315a283c902d7465a88c399565ec356c7413c77
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Wed, 14 Sep 2022 21:09:58 +0200

Initial Commit

Diffstat:
A.gitignore | 1+
Acss/colors.css | 172+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acss/index.css | 280+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aimg/android-chrome-192x192.png | 0
Aimg/android-chrome-512x512.png | 0
Aimg/apple-touch-icon.png | 0
Aimg/btc-qr.png | 0
Aimg/btc.png | 0
Aimg/favicon-16x16.png | 0
Aimg/favicon-32x32.png | 0
Aimg/favicon.ico | 0
Aimg/xmr-qr.png | 0
Aimg/xmr.png | 0
Aindex.html | 38++++++++++++++++++++++++++++++++++++++
Arobots.txt | 2++
Ascripts/main.js | 19+++++++++++++++++++
Asitemap.xml | 15+++++++++++++++
17 files changed, 527 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +blog/* diff --git a/css/colors.css b/css/colors.css @@ -0,0 +1,172 @@ +:root { + /* Defualt Theme */ + --red :#cc241d; + --green :#98971a; + --yellow :#d79921; + --blue :#458588; + --purple :#b16286; + --aqua :#689d6a; + --orange :#d65d0e; + --gray :#928374; + + /* Light Theme */ + --light_switch_shadow: #373d4e; + --light_switch_icon: "🌑"; + --light_switch_text: "dark mode?"; + + --light0_hard :#f9f5d7; + --light0 :#fbf1c7; + --light0_soft :#f2e5bc; + --light1 :#ebdbb2; + --light2 :#d5c4a1; + --light3 :#bdae93; + --light4 :#a89984; + + --light_red :#9d0006; + --light_green :#79740e; + --light_yellow :#b57614; + --light_blue :#076678; + --light_purple :#8f3f71; + --light_aqua :#427b58; + --light_gray :#7c6f64; + --light_orange :#af3a03; + + --light_invert :0%; + + /* Dark Theme */ + --dark_switch_shadow: #fce477; + --dark_switch_icon: "🌕"; + --dark_switch_text: "light mode?"; + + --dark0_hard :#1d2021; + --dark0 :#282828; + --dark0_soft :#32302f; + --dark1 :#3c3836; + --dark2 :#504945; + --dark3 :#665c54; + --dark4 :#7c6f64; + + --dark_red :#fb4934; + --dark_green :#b8bb26; + --dark_yellow :#fabd2f; + --dark_blue :#83a598; + --dark_purple :#d3869b; + --dark_aqua :#8ec07c; + --dark_orange :#fe8019; + --dark_gray :#a89984; + + --dark_invert :100%; + + /* Default Mode */ + --switch_shadow_color: var(--light0); + --switch_icon: var(--dark_switch_icon); + --switch_text: var(--dark_switch_text); + + --theme_red :var(--dark_red); + --theme_green :var(--dark_green); + --theme_yellow :var(--dark_yellow); + --theme_blue :var(--dark_blue); + --theme_purple :var(--dark_purple); + --theme_aqua :var(--dark_aqua); + --theme_gray :var(--dark_gray); + --theme_orange :var(--dark_orange); + + --theme_bg0_hard :var(--dark0_hard); + --theme_bg0 :var(--dark0); + --theme_bg0_soft :var(--dark0_soft); + --theme_bg1 :var(--dark1); + --theme_bg2 :var(--dark2); + --theme_bg3 :var(--dark3); + --theme_bg4 :var(--dark4); + + --theme_fg0_hard :var(--light0_hard); + --theme_fg0 :var(--light0); + --theme_fg0_soft :var(--light0_soft); + --theme_fg1 :var(--light1); + --theme_fg2 :var(--light2); + --theme_fg3 :var(--light3); + --theme_fg4 :var(--light4); + + --theme_invert :var(--dark_invert); +} + +/* Switched mode */ +#theme_switch:checked ~ main { + --switch_icon: var(--light_switch_icon); + --switch_text: var(--light_switch_text); + + --theme_red :var(--light_red); + --theme_green :var(--light_green); + --theme_yellow :var(--light_yellow); + --theme_blue :var(--light_blue); + --theme_purple :var(--light_purple); + --theme_aqua :var(--light_aqua); + --theme_gray :var(--light_gray); + --theme_orange :var(--light_orange); + + --theme_bg0_hard :var(--light0_hard); + --theme_bg0 :var(--light0); + --theme_bg0_soft :var(--light0_soft); + --theme_bg1 :var(--light1); + --theme_bg2 :var(--light2); + --theme_bg3 :var(--light3); + --theme_bg4 :var(--light4); + + --theme_fg0_hard :var(--dark0_hard); + --theme_fg0 :var(--dark0); + --theme_fg0_soft :var(--dark0_soft); + --theme_fg1 :var(--dark1); + --theme_fg2 :var(--dark2); + --theme_fg3 :var(--dark3); + --theme_fg4 :var(--dark4); + + --theme_invert :var(--light_invert); +} + +.theme_switch { /* Hides the checkbox */ + display: none; + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; + /* clip: rect(1px, 1px, 1px, 1px); */ +} + +.switch_label { + cursor: pointer; + display: flex; + + position: absolute; + right: 3em; + top: 4em; + z-index: 1; + + width: 1em; + height: 1em; +} + +.switch_label::before { + content: var(--switch_icon); + font-size: 30px; + transition: text-shadow .2s; +} + +.switch_label::after { + align-self: center; + color: var(--theme_fg0); + font-size: 28px; + line-height: 40px; + opacity: 0; + padding-left: 15px; + transition: opacity .2s; +} + +.theme_switch:focus ~ main .switch_label::before, +.switch_label:hover::before { + text-shadow: 0 0 15px var(--theme_fg0); +} + +.theme_switch:focus ~ main .switch_label::after, +.switch_label:hover::after { + opacity: 1; +} diff --git a/css/index.css b/css/index.css @@ -0,0 +1,280 @@ +input, textarea, button, select, a { + --webkit-tap-highlight-color: rgba(0,0,0,0); +} + +html, body { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; +} + +hr { + color: var(--theme_fgt0_hard); + width: 100%; +} + +footer { max-width: 1200px ; } + +main { + display: flex; + justify-content: center; + align-items: center; + + background-color: var(--theme_bg0); + color: var(--theme_fg0); + + font-family: monospace; + /* font-size: 1.5em; */ +} + +p { + text-overflow: ellipsis; + overflow: hidden; + max-width: 80vw; +} + +img { + width: 100%; + height: 100%; +} + +.content { + position: relative; + display: flex; + flex-direction: column; + box-sizing: border-box; + max-width: 900px ; + min-height: 100vh ; + padding: 1em; + width: 100%; + height: 100%; +} + +pre, code +{ + background-color: var(--theme_bg1); + color: var(--theme_fg1); + white-space: pre-wrap; + white-space: -moz-pre-wrap !important; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + +pre +{ + padding: 0.5em; + border-radius: 5px; + border: 1px solid var(--theme_fg4); + margin-left: 0.5em; + margin-right: 0.5em; +} + +a { + color:var(--theme_blue); + text-decoration: none; +} + +table +{ + border-collapse: collapse; + border-spacing: 0; /* IE 6 */ + + border-bottom: 2pt solid var(--theme_bg3); + border-top: 2pt solid var(--theme_bg3); /* The caption on top will not have a bottom-border */ + background-color: var(--theme_bg1); /* Does this BG print well? */ + + /* Center */ + margin-left: auto; + margin-right: auto; +} + +thead /* Entire table header */ +{ + border-bottom: 1pt solid var(--theme_bg3); + background-color: var(--theme_bg2); /* Does this BG print well? */ +} + +tr.header /* Each header row */ +{ +} + +tbody /* Entire table body */ +{ +} + +/* Table body rows */ + +tr { +} +tr.odd:hover, tr.even:hover /* Use .odd and .even classes to avoid styling rows in other tables */ +{ + background-color: var(--theme_bg0); +} + +/* Odd and even rows */ +tr.odd {} +tr.even {} + +td, th /* Table cells and table header cells */ +{ + vertical-align: top; /* Word */ + vertical-align: baseline; /* Others */ + padding-left: 0.5em; + padding-right: 0.5em; + padding-top: 0.2em; + padding-bottom: 0.2em; +} + + +th /* Table header cells */ +{ + font-weight: bold; +} + +tfoot /* Table footer (what appears here if caption is on top?) */ +{ +} + +caption /* This is for a table caption tag, not the p.caption Pandoc uses in a div.figure */ +{ + caption-side: top; + border: none; + font-size: 0.9em; + font-style: italic; + text-align: center; + margin-bottom: 0.3em; /* Good for when on top */ + padding-bottom: 0.2em; +} + + + +pre,blockquote{ + page-break-inside:avoid; +} + +blockquote{ + padding:10px 20px; + margin:0 0 1em; + font-size: 0.9em; + border-left:5px solid var(--theme_fg4); +} + +blockquote p:last-child{ + margin-bottom:0; +} + +blockquote:before, +blockquote:after { + content:""; +} + + +li +{ + margin-top: 1em; /* IE: lack of space above a <li> when the item is inside a <p> */ +} + +:not(blockquote) > p, +ol, +ul { + margin-left: 1em; +} + +.categories{ + display: flex; + align-items: center +} + +.categories h3{ + display: inline-block; +} + +.categories p { + flex: 1; + margin: 0.5em; + display: flex; + flex-direction: row; + flex-flow: wrap; + +} + +.categories a{ + color: var(--theme_orange); + background-color: var(--theme_bg1); + display: inline-block; + padding: 0.2em 0.5em 0.2em 0.5em; + border-radius: 5px; + min-width: 2em; + text-align: center; + margin: 0.15em; +} + +nav { + display: flex; + justify-content: space-between; + /* padding-right: 40px; */ +} + +.bottom { + margin-top: auto; +} + +.index { + padding: 0; +} + +.index li { + display: flex; +} + +.index li div:first-child { + flex-shrink: 0; + margin-right: 0.5em; +} + + + + +.small { + display: flex; + align-items: center; +} + +.small img { + width: 20px; + height: 20px; + margin: 5px; +} + +img { + width: 10em; + height: 10em; + margin: 5px; +} + +h1 { + color: var(--theme_aqua); +} + +h2 { + color: var(--theme_purple); +} + +h4 { + color: var(--theme_yellow); +} + +h6 { + color: var(--theme_gray); +} + +h3 { + color: var(--theme_orange); +} + +h5 { + color: var(--theme_green); +} diff --git a/img/android-chrome-192x192.png b/img/android-chrome-192x192.png Binary files differ. diff --git a/img/android-chrome-512x512.png b/img/android-chrome-512x512.png Binary files differ. diff --git a/img/apple-touch-icon.png b/img/apple-touch-icon.png Binary files differ. diff --git a/img/btc-qr.png b/img/btc-qr.png Binary files differ. diff --git a/img/btc.png b/img/btc.png Binary files differ. diff --git a/img/favicon-16x16.png b/img/favicon-16x16.png Binary files differ. diff --git a/img/favicon-32x32.png b/img/favicon-32x32.png Binary files differ. diff --git a/img/favicon.ico b/img/favicon.ico Binary files differ. diff --git a/img/xmr-qr.png b/img/xmr-qr.png Binary files differ. diff --git a/img/xmr.png b/img/xmr.png Binary files differ. diff --git a/index.html b/index.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<title>Dimitrije Dobrota's Cabin</title> +<meta charset="UTF-8" /> +<meta name="viewport" content="width=device-width,initial-scale=1"/> +<meta name="description" content="Dimitrije Dobrota's personal site. You can find my daily findings in a form of articles on my blog as well as various programming projects." /> +<link rel="stylesheet" type="text/css" href="/css/index.css" /> +<link rel="stylesheet" type="text/css" href="/css/colors.css" /> +<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> +<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png"> +</head> +<body> +<input type="checkbox" id="theme_switch" class="theme_switch"> +<main> +<div class="content"> +<label for="theme_switch" class="switch_label"></label> +<h1>Dimitrije Dobrota</h1> +<h4>Freshman of Electrical and Computer Engineering and Linux enthusiast</h4> +<h2>On this webpage…</h2> +<h3>Articles</h3> +<p>I try to document my daily findings and the things I find interesting in my <a href="./blog/">blog</a></p> +<p>You can subscribe to my <a href="https://dimitrijedobrota.com/blog/rss.xml">RSS feed</a> or <a href="https://dimitrijedobrota.com/blog/index.atom">Atom feed</a> for updates</p> +<h3>Highlighed projects</h3> +<ul> +<li><a href="https://git.dimitrijedobrota.com/cabin/log.html">Cabin</a>: Source code for this website</li> +<li><a href="https://git.dimitrijedobrota.com/stagit/log.html">Stagit</a>: Static git page generator</li> +<li><a href="https://git.dimitrijedobrota.com/stamd/log.html">Stamd</a>: Static markdown page generator</li> +<li><a href="https://git.dimitrijedobrota.com/GameOfLife/log.html">Game of Life</a>: Implementation of Conway's Game of Life for terminal written in C</li> +</ul> +<p>All of my projects can be found in my <a href="https://git.dimitrijedobrota.com">repos</a> or on <a href="https://github.com/DimitrijeDobrota">Github</a></p> +<h3>Contact</h3> +<p>For any questions feel free to <a href="mailto:mail@dimitrijedobrota.com">email me</a></p> +</div> +</main> +<script src="/scripts/main.js"></script> +</body> +</html> diff --git a/robots.txt b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: https://www.dimitrijedobrota.com/sitemap.xml diff --git a/scripts/main.js b/scripts/main.js @@ -0,0 +1,19 @@ +// This code is only used to remember theme selection +const themeSwitch = document.querySelector('.theme_switch'); +themeSwitch.checked = localStorage.getItem('switchedTheme') === 'true'; + +themeSwitch.addEventListener('change', function (e) { + if(e.currentTarget.checked === true) { + // Add item to localstorage + localStorage.setItem('switchedTheme', 'true'); + } else { + // Remove item if theme is switched back to normal + localStorage.removeItem('switchedTheme'); + } +}); + +document.querySelectorAll(".back").forEach((element, key) => { + element.addEventListener('click', function(event){ + history.go(-1); + }) +}) diff --git a/sitemap.xml b/sitemap.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + <url> + <loc>https://dimitrijedobrota.com/</loc> + <changefreq>weekly</changefreq> + </url> + <url> + <loc>https://dimitrijedobrota.com/articles</loc> + <changefreq>daily</changefreq> + </url> + <url> + <loc>https://git.dimitrijedobrota.com/</loc> + <changefreq>daily</changefreq> + </url> +</urlset>