Fixed nested comment layout

This commit is contained in:
Your Name committed 2025-04-27 19:03:55 +08:00
1 parent d6c636e576
commit 906f35100e
1 file changed
+310 -175
+310 -175
View File
@@ -1,199 +1,334 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <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="node_modules/bulma/css/bulma.min.css">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<title>Post - Behind the Desk</title> <title>Post - Behind the Desk</title>
<style> <style>
/* Add specific styles for single-post page if needed */ .single-post-container {
.single-post-container { max-width: 600px;
max-width: 450px; /* Increased width for longer fields */ margin-top: 2rem;
margin-top: 2rem; }
} .comment-section {
.single-post-container h2 { margin-top: 2rem;
font-size: 1.2rem; }
margin-bottom: 1rem; .comment {
color: #38315f; /* Updated text color */ margin-top: 1.5rem;
} padding-left: 0;
.single-post-container .field { font-size: 0.9rem; /* Smaller text for comments */
margin-bottom: 0.75rem; }
} .nested-comment {
.single-post-container .label { margin-left: 1.5rem;
font-size: 0.9rem; margin-top: 1rem;
font-weight: normal; border-left: 2px solid #ddd;
color: #38315f; /* Updated text color */ padding-left: 1rem;
margin-bottom: 0.25rem; font-size: 0.9rem;
display: inline-block; /* HN style labels */ }
width: 100px; /* Align inputs */ .comment-header small.reply {
} text-decoration: underline;
.single-post-container .input, font-size: 0.75rem;
.single-post-container .textarea, cursor: pointer;
.single-post-container .select select { margin-left: 0.5rem;
font-size: 0.9rem; display: inline-block;
max-width: 250px; /* Increased max-width for longer fields */ }
display: inline-block; /* Align with label */ .comment-header a.nav-link {
width: calc(100% - 110px); /* Adjust width */ font-size: 0.75rem;
background-color: #ffffff; /* Ensure white background */ margin-left: 0.5rem;
color: #363636; /* Default input text color */ text-decoration: underline;
border: 1px solid #dbdbdb; /* Standard Bulma border */ color: #38315f;
} }
.single-post-container .input:focus, .comment-header a.nav-link:hover {
.single-post-container .textarea:focus, color: #2d274a;
.single-post-container .select select:focus { }
border-color: #38315f; /* Highlight focus */ .upvote-arrow {
box-shadow: 0 0 0 0.125em rgba(56, 49, 95, 0.25); font-size: 0.9rem;
} margin-right: 0.5rem;
.single-post-container .button.is-primary { /* Target the specific button */ color: #6c757d;
font-size: 0.9rem; }
margin-left: 100px; /* Align button with inputs */ .upvote-arrow:hover {
margin-top: 0.5rem; color: #ff6600;
background-color: #38315f; /* Updated button color */ }
color: #ffffff; /* White text for contrast */ .reply-box {
border-color: transparent; /* Remove default border */ margin-left: 2rem;
} margin-top: 1rem;
.single-post-container .button.is-primary:hover { }
background-color: #2d274a; /* Slightly darker on hover */ .reply-box textarea {
} margin-bottom: 0.5rem;
.single-post-container .select { background-color: #f8f9fa;
margin-left: auto; /* Align dropdown to the right */ border: 1px solid #dbdbdb;
} font-size: 0.9rem;
</style> }
</head> .comments-list {
<body> margin-top: 1rem;
<nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation"> }
<div class="container"> .comment-header {
<div class="navbar-brand"> margin-bottom: 0.3rem;
<a class="navbar-item has-text-weight-bold" href="/"> }
Behind the Desk .comment-body p {
</a> margin-bottom: 0.5rem;
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample"> }
<span aria-hidden="true"></span> .button.is-primary {
<span aria-hidden="true"></span> background-color: #38315f;
<span aria-hidden="true"></span> border-color: transparent;
<span aria-hidden="true"></span> color: #fff;
</a> }
</div> .button.is-primary:hover {
<div id="navbarBasicExample" class="navbar-menu"> background-color: #2d274a;
<div class="navbar-start"> }
<a class="navbar-item" href="/"> textarea.textarea {
top 🔥 background-color: #f8f9fa;
</a> border: 1px solid #dbdbdb;
<a class="navbar-item" href="#"> color: #363636;
new }
</a> </style>
<a class="navbar-item" href="#"> </head>
nearby <body>
</a> <nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
<a class="navbar-item" href="#"> <div class="container">
past <div class="navbar-brand">
</a> <a class="navbar-item has-text-weight-bold" href="/">Behind the Desk</a>
<a class="navbar-item" href="#"> <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
ask <span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>
</a> </a>
<a class="navbar-item" href="#"> </div>
show <div id="navbarBasicExample" class="navbar-menu">
</a> <div class="navbar-start">
<a class="navbar-item" href="#"> <a class="navbar-item" href="/">top 🔥</a>
submit <a class="navbar-item" href="#">new</a>
</a> <a class="navbar-item" href="#">nearby</a>
</div> <a class="navbar-item" href="#">past</a>
<div class="navbar-end"> <a class="navbar-item" href="#">ask</a>
<div class="navbar-item"> <a class="navbar-item" href="#">show</a>
<a href="/login.html">login</a> <a class="navbar-item" href="#">submit</a>
</div> </div>
</div> <div class="navbar-end">
<div class="navbar-item">
<a href="/login.html">login</a>
</div> </div>
</div> </div>
</nav> </div>
</div>
</nav>
<main class="section main-content"> <main class="section main-content">
<div class="container single-post-container"> <div class="container single-post-container">
<article class="media"> <article class="media">
<div class="media-left is-align-self-flex-start pt-1"> <div class="media-left">
<a href="#" class="upvote-arrow" title="Upvote">▲</a> <a href="#" class="upvote-arrow" title="Upvote">▲</a>
</div>
<div class="media-content">
<div class="content">
<p>
<strong><a href="#" class="post-title">The saga of the disappearing ergonomic chair continues. ✏️</a></strong>
</p>
<p>
<small class="handle">@deskdetective</small> | <small class="time">1h ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
</p>
<p>
Every time I leave my desk, it seems to vanish. Suspecting foul play at this point. Anyone else faced something like this?
</p>
</div>
</div>
</article>
<div class="comment-section">
<form>
<div class="field">
<label class="label" for="comment-body">Comment:</label>
<div class="control">
<textarea class="textarea" id="comment-body" name="body" placeholder="Enter your comment" required></textarea>
</div> </div>
<div class="media-content"> </div>
<div class="content"> <div class="field">
<p> <div class="control">
<strong><a href="#" class="post-title">The saga of the disappearing ergonomic chair continues. <span class="update-tick">✏️</span></a></strong> <button class="button is-primary" type="submit">Add Comment</button>
</p> </div>
<p> </div>
<small class="handle">@deskdetective</small> | <small class="time">1h ago</small> <a href="#" class="next-action">next</a> </form>
</p>
<p> <h3 class="mt-4">Comments</h3>
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 class="comments-list">
<!-- Main Comment -->
<div class="comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@commenter1</small> <small class="time">2h ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Haha, this totally happened to me last year. We had a phantom chair thief at work and it became an ongoing office joke for months!</p>
</div>
<!-- Nested Comment -->
<div class="nested-comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nestedcommenter1</small> <small class="time">1h ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Did they ever catch who it was? 😂 I'd totally set up a hidden camera if it kept happening that much.</p>
</div>
<!-- Example Reply Box -->
<div class="reply-box">
<textarea class="textarea" placeholder="Reply to this comment..."></textarea>
<button class="button is-small is-primary">Reply</button>
</div> </div>
</div> </div>
</article> </div>
<div class="comment-section"> <!-- Another Comment -->
<form> <div class="comment">
<div class="field"> <div class="comment-header">
<label class="label" for="comment-body">Comment:</label> <a href="#" class="upvote-arrow">▲</a>
<div class="control"> <small class="handle">@commenter2</small> <small class="time">3h ago</small>
<textarea class="textarea" id="comment-body" name="body" placeholder="Enter your comment" required></textarea> <a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
</div> <small class="reply">reply</small>
</div> </div>
<div class="field"> <div class="comment-body">
<div class="control"> <p>At my old job, chairs were so bad people would "borrow" a good one whenever someone went on vacation. A real survival of the fittest situation!</p>
<button class="button is-primary" type="submit">Add Comment</button> </div>
</div> </div>
</div>
</form>
<h3>Comments</h3> <!-- Third Comment -->
<div class="comments-list"> <div class="comment">
<!-- Example Comment 1 --> <div class="comment-header">
<div class="comment"> <a href="#" class="upvote-arrow">▲</a>
<small class="handle">@commenter3</small> <small class="time">5h ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>I recommend putting a bright sticker with your name on the chair. Makes it harder for people to pretend they didn't know it wasn't theirs.</p>
</div>
</div>
<!-- Main Comment -->
<div class="comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@commenter1</small> <small class="time">2h ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Haha, this totally happened to me last year. It was hilarious and annoying at the same time.</p>
</div>
<!-- Level 1 Nested Comment -->
<div class="nested-comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nested1</small> <small class="time">1h 50m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Honestly, office pranks can either build great vibes or cause chaos if not handled well 😂</p>
</div>
<!-- Level 2 Nested Comment -->
<div class="nested-comment">
<div class="comment-header"> <div class="comment-header">
<small class="handle">@commenter1</small> <small class="time">2h ago</small> <small class="reply">reply</small> <a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nested2</small> <small class="time">1h 40m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div> </div>
<div class="comment-body"> <div class="comment-body">
<p>This is a comment on the post.</p> <p>Yeah, in our team it turned into an inside joke that lasted months. No HR complaints thankfully!</p>
</div> </div>
<!-- Nested Comment 1 -->
<!-- Level 3 Nested Comment -->
<div class="nested-comment"> <div class="nested-comment">
<div class="comment-header"> <div class="comment-header">
<small class="handle">@nestedcommenter1</small> <small class="time">1h ago</small> <small class="reply">reply</small> <a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nested3</small> <small class="time">1h 30m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div> </div>
<div class="comment-body"> <div class="comment-body">
<p>This is a nested comment in response to the first comment.</p> <p>Ours got so bad management had to install chair locks (yes, seriously!).</p>
</div> </div>
</div>
</div>
<!-- Example Comment 2 --> <!-- Example Reply Box -->
<div class="comment"> <div class="reply-box">
<div class="comment-header"> <textarea class="textarea" placeholder="Reply to this comment..."></textarea>
<small class="handle">@commenter2</small> <small class="time">3h ago</small> <small class="reply">reply</small> <button class="button is-small is-primary">Reply</button>
</div> </div>
<div class="comment-body">
<p>Another comment on the post.</p> <!-- Level 4 Nested Comment -->
</div> <div class="nested-comment">
</div> <div class="comment-header">
</div> <a href="#" class="upvote-arrow">▲</a>
</div> <small class="handle">@nested4</small> <small class="time">1h 20m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>😂 Chair locks?! That's next level commitment to stopping thefts.</p>
</div>
<!-- Level 5 Nested Comment -->
<div class="nested-comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nested5</small> <small class="time">1h 10m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>I would LOVE to see the memo that went out announcing chair locks to employees 😆</p>
</div>
<!-- Level 6 Nested Comment -->
<div class="nested-comment">
<div class="comment-header">
<a href="#" class="upvote-arrow">▲</a>
<small class="handle">@nested6</small> <small class="time">1h 5m ago</small>
<a href="#" class="nav-link">parent</a> <a href="#" class="nav-link">next</a>
<small class="reply">reply</small>
</div>
<div class="comment-body">
<p>Imagine coming into work one day and finding your chair padlocked to the floor 😅</p>
</div>
</div>
</div> <!-- Level 5 -->
</div> <!-- Level 4 -->
</div> <!-- Level 3 -->
</div> <!-- Level 2 -->
</div> <!-- Level 1 -->
</div> <!-- Main Comment -->
</div> </div>
</main>
<!-- Simple script to toggle mobile menu --> </div>
<script> </div>
document.addEventListener('DOMContentLoaded', () => { </main>
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) { <script>
$navbarBurgers.forEach( el => { document.addEventListener('DOMContentLoaded', () => {
el.addEventListener('click', () => { const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
const target = el.dataset.target; if ($navbarBurgers.length > 0) {
const $target = document.getElementById(target); $navbarBurgers.forEach(el => {
el.classList.toggle('is-active'); el.addEventListener('click', () => {
$target.classList.toggle('is-active'); const target = el.dataset.target;
}); const $target = document.getElementById(target);
}); el.classList.toggle('is-active');
} $target.classList.toggle('is-active');
});
}); });
</script> }
</body> });
</script>
</body>
</html> </html>