blog / index.html
MultivexAI's picture
Update index.html
d728d1a verified
Raw
History Blame Contribute Delete
33.1 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AtomixLabs</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--bg-color: #0c0c0e;
--card-bg: #141416;
--border-color: #222225;
--text-primary: #f4f4f5;
--text-secondary: #a1a1aa;
--accent: #6366f1;
--max-width: 760px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--bg-color);
color: var(--text-primary);
font-family: 'Inter', sans-serif;
line-height: 1.6;
padding: 0 1.5rem;
-webkit-font-smoothing: antialiased;
}
.container {
max-width: var(--max-width);
margin: 0 auto;
padding: 2rem 0 6rem 0;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 2rem 0;
margin-bottom: 4rem;
}
.logo {
font-weight: 600;
font-size: 1.1rem;
letter-spacing: -0.02em;
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
text-decoration: none;
color: var(--text-primary);
}
.logo-dot {
width: 6px;
height: 6px;
background-color: var(--accent);
border-radius: 50%;
}
.user-status {
font-size: 0.85rem;
color: var(--text-secondary);
display: flex;
align-items: center;
gap: 0.75rem;
}
.logout-btn {
background: none;
border: none;
color: var(--accent);
cursor: pointer;
font-size: 0.85rem;
text-decoration: underline;
}
.intro {
margin-bottom: 5rem;
}
.intro h1 {
font-size: 1.8rem;
font-weight: 500;
letter-spacing: -0.02em;
margin-bottom: 1rem;
line-height: 1.3;
}
.intro p {
color: var(--text-secondary);
font-size: 1rem;
font-weight: 300;
margin-bottom: 1.5rem;
}
/* View Contributors Trigger */
.view-contributors-btn {
background: none;
border: 1px solid var(--border-color);
color: var(--text-secondary);
padding: 0.5rem 1rem;
border-radius: 4px;
font-size: 0.8rem;
cursor: pointer;
transition: border-color 0.15s ease, color 0.15s ease;
font-family: inherit;
}
.view-contributors-btn:hover {
border-color: var(--accent);
color: var(--text-primary);
}
hr {
border: 0;
border-top: 1px solid var(--border-color);
margin: 3rem 0;
}
.section-title {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--text-secondary);
margin-bottom: 2rem;
}
.blog-list {
display: flex;
flex-direction: column;
gap: 2.5rem;
}
.blog-post-card {
cursor: pointer;
text-decoration: none;
color: inherit;
display: block;
}
.post-meta {
font-size: 0.8rem;
color: var(--text-secondary);
margin-bottom: 0.5rem;
}
.post-title {
font-size: 1.25rem;
font-weight: 500;
margin-bottom: 0.5rem;
letter-spacing: -0.01em;
transition: color 0.15s ease;
}
.blog-post-card:hover .post-title {
color: var(--accent);
}
.post-excerpt {
color: var(--text-secondary);
font-size: 0.95rem;
font-weight: 300;
line-height: 1.5;
}
.post-detail {
display: none;
}
.back-btn {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
font-size: 0.9rem;
margin-bottom: 3rem;
display: inline-flex;
align-items: center;
gap: 0.5rem;
font-family: inherit;
}
.back-btn:hover {
color: var(--text-primary);
}
.post-full-header {
margin-bottom: 2.5rem;
}
.post-full-title {
font-size: 2rem;
font-weight: 500;
letter-spacing: -0.02em;
margin-top: 0.5rem;
line-height: 1.3;
}
.post-full-content {
font-size: 1.05rem;
font-weight: 300;
color: #d4d4d8;
line-height: 1.75;
margin-bottom: 4rem;
}
.post-full-content p {
margin-bottom: 1.5rem;
}
/* Comments Styling */
.comments-section {
border-top: 1px solid var(--border-color);
padding-top: 3rem;
}
.comments-title {
font-size: 1.1rem;
font-weight: 500;
margin-bottom: 1.5rem;
}
.comments-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
margin-bottom: 2.5rem;
}
.comment-card {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 1.25rem;
}
.comment-header {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.8rem;
margin-bottom: 0.50rem;
}
.comment-author {
font-weight: 500;
color: var(--text-primary);
}
.comment-date {
color: var(--text-secondary);
}
.comment-body {
font-size: 0.95rem;
color: #d4d4d8;
font-weight: 300;
white-space: pre-line;
}
/* Edit and Delete action controls */
.comment-actions {
display: flex;
gap: 0.75rem;
margin-top: 0.75rem;
font-size: 0.75rem;
border-top: 1px dashed #1e1e21;
padding-top: 0.5rem;
}
.action-link {
color: var(--text-secondary);
cursor: pointer;
user-select: none;
}
.action-link:hover {
color: var(--accent);
}
.delete-link:hover {
color: #f87171;
}
/* Inline editor styling */
.edit-area {
width: 100%;
background-color: #1a1a1e;
border: 1px solid var(--border-color);
color: var(--text-primary);
padding: 0.75rem;
border-radius: 4px;
font-family: inherit;
font-size: 0.9rem;
resize: vertical;
margin-top: 0.5rem;
}
.edit-area:focus {
outline: none;
border-color: var(--accent);
}
/* Edited Tag & history log layout */
.edited-label {
color: var(--accent);
font-size: 0.75rem;
cursor: pointer;
margin-left: 0.35rem;
text-decoration: underline;
text-underline-offset: 2px;
font-weight: 500;
}
.history-drawer {
display: none;
background-color: #0b0b0c;
border-left: 2px solid var(--accent);
padding: 0.75rem 1rem;
margin-top: 0.75rem;
font-size: 0.8rem;
color: var(--text-secondary);
border-radius: 0 4px 4px 0;
}
.history-item {
border-bottom: 1px dashed var(--border-color);
padding: 0.5rem 0;
}
.history-item:last-child {
border-bottom: none;
}
/* Notice Box */
.contributor-notice {
background-color: #101012;
border: 1px dashed var(--border-color);
border-radius: 6px;
padding: 1.25rem;
margin-bottom: 2rem;
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.5;
}
.contributor-notice p {
margin-bottom: 0.5rem;
}
.contributor-notice-heading {
color: var(--text-primary);
font-weight: 500;
margin-bottom: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.notice-icon {
color: var(--accent);
font-weight: bold;
}
.comment-form-container {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 1.5rem;
}
.comment-textarea {
background-color: #1a1a1e;
border: 1px solid var(--border-color);
color: var(--text-primary);
padding: 0.75rem;
border-radius: 4px;
font-family: inherit;
font-size: 0.9rem;
width: 100%;
height: 80px;
resize: none;
margin-bottom: 1rem;
}
.comment-textarea:focus {
outline: none;
border-color: var(--accent);
}
.btn {
background-color: var(--accent);
color: #ffffff;
border: none;
padding: 0.6rem 1.2rem;
border-radius: 4px;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: background-color 0.15s ease;
text-decoration: none;
display: inline-block;
}
.btn:hover {
background-color: #4f46e5;
}
.login-prompt-text {
color: var(--text-secondary);
font-size: 0.9rem;
text-align: center;
}
.login-link {
color: var(--accent);
text-decoration: underline;
}
/* Minimalist Modal overlay */
.modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(5, 5, 6, 0.85);
z-index: 1000;
justify-content: center;
align-items: center;
backdrop-filter: blur(5px);
padding: 1.5rem;
}
.modal-content {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
width: 100%;
max-width: 540px;
max-height: 85vh;
border-radius: 8px;
padding: 1.75rem;
overflow-y: auto;
position: relative;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
border-bottom: 1px solid var(--border-color);
padding-bottom: 0.75rem;
}
.modal-header h2 {
font-size: 1.15rem;
font-weight: 500;
letter-spacing: -0.01em;
}
.close-modal-btn {
font-size: 1.4rem;
color: var(--text-secondary);
cursor: pointer;
line-height: 1;
user-select: none;
}
.close-modal-btn:hover {
color: var(--text-primary);
}
/* Contributors Grid view */
.contributors-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
gap: 1.25rem;
}
.contributor-card {
display: flex;
flex-direction: column;
align-items: center;
background-color: #0c0c0e;
border: 1px solid var(--border-color);
padding: 1.25rem 0.5rem;
border-radius: 6px;
text-decoration: none;
color: inherit;
transition: border-color 0.15s ease, transform 0.15s ease;
}
.contributor-card:hover {
border-color: var(--accent);
transform: translateY(-2px);
}
.contributor-avatar {
width: 56px;
height: 56px;
border-radius: 50%;
object-fit: cover;
border: 2px solid var(--border-color);
background-color: var(--card-bg);
margin-bottom: 0.75rem;
}
.contributor-fullname {
font-weight: 500;
font-size: 0.8rem;
text-align: center;
color: var(--text-primary);
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.contributor-username {
font-weight: 300;
font-size: 0.7rem;
color: var(--text-secondary);
text-align: center;
margin-top: 0.1rem;
}
footer {
margin-top: 8rem;
padding-top: 2rem;
border-top: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
color: var(--text-secondary);
font-size: 0.8rem;
}
.active-view {
display: block !important;
}
.hidden-view {
display: none !important;
}
</style>
</head>
<body>
<div class="container">
<header>
<a href="#" class="logo" id="logo-home">
<span class="logo-dot"></span>
AtomixLabs
</a>
<div class="user-status" id="header-user-status"></div>
</header>
<!-- Home View -->
<div id="home-view">
<section class="intro">
<h1>We are prioritizing dataset quality over massive model scale.</h1>
<p>
Progress isn’t just about feeding billions of noisy parameters into a network. We believe that smaller, carefully refined models trained on clean data will unlock the next practical breakthroughs in intelligence.
</p>
<div style="margin-top: 1.25rem;">
<button class="view-contributors-btn" onclick="openContributorsModal()">
👥 View Authorized Contributors
</button>
</div>
</section>
<hr>
<section>
<h2 class="section-title">Writing & Logs</h2>
<div class="blog-list" id="blog-list"></div>
</section>
</div>
<!-- Detail View -->
<div id="post-view" class="post-detail">
<button class="back-btn" onclick="showHome()">
← Back to overview
</button>
<article>
<div class="post-full-header">
<div class="post-meta" id="post-detail-meta"></div>
<h1 class="post-full-title" id="post-detail-title"></h1>
</div>
<div class="post-full-content" id="post-detail-body"></div>
</article>
<!-- Comments -->
<section class="comments-section">
<h3 class="comments-title">Discussion</h3>
<div class="contributor-notice">
<div class="contributor-notice-heading">
<span class="notice-icon"></span>
<span>Access Policy Notice</span>
</div>
<p>Only verified, authorized contributors can write comments on research posts. This system maintains clear communication without external noise.</p>
<p>To request to be <strong>added to</strong> or <strong>removed from</strong> the authorized contributor list, please open a <strong>Discussion</strong> thread on this Hugging Face Space page.</p>
</div>
<div class="comments-list" id="comments-list"></div>
<div class="comment-form-container" id="comment-form-container"></div>
</section>
</div>
<!-- Contributors Modal Overlay -->
<div id="contributors-modal" class="modal-overlay" onclick="closeContributorsModal(event)">
<div class="modal-content" onclick="event.stopPropagation()">
<div class="modal-header">
<h2>Authorized Contributors</h2>
<span class="close-modal-btn" onclick="closeContributorsModal()">&times;</span>
</div>
<div class="contributors-grid" id="contributors-grid">
<!-- Loaded dynamically via JS -->
</div>
</div>
</div>
<footer>
<span>© <span id="year"></span> AtomixLabs</span>
<span>Refined Intelligence</span>
</footer>
</div>
<script>
document.getElementById('year').textContent = new Date().getFullYear();
const BLOG_POSTS = [
{
id: "welcome",
date: "June 30th, 2026",
category: "General",
title: "Hello there, welcome to our first blog",
excerpt: "A brief greeting to mark the start of our digital logbook.",
content: `
<p>We're keeping things simple. This space will act as our public logbook for updates, architectural notes, and research benchmarks as we build out AtomixLabs.</p>
<p>Thanks for stopping by. More soon.</p>
`
}
];
let currentPostId = null;
let currentUser = null;
const homeView = document.getElementById('home-view');
const postView = document.getElementById('post-view');
const logoHome = document.getElementById('logo-home');
const blogListContainer = document.getElementById('blog-list');
const commentsListContainer = document.getElementById('comments-list');
const commentFormContainer = document.getElementById('comment-form-container');
const headerUserStatus = document.getElementById('header-user-status');
const contributorsGrid = document.getElementById('contributors-grid');
const contributorsModal = document.getElementById('contributors-modal');
function escapeHtml(string) {
return String(string)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
function renderBlogList() {
if (BLOG_POSTS.length === 0) {
blogListContainer.innerHTML = `<p style="color: var(--text-secondary); font-size: 0.95rem;">No posts published yet.</p>`;
return;
}
blogListContainer.innerHTML = BLOG_POSTS.map(post => `
<article class="blog-post-card" onclick="openPost('${post.id}')">
<div class="post-meta">
<span>${post.date}</span>
<span></span>
<span>${post.category}</span>
</div>
<h2 class="post-title">${post.title}</h2>
<p class="post-excerpt">${post.excerpt}</p>
</article>
`).join('');
}
async function checkLoginState() {
try {
const response = await fetch('/api/me');
currentUser = await response.json();
updateUserUI();
} catch (err) {
console.error("Failed to check auth state:", err);
}
}
function updateUserUI() {
if (currentUser && currentUser.logged_in) {
headerUserStatus.innerHTML = `
<span>Logged in as <strong>@${currentUser.username}</strong></span>
<a href="/oauth/huggingface/logout" class="logout-btn">Log out</a>
`;
} else {
headerUserStatus.innerHTML = `<span>Private Mode</span>`;
}
}
async function renderCommentsAndForm() {
if (!currentPostId) return;
try {
const response = await fetch(`/api/comments/${currentPostId}`);
const comments = await response.json();
if (comments.length === 0) {
commentsListContainer.innerHTML = `<p style="color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2rem; font-style: italic;">No thoughts here yet.</p>`;
} else {
commentsListContainer.innerHTML = comments.map(c => {
const isAuthor = currentUser && currentUser.logged_in && (currentUser.username.toLowerCase() === c.username.toLowerCase());
let historyHtml = '';
if (c.history && c.history.length > 0) {
historyHtml = `
<div id="history-${c.id}" class="history-drawer">
<div style="font-weight: 600; font-size: 0.75rem; margin-bottom: 0.5rem; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.05em;">Edit History</div>
${c.history.map((h, i) => `
<div class="history-item">
<div style="font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 0.2rem;">Revision ${i + 1} • ${h.date}</div>
<div style="font-weight: 300;">${escapeHtml(h.body)}</div>
</div>
`).join('')}
</div>
`;
}
const editedLabel = c.edited ? `<span class="edited-label" onclick="toggleHistory('${c.id}')">(edited)</span>` : '';
const actionsMenu = isAuthor ? `
<div class="comment-actions" id="actions-${c.id}">
<span class="action-link" onclick="startEdit('${c.id}', \`${escapeHtml(c.body).replace(/`/g, '\\`').replace(/\$/g, '\\$')}\`)">Edit</span>
<span class="action-link delete-link" onclick="deleteComment('${c.id}')">Delete</span>
</div>
` : '';
return `
<div class="comment-card" id="card-${c.id}">
<div class="comment-header">
<span class="comment-author">@${c.username}</span>
<span class="comment-date">${c.date}${editedLabel}</span>
</div>
<div class="comment-body" id="body-${c.id}">${escapeHtml(c.body)}</div>
${actionsMenu}
${historyHtml}
</div>
`;
}).join('');
}
} catch (err) {
console.error("Could not fetch comments:", err);
}
if (currentUser && currentUser.logged_in) {
if (currentUser.authorized) {
commentFormContainer.innerHTML = `
<p style="font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem;">
Commenting as <strong>@${currentUser.username}</strong>
</p>
<textarea class="comment-textarea" id="new-comment-text" placeholder="Write your reply..."></textarea>
<button class="btn" onclick="postComment()">Submit Comment</button>
`;
} else {
commentFormContainer.innerHTML = `
<p style="font-size: 0.9rem; color: #ef4444; text-align: center;">
Account signature Verification Failed: <strong>@${currentUser.username}</strong> is not listed in active authorization maps.
</p>
`;
}
} else {
commentFormContainer.innerHTML = `
<div class="login-prompt-text">
Authorized users can participate.
<a href="/oauth/huggingface/login" class="login-link">Sign in with Hugging Face</a>
</div>
`;
}
}
function toggleHistory(commentId) {
const drawer = document.getElementById(`history-${commentId}`);
if (drawer) {
drawer.style.display = drawer.style.display === 'block' ? 'none' : 'block';
}
}
function startEdit(commentId, currentBody) {
const bodyDiv = document.getElementById(`body-${commentId}`);
const actionsDiv = document.getElementById(`actions-${commentId}`);
actionsDiv.style.display = 'none';
bodyDiv.innerHTML = `
<textarea class="edit-area" id="textarea-${commentId}">${currentBody}</textarea>
<div style="display: flex; gap: 0.5rem; margin-top: 0.5rem;">
<button class="btn" style="padding: 0.4rem 0.8rem; font-size: 0.8rem;" onclick="saveEdit('${commentId}', \`${escapeHtml(currentBody).replace(/`/g, '\\`').replace(/\$/g, '\\$')}\`)">Save</button>
<button class="btn" style="padding: 0.4rem 0.8rem; font-size: 0.8rem; background: none; border: 1px solid var(--border-color); color: var(--text-secondary);" onclick="cancelEdit('${commentId}', \`${escapeHtml(currentBody).replace(/`/g, '\\`').replace(/\$/g, '\\$')}\`)">Cancel</button>
</div>
`;
}
function cancelEdit(commentId, originalBody) {
const bodyDiv = document.getElementById(`body-${commentId}`);
const actionsDiv = document.getElementById(`actions-${commentId}`);
bodyDiv.innerHTML = originalBody;
actionsDiv.style.display = 'flex';
}
async function saveEdit(commentId, originalBody) {
const newBody = document.getElementById(`textarea-${commentId}`).value.trim();
if (!newBody) return;
if (newBody === originalBody) {
cancelEdit(commentId, originalBody);
return;
}
try {
const response = await fetch(`/api/comments/${currentPostId}/${commentId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: newBody })
});
if (response.ok) {
renderCommentsAndForm();
} else {
const errorText = await response.text();
alert(errorText || "Edit failed validation or safety screening.");
cancelEdit(commentId, originalBody);
}
} catch (err) {
console.error("Edit failed:", err);
cancelEdit(commentId, originalBody);
}
}
async function deleteComment(commentId) {
if (!confirm("Are you sure you want to permanently delete this comment?")) return;
try {
const response = await fetch(`/api/comments/${currentPostId}/${commentId}`, {
method: 'DELETE'
});
if (response.ok) {
renderCommentsAndForm();
} else {
const errorText = await response.text();
alert(errorText || "Could not delete comment.");
}
} catch (err) {
console.error("Deletion failed:", err);
}
}
async function postComment() {
const commentInput = document.getElementById('new-comment-text');
const commentText = commentInput.value.trim();
if (!commentText || !currentUser) return;
try {
const response = await fetch(`/api/comments/${currentPostId}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: commentText })
});
if (response.ok) {
commentInput.value = '';
renderCommentsAndForm();
} else {
const errorText = await response.text();
alert(errorText || "Network request failed verification checks.");
}
} catch (err) {
console.error("Submission error:", err);
}
}
// Contributors Modal Controllers
async function openContributorsModal() {
contributorsModal.style.display = 'flex';
contributorsGrid.innerHTML = `<div style="grid-column: 1/-1; text-align: center; color: var(--text-secondary); font-size: 0.9rem;">Querying active directory...</div>`;
try {
const response = await fetch('/api/contributors');
const contributors = await response.json();
contributorsGrid.innerHTML = contributors.map(user => `
<a href="https://huggingface.co/${user.username}" target="_blank" class="contributor-card">
<img src="${user.avatarUrl}" class="contributor-avatar" alt="${user.username}" onerror="this.src='https://huggingface.co/avatars/default.svg'">
<span class="contributor-fullname" title="${escapeHtml(user.fullname)}">${escapeHtml(user.fullname)}</span>
<span class="contributor-username">@${user.username}</span>
</a>
`).join('');
} catch (err) {
console.error("Failed to query contributors list:", err);
contributorsGrid.innerHTML = `<div style="grid-column: 1/-1; text-align: center; color: #f87171; font-size: 0.9rem;">Failed to fetch profile directory.</div>`;
}
}
function closeContributorsModal(event) {
contributorsModal.style.display = 'none';
}
function openPost(postId) {
currentPostId = postId;
const post = BLOG_POSTS.find(p => p.id === postId);
if (!post) return;
document.getElementById('post-detail-meta').innerHTML = `<span>${post.date}</span> <span></span> <span>${post.category}</span>`;
document.getElementById('post-detail-title').textContent = post.title;
document.getElementById('post-detail-body').innerHTML = post.content;
homeView.classList.add('hidden-view');
postView.classList.add('active-view');
renderCommentsAndForm();
window.scrollTo({ top: 0, behavior: 'instant' });
}
function showHome() {
currentPostId = null;
postView.classList.remove('active-view');
homeView.classList.remove('hidden-view');
window.scrollTo({ top: 0, behavior: 'instant' });
}
logoHome.addEventListener('click', (e) => {
e.preventDefault();
showHome();
});
async function init() {
await checkLoginState();
renderBlogList();
}
init();
</script>
</body>
</html>