feat: add single-post page with comments and nested replies

This commit is contained in:
Your Name (aider) committed 2025-04-27 18:28:31 +08:00
1 parent 7aef86c50c
commit 25da202724
1 file changed
+139
+139
View File
@@ -0,0 +1,139 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="node_modules/bulma/css/bulma.min.css">
<link rel="stylesheet" href="style.css">
<title>Post - Behind the Desk</title>
</head>
<body>
<nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item has-text-weight-bold" href="/">
Behind the Desk
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="/">
top 🔥
</a>
<a class="navbar-item" href="#">
new
</a>
<a class="navbar-item" href="#">
nearby
</a>
<a class="navbar-item" href="#">
past
</a>
<a class="navbar-item" href="#">
ask
</a>
<a class="navbar-item" href="#">
show
</a>
<a class="navbar-item" href="#">
submit
</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<a href="/login.html">login</a>
</div>
</div>
</div>
</div>
</nav>
<main class="section main-content">
<div class="container">
<article class="media">
<div class="media-content">
<div class="content">
<p>
<strong><a href="#" class="post-title">The saga of the disappearing ergonomic chair continues.</a></strong> <small class="handle">@deskdetective</small> <small class="time">1h ago</small>
</p>
<p>
The saga of the disappearing ergonomic chair continues. Every time I leave my desk, it seems to vanish into thin air. I've started to suspect my colleagues are playing a prank on me. Has anyone else experienced this?
</p>
</div>
</div>
</article>
<div class="comment-section">
<h3>Add a Comment</h3>
<form>
<div class="field">
<div class="control">
<textarea class="textarea" placeholder="Enter your comment"></textarea>
</div>
</div>
<div class="field">
<div class="control">
<button class="button is-primary" type="submit">Submit</button>
</div>
</div>
</form>
<h3>Comments</h3>
<div class="comments-list">
<!-- Example Comment 1 -->
<div class="comment">
<div class="comment-header">
<small class="handle">@commenter1</small> <small class="time">2h ago</small> <small class="reply">reply</small>
</div>
<div class="comment-body">
<p>This is a comment on the post.</p>
</div>
<!-- Nested Comment 1 -->
<div class="nested-comment">
<div class="comment-header">
<small class="handle">@nestedcommenter1</small> <small class="time">1h ago</small> <small class="reply">reply</small>
</div>
<div class="comment-body">
<p>This is a nested comment in response to the first comment.</p>
</div>
</div>
</div>
<!-- Example Comment 2 -->
<div class="comment">
<div class="comment-header">
<small class="handle">@commenter2</small> <small class="time">3h ago</small> <small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Another comment on the post.</p>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Simple script to toggle mobile menu -->
<script>
document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) {
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {
const target = el.dataset.target;
const $target = document.getElementById(target);
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});
</script>
</body>
</html>