From 993dcb9d5c46d3dad0a9542dee82f40c2f852991 Mon Sep 17 00:00:00 2001 From: Lukas Wurzinger Date: Mon, 30 Dec 2024 12:55:54 +0100 Subject: [PATCH] init --- .envrc | 3 + .gitignore | 8 + devenv.lock | 116 ++++++++++++ devenv.nix | 42 +++++ devenv.yaml | 4 + league-spartan.nix | 21 +++ public/index.html | 42 +++++ public/static/assets/favicon.svg | 61 ++++++ public/static/assets/logo.svg | 49 +++++ public/static/style.css | 313 +++++++++++++++++++++++++++++++ 10 files changed, 659 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml create mode 100644 league-spartan.nix create mode 100644 public/index.html create mode 100644 public/static/assets/favicon.svg create mode 100644 public/static/assets/logo.svg create mode 100644 public/static/style.css diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..894571b --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" + +use devenv diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b48bed9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/public/static/fonts/ + +.devenv* +devenv.local.nix + +.direnv/ + +.pre-commit-config.yaml diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..8ab1706 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,116 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1733788855, + "owner": "cachix", + "repo": "devenv", + "rev": "d59fee8696cd48f69cf79f65992269df9891ba86", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733477122, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1733730953, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7109b680d161993918b0a126f38bc39763e5a709", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1733665616, + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "d8c02f0ffef0ef39f6063731fc539d8c71eb463a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..a579149 --- /dev/null +++ b/devenv.nix @@ -0,0 +1,42 @@ +{pkgs, ...}: { + packages = [ + pkgs.miniserve + pkgs.rsync + ]; + + processes.miniserve.exec = '' + miniserve public --port 8080 --index index.html + ''; + + scripts = { + publish.exec = '' + rsync \ + --recursive \ + --delete \ + --update \ + --mkpath \ + --verbose --verbose \ + public/ lukas@wrz.one:/var/www/wrz.one + ''; + + getfonts.exec = let + league-spartan = pkgs.callPackage ./league-spartan.nix {}; + in '' + rsync \ + --recursive \ + --delete \ + --update \ + --mkpath \ + --verbose --verbose \ + --include='*/' --include='*.woff2' --exclude='*' \ + ${league-spartan}/share/fonts/woff2/ public/static/fonts/league-spartan + ''; + }; + + pre-commit.hooks = { + # Nix + alejandra.enable = true; + deadnix.enable = true; + statix.enable = true; + }; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..68616a4 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,4 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling diff --git a/league-spartan.nix b/league-spartan.nix new file mode 100644 index 0000000..f0f95a1 --- /dev/null +++ b/league-spartan.nix @@ -0,0 +1,21 @@ +{ + fetchzip, + stdenvNoCC, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "league-spartan"; + version = "2.220"; + + src = fetchzip { + url = "https://github.com/theleagueof/league-spartan/releases/download/${finalAttrs.version}/LeagueSpartan-${finalAttrs.version}.tar.xz"; + hash = "sha256-dkvWRYli8vk+E0DkZ2NWCJKfSfdo4jEcGo0puQpFVVc="; + }; + + installPhase = '' + runHook preInstall + + install -D -m444 -t $out/share/fonts/woff2 $src/static/WOFF2/*.woff2 + + runHook postInstall + ''; +}) diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..c82fc60 --- /dev/null +++ b/public/index.html @@ -0,0 +1,42 @@ + + + + + + wrz.one + + + + + + +
+ +
+ +
+ + + + + + + + Visit log.wrz.one + +
+ + + \ No newline at end of file diff --git a/public/static/assets/favicon.svg b/public/static/assets/favicon.svg new file mode 100644 index 0000000..bf2cc37 --- /dev/null +++ b/public/static/assets/favicon.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + diff --git a/public/static/assets/logo.svg b/public/static/assets/logo.svg new file mode 100644 index 0000000..e0cf6f3 --- /dev/null +++ b/public/static/assets/logo.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + diff --git a/public/static/style.css b/public/static/style.css new file mode 100644 index 0000000..2c90259 --- /dev/null +++ b/public/static/style.css @@ -0,0 +1,313 @@ +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-ExtraLight.woff2') format('woff2'); + font-weight: 200; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-Light.woff2') format('woff2'); + font-weight: 300; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-Medium.woff2') format('woff2'); + font-weight: 400; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-Regular.woff2') format('woff2'); + font-weight: 500; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-SemiBold.woff2') format('woff2'); + font-weight: 600; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-Bold.woff2') format('woff2'); + font-weight: 700; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-ExtraBold.woff2') format('woff2'); + font-weight: 800; +} + +@font-face { + font-family: League Spartan; + src: url('/static/fonts/league-spartan/LeagueSpartan-Black.woff2') format('woff2'); + font-weight: 900; +} + +@media screen { + body { + margin: 0; + } + + @media (prefers-color-scheme: dark) { + * { + color: #e8e8e8; + } + + body { + background-color: #0b0c0d; + } + + header { + border-bottom-color: #b83a33; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + color: white; + } + + a { + color: white; + transition: color .1s ease-in-out; + } + + a:hover { + color: #b83a33; + transition: color .2s ease-in-out; + } + + img.logo { + --c: #dedede; + } + + nav#menu ul li:not(:first-child) { + border-left: 1px solid #1f1f1f; + } + + nav#menu ul li:not(:last-child) { + border-right: 1px solid #1f1f1f; + } + + a.external { + border-color: #1f1f1f; + box-shadow: 0px 5px 10px 2px #000000a0; + } + + a.external:hover { + border-color: #1f1f1f; + box-shadow: 0px 5px 15px 4px #000000c0; + background-color: #e8e8e840; + } + + a.external:active { + border-color: #1f1f1f; + box-shadow: 0px 5px 20px 2px #000000e0; + background-color: #e8e8e8a0; + } + } + + @media (prefers-color-scheme: light) { + * { + color: #252525; + } + + body { + background-color: #fffcf6; + } + + header { + border-bottom-color: #ed5c54; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + color: black; + } + + a { + color: black; + transition: color .1s ease-in-out; + } + + a:hover { + color: #c8251c; + transition: color .2s ease-in-out; + } + + img.logo { + --c: #1d1d1d; + } + + nav#menu ul li:not(:first-child) { + border-left: 1px solid #f0eade; + } + + nav#menu ul li:not(:last-child) { + border-right: 1px solid #f0eade; + } + + a.external { + border-color: #f0eade; + box-shadow: 0px 5px 10px 2px #0000000f; + } + + a.external:hover { + border-color: #bebbb4; + box-shadow: 0px 5px 15px 2px #00000040; + background-color: #615e5e40; + } + + a.external:active { + border-color: #696763; + box-shadow: 0px 5px 20px 2px #00000060; + background-color: #504e4ea0; + } + } +} + +* { + box-sizing: border-box; + font-size: 18px; +} + +body { + font-family: League Spartan, sans-serif; +} + +a:not(:hover) { + text-decoration: none; +} + +a:hover { + text-decoration-style: solid; +} + +body { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +header { + margin-top: auto; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 20px; + padding-bottom: 4vh; + border-bottom-width: 8px; + border-bottom-style: solid; +} + +main { + margin-bottom: auto; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 20px; + padding-top: 4vh; +} + +img.logo { + max-width: 90vw; + max-height: 120px; + + --t: 4px; + + padding: calc(18px + var(--t)); + + background: + conic-gradient(from 180deg at top var(--t) right var(--t), + #0000 25%, + var(--c) 0) var(--i, 200%) 0 /200% var(--i, var(--t)) no-repeat, + conic-gradient(at bottom var(--t) left var(--t), + #0000 25%, + var(--c) 0) 0 var(--i, 200%)/var(--i, var(--t)) 200% no-repeat; + transition: background .3s, background-position .3s .3s; +} + +img.logo:hover { + --i: 100%; + transition: background .3s, background-size .3s .3s; +} + +nav#menu { + display: block; + overflow-x: auto; + max-width: 100%; +} + +nav#menu ul { + display: flex; + flex-direction: row; + justify-content: stretch; + list-style-type: none; + padding: 1em; +} + +nav#menu ul li { + padding: 1em; + text-wrap: nowrap; +} + +a.external { + text-align: center; + padding: 1em; + transition: + border-color .1s ease-in-out, + background-color 1s ease-out -.1s, + box-shadow .5s ease-out -.1s; + border-width: 2px; + border-style: solid; +} + +a.external>span.external-text { + display: inline-block; + position: relative; + transition: ease .5s; + text-wrap: nowrap; +} + +a.external>span.external-text::after { + content: '\00BB'; + position: absolute; + opacity: 0; + right: -1em; + transition: ease .5s; +} + +a.external:hover>span.external-text { + padding-right: 1em; +} + +a.external:hover>span.external-text::after { + opacity: 1; + right: 0; +} + +span.email-me::before { + content: '\1F4E7'; + margin-right: .5em; +} + +span.visit-log::before { + content: '\1F4DC'; + margin-right: .5em; +} \ No newline at end of file