mirror of
https://github.com/skidoodle/albert.lol.git
synced 2026-04-28 19:27:40 +02:00
astro
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<span id="nowplaying"></span>
|
||||
|
||||
<script>
|
||||
import { SpotifyClient } from '../scripts/spotify.js';
|
||||
const spotifyClient = new SpotifyClient("wss://ws.albert.lol", "nowplaying");
|
||||
spotifyClient.start();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#nowplaying {
|
||||
display: block;
|
||||
margin: 5px 0 5px var(--spacing-md);
|
||||
font-size: 1rem;
|
||||
line-height: 1;
|
||||
height: 2em;
|
||||
max-width: 90%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,96 @@
|
||||
---
|
||||
const projects = [
|
||||
{ name: "spotify-ws", url: "https://github.com/skidoodle/spotify-ws", desc: "Gets now-playing-song from Spotify with WebSockets." },
|
||||
{ name: "ipinfo", url: "https://github.com/skidoodle/ipinfo", desc: "Shows details about any IP address or ASN." },
|
||||
{ name: "hostinfo", url: "https://github.com/skidoodle/hostinfo", desc: "Browser extension showing website origin details." },
|
||||
{ name: "albert.lol", url: "https://github.com/skidoodle/albert.lol", desc: "You're looking at it, built with Astro." },
|
||||
{ name: "budgetable", url: "https://github.com/skidoodle/budgetable", desc: "Tracks items to buy later." },
|
||||
{ name: "erettsegi-browser", url: "https://github.com/skidoodle/erettsegi-browser", desc: "Finds previous Hungarian graduation exams." },
|
||||
{ name: "ncore-stats", url: "https://github.com/skidoodle/ncore-stats", desc: "Tracks profile activity on nCore." },
|
||||
{ name: "ncore-leaderboard", url: "https://github.com/skidoodle/ncore-leaderboard", desc: "Scrapes and sorts profiles from nCore." },
|
||||
{ name: "iphistory", url: "https://github.com/skidoodle/iphistory", desc: "Monitors and records public IP address history." },
|
||||
];
|
||||
---
|
||||
|
||||
<section class="projects">
|
||||
<details>
|
||||
<summary>~/projects</summary>
|
||||
<div>
|
||||
<dl>
|
||||
{projects.map((project) => (
|
||||
<>
|
||||
<dt>
|
||||
<a href={project.url} target="_blank" rel="noopener noreferrer">
|
||||
{project.name}
|
||||
</a>
|
||||
</dt>
|
||||
<dd set:html={project.desc} />
|
||||
</>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--hover-color);
|
||||
}
|
||||
|
||||
dt {
|
||||
color: var(--primary-color);
|
||||
font-weight: bold;
|
||||
font-size: 1.17em;
|
||||
margin-inline-start: var(--spacing-md);
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
dt:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-inline-start: var(--spacing-lg);
|
||||
}
|
||||
|
||||
details {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
}
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: var(--primary-color);
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
margin-block: 1.5rem 0.5rem;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
summary::after {
|
||||
content: ' ▼';
|
||||
font-size: 0.6em;
|
||||
opacity: 0.7;
|
||||
margin-inline-start: 0.3rem;
|
||||
}
|
||||
|
||||
details[open] > summary::after {
|
||||
content: ' ▲';
|
||||
}
|
||||
|
||||
details > div {
|
||||
margin-top: 1rem;
|
||||
margin-inline-start: var(--spacing-md);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,128 @@
|
||||
<section class="setup">
|
||||
<details>
|
||||
<summary>~/setup</summary>
|
||||
<div>
|
||||
<dl>
|
||||
<dt>PC</dt>
|
||||
<dd><b>OS:</b> Windows 11 Pro</dd>
|
||||
<dd><b>CPU:</b> Ryzen 5 5600X</dd>
|
||||
<dd><b>GPU:</b> RX 6700</dd>
|
||||
<dd><b>RAM:</b> 48 GB</dd>
|
||||
<dd>
|
||||
<div class="storage-layout">
|
||||
<p><b>Storage:</b></p>
|
||||
<div class="storage-items">
|
||||
<p>Samsung 990 Pro 1TB</p>
|
||||
<p>Crucial P1 1TB</p>
|
||||
<p>Seagate Barracuda 2TB</p>
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
|
||||
<dt>Server</dt>
|
||||
<dd><b>OS:</b> Proxmox VE</dd>
|
||||
<dd><b>CPU:</b> Dual Xeon E5-2680 v4</dd>
|
||||
<dd><b>RAM:</b> 128 GB</dd>
|
||||
<dd>
|
||||
<div class="storage-layout">
|
||||
<p><b>Storage:</b></p>
|
||||
<div class="storage-items">
|
||||
<p>2x WD Black SN770 1TB (MIRROR)</p>
|
||||
<p>8x Toshiba Enterprise 6TB (RAID-Z2)</p>
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
|
||||
<dt>Laptop</dt>
|
||||
<dd><b>OS:</b> Windows 11 Pro</dd>
|
||||
<dd><b>CPU:</b> Ryzen 5 7520U</dd>
|
||||
<dd><b>GPU:</b> Radeon 610M</dd>
|
||||
<dd><b>RAM:</b> 16 GB</dd>
|
||||
<dd><b>Storage:</b> Samsung 480GB</dd>
|
||||
|
||||
<dt>Test</dt>
|
||||
<dd><b>CPU:</b> Ryzen 3 1300X</dd>
|
||||
<dd><b>RAM:</b> 32 GB</dd>
|
||||
<dd><b>Storage:</b> Samsung 970 EVO Plus 250GB</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--hover-color);
|
||||
}
|
||||
|
||||
dt {
|
||||
color: var(--primary-color);
|
||||
font-weight: bold;
|
||||
font-size: 1.17em;
|
||||
margin-inline-start: var(--spacing-md);
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
dt:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-inline-start: var(--spacing-lg);
|
||||
}
|
||||
|
||||
details {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
}
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: var(--primary-color);
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
margin-block: 1.5rem 0.5rem;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
summary::after {
|
||||
content: ' ▼';
|
||||
font-size: 0.6em;
|
||||
opacity: 0.7;
|
||||
margin-inline-start: 0.3rem;
|
||||
}
|
||||
|
||||
details[open] > summary::after {
|
||||
content: ' ▲';
|
||||
}
|
||||
|
||||
details > div {
|
||||
margin-top: 1rem;
|
||||
margin-inline-start: var(--spacing-md);
|
||||
}
|
||||
|
||||
.storage-layout {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.storage-layout p,
|
||||
.storage-items p {
|
||||
margin-inline-start: 0;
|
||||
}
|
||||
|
||||
.storage-items {
|
||||
margin-inline-start: 1ch;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<section class="socials">
|
||||
<h2>~/socials</h2>
|
||||
<nav>
|
||||
<a href="https://github.com/skidoodle" target="_blank" rel="noopener noreferrer" aria-label="GitHub">
|
||||
<img src="/static/icons/github.svg" alt="GitHub Profile">
|
||||
</a>
|
||||
<a href="https://steamcommunity.com/id/_albert" target="_blank" rel="noopener noreferrer" aria-label="Steam">
|
||||
<img src="/static/icons/steam.svg" alt="Steam Profile">
|
||||
</a>
|
||||
<a href="mailto:contact@albert.lol" aria-label="Email">
|
||||
<img src="/static/icons/mail.svg" alt="Email Contact">
|
||||
</a>
|
||||
<a href="https://discord.com/users/637745537369767936" target="_blank" rel="noopener noreferrer" aria-label="Discord">
|
||||
<img src="/static/icons/discord.svg" alt="Discord Profile">
|
||||
</a>
|
||||
</nav>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.socials nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
margin-inline-start: var(--spacing-md);
|
||||
}
|
||||
|
||||
.socials a {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0.3em;
|
||||
border-radius: 50%;
|
||||
transition: opacity 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.socials a:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.socials img {
|
||||
display: block;
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
filter: brightness(0) saturate(100%) invert(1);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
const birthDate = new Date('2004-07-22');
|
||||
const today = new Date();
|
||||
const age = Math.floor((today.getTime() - birthDate.getTime()) / 31557600000);
|
||||
---
|
||||
|
||||
<section class="whoami">
|
||||
<h2>~/whoami</h2>
|
||||
<p>I'm a <span id="age">{age}</span>-year-old developer and tech enthusiast. I enjoy working on my homelab and coding in TypeScript and Go.</p>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.whoami p {
|
||||
margin-inline-start: var(--spacing-md);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const { title, description } = Astro.props;
|
||||
|
||||
const schema = JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Person",
|
||||
"name": "Albert",
|
||||
"alternateName": "skidoodle",
|
||||
"url": "https://albert.lol/",
|
||||
"image": "https://albert.lol/static/preview.png",
|
||||
"jobTitle": "Developer and Tech Enthusiast",
|
||||
"description": "21-year-old developer and tech enthusiast. I enjoy working on my homelab and coding in TypeScript and Go.",
|
||||
"knowsAbout": ["Web Development", "TypeScript", "Go", "Homelab", "Linux", "Open Source Projects"],
|
||||
"sameAs": [
|
||||
"https://github.com/skidoodle",
|
||||
"https://steamcommunity.com/id/_albert",
|
||||
"https://discord.com/users/637745537369767936"
|
||||
],
|
||||
"worksFor": {
|
||||
"@type": "Organization",
|
||||
"name": "Personal Projects / Open Source"
|
||||
}
|
||||
});
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{title}</title>
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<meta name="theme-color" content="#bb86fc">
|
||||
<meta name="description" content={description}>
|
||||
|
||||
<meta property="og:title" content={title}>
|
||||
<meta property="og:description" content={description}>
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://albert.lol/">
|
||||
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content={title}>
|
||||
<meta name="twitter:description" content={description}>
|
||||
|
||||
<link rel="preload" href="/static/fonts/jetbrains.woff2" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
<script is:inline defer src="https://analytics.albert.lol/script.js" data-website-id="2c900d5e-c577-4824-ad37-0cdf68383c42"></script>
|
||||
<script is:inline type="application/ld+json" set:html={schema} />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
import Layout from '../layouts/layout.astro';
|
||||
import Nowplaying from '../components/nowplaying.astro';
|
||||
import Whoami from '../components/whoami.astro';
|
||||
import Socials from '../components/socials.astro';
|
||||
import Projects from '../components/projects.astro';
|
||||
import Setup from '../components/setup.astro';
|
||||
|
||||
const title = "albert";
|
||||
const description = "A 21-year-old developer and tech enthusiast. I enjoy working on my homelab and coding in TypeScript and Go.";
|
||||
---
|
||||
|
||||
<Layout title={title} description={description}>
|
||||
<h1>[{title}]</h1>
|
||||
<Nowplaying />
|
||||
<hr>
|
||||
<Whoami />
|
||||
<Socials />
|
||||
<Projects />
|
||||
<Setup />
|
||||
</Layout>
|
||||
@@ -0,0 +1,80 @@
|
||||
export class SpotifyClient {
|
||||
constructor(url, elementId) {
|
||||
this.url = url;
|
||||
this.elementId = elementId;
|
||||
this.element = document.getElementById(this.elementId);
|
||||
|
||||
this.ws = null;
|
||||
this.reconnectTimeout = null;
|
||||
this.reconnectAttempts = 0;
|
||||
|
||||
this.RECONNECT_BASE_DELAY = 1000;
|
||||
this.RECONNECT_MAX_DELAY = 30000;
|
||||
}
|
||||
|
||||
start() {
|
||||
if (!this.element) {
|
||||
console.error(`Spotify-WS: Element with ID "${this.elementId}" not found.`);
|
||||
return;
|
||||
}
|
||||
this.connect();
|
||||
}
|
||||
|
||||
connect() {
|
||||
if (this.ws) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Spotify-WS: Connecting...");
|
||||
this.ws = new WebSocket(this.url);
|
||||
|
||||
this.ws.onopen = () => {
|
||||
console.log("Spotify-WS: Connection established.");
|
||||
this.reconnectAttempts = 0;
|
||||
};
|
||||
|
||||
this.ws.onmessage = (event) => {
|
||||
this.updateDOM(event.data);
|
||||
};
|
||||
|
||||
this.ws.onclose = (event) => {
|
||||
if (!event.wasClean) {
|
||||
console.warn("Spotify-WS: Connection closed unexpectedly. Attempting to reconnect...");
|
||||
this.reconnect();
|
||||
} else {
|
||||
console.log("Spotify-WS: Connection closed cleanly.");
|
||||
}
|
||||
this.ws = null;
|
||||
};
|
||||
|
||||
this.ws.onerror = (error) => {
|
||||
console.error("Spotify-WS: An error occurred:", error);
|
||||
};
|
||||
}
|
||||
|
||||
reconnect() {
|
||||
const delay = Math.min(
|
||||
this.RECONNECT_MAX_DELAY,
|
||||
this.RECONNECT_BASE_DELAY * Math.pow(2, this.reconnectAttempts)
|
||||
) * (0.8 + Math.random() * 0.4);
|
||||
|
||||
console.log(`Spotify-WS: Reconnecting in ${Math.round(delay / 1000)}s...`);
|
||||
|
||||
this.reconnectAttempts++;
|
||||
this.reconnectTimeout = setTimeout(() => this.connect(), delay);
|
||||
}
|
||||
|
||||
updateDOM(data) {
|
||||
try {
|
||||
const payload = JSON.parse(data);
|
||||
if (payload.is_playing && payload.item) {
|
||||
const artists = payload.item.artists.map(a => a.name).join(", ");
|
||||
this.element.textContent = `${payload.item.name} - ${artists}`;
|
||||
} else {
|
||||
this.element.textContent = "";
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Spotify-WS: Failed to parse message data.", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 100 800;
|
||||
font-display: swap;
|
||||
src: url('/static/fonts/jetbrains.woff2') format('woff2');
|
||||
}
|
||||
|
||||
:root {
|
||||
--background-color: #121212;
|
||||
--text-color: #e0e0e0;
|
||||
--primary-color: #bb86fc;
|
||||
--hover-color: #52f0ae;
|
||||
--focus-shadow-color: #bb86fc;
|
||||
--spacing-md: 15px;
|
||||
--spacing-lg: 25px;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: var(--background-color);
|
||||
color: var(--text-color);
|
||||
scrollbar-gutter: stable;
|
||||
scrollbar-color: var(--primary-color) var(--background-color);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 25px;
|
||||
line-height: 1.6;
|
||||
padding: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
main {
|
||||
max-width: 800px;
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--primary-color);
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.3em;
|
||||
margin-block: 1.5rem 0.5rem;
|
||||
}
|
||||
|
||||
a:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px var(--focus-shadow-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 4px solid var(--primary-color);
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
padding: 1rem;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user