Files
hexstudios-co/index.html
2026-08-13 18:54:39 -05:00

90 lines
3.2 KiB
HTML

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hex Studios</title>
<script>
(function() {
var stored = localStorage.getItem('theme');
if (stored === 'light') document.documentElement.setAttribute('data-theme', 'light');
})();
function toggleTheme() {
var isLight = document.documentElement.getAttribute('data-theme') === 'light';
if (isLight) {
document.documentElement.removeAttribute('data-theme');
localStorage.setItem('theme', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
</script>
<link rel="stylesheet" href="styles/main.css">
</head>
<body>
<button id="theme-toggle" onclick="toggleTheme()">toggle light/dark</button>
<h1>// Hex Studios</h1>
<i>Developer, biker, musician, engineer, and an unapologetic centrist in the deep red south. The real @hexstudios.</i>
<div id="links-section">
<h2>Links</h2>
<ul>
<li><a href="https://git.bellsworne.tech/">Git repos</a></li>
<li><a href="https://youtube.com/c/hexstudios">YouTube</a></li>
<li><a href="https://bellsworne.com">My company - Bellsworne</a></li>
<li><a href="https://git.bellsworne.tech/chrisbell/hexstudios-co">Page source code (git)</a></li>
</ul>
</div>
<div id="sticky-posts-section">
<h2>Pinned posts</h2>
<ul>
<li><a href="post.html?file=about.md">About <i class="post-link-date">August 13, 2026</i></a></li>
<li><a href="post.html?file=projects.md">Projects <i class="post-link-date">August 13, 2026</i></a></li>
</ul>
</div>
<div id="posts-section">
<h2>Posts</h2>
<ul id="posts-list"></ul>
</div>
<script>
async function loadPosts() {
const list = document.getElementById('posts-list');
try {
const res = await fetch('posts/list.php');
const posts = await res.json();
if (!posts.length) {
list.innerHTML = '<li>No posts yet.</li>';
return;
}
posts.forEach(post => {
const li = document.createElement('li');
const a = document.createElement('a');
const i = document.createElement('i');
a.textContent = post.title;
i.textContent = post.date;
a.href = post.type === 'html'
? 'posts/' + post.file
: 'post.html?file=' + encodeURIComponent(post.file);
li.appendChild(a);
a.appendChild(i);
i.classList.add("post-link-date");
list.appendChild(li);
});
} catch (err) {
list.innerHTML = '<li>Couldn\u2019t load posts.</li>';
}
}
document.addEventListener('DOMContentLoaded', loadPosts);
</script>
</body>
</html>