refactor: Implement mobile-friendly control panel toggle and remove keyboard shortcuts hint.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import Sidebar from "../../components/Sidebar.astro";
|
||||
import { getCollection, type CollectionEntry } from "astro:content";
|
||||
|
||||
const posts = (await getCollection("blog")).sort(
|
||||
@@ -8,92 +9,195 @@ const posts = (await getCollection("blog")).sort(
|
||||
);
|
||||
---
|
||||
|
||||
<Layout title="System Logs" showScroll={true}>
|
||||
<main>
|
||||
<section>
|
||||
<ul>
|
||||
{
|
||||
posts.map((post: any) => (
|
||||
<li>
|
||||
<a href={`/blog/${post.slug}/`}>
|
||||
<span class="date">
|
||||
[
|
||||
{post.data.pubDate
|
||||
.toISOString()
|
||||
.slice(0, 10)}
|
||||
]
|
||||
</span>
|
||||
<span class="title">{post.data.title}</span>
|
||||
<span class="desc">
|
||||
// {post.data.description}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
<Layout title="System Logs">
|
||||
<div class="split-layout">
|
||||
<Sidebar />
|
||||
|
||||
<footer>
|
||||
<p>END OF STREAM</p>
|
||||
</footer>
|
||||
</main>
|
||||
<main class="content-workspace">
|
||||
<div class="content-container">
|
||||
<header class="page-header">
|
||||
<h1>Blog Articles</h1>
|
||||
<div class="divider"></div>
|
||||
</header>
|
||||
|
||||
<ul class="post-list">
|
||||
{
|
||||
posts.map((post: any) => (
|
||||
<li>
|
||||
<a
|
||||
href={`/blog/${post.slug}/`}
|
||||
class="post-link"
|
||||
>
|
||||
<div class="post-meta">
|
||||
<span class="date">
|
||||
{post.data.pubDate
|
||||
.toISOString()
|
||||
.slice(0, 10)}
|
||||
</span>
|
||||
</div>
|
||||
<div class="post-info">
|
||||
<span class="title">
|
||||
{post.data.title}
|
||||
</span>
|
||||
<span class="desc">
|
||||
{post.data.description}
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
|
||||
<footer>
|
||||
<p>© {new Date().getFullYear()} Syntaxbullet</p>
|
||||
</footer>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
<style>
|
||||
main {
|
||||
width: 960px;
|
||||
max-width: calc(100% - 2em);
|
||||
margin: 0 auto;
|
||||
padding: 2em 0;
|
||||
/* Split Layout - Consistent with Homepage */
|
||||
.split-layout {
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background: var(--bg-color);
|
||||
}
|
||||
|
||||
ul {
|
||||
/* Content Workspace (Right Side) */
|
||||
.content-workspace {
|
||||
flex-grow: 1;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #050505;
|
||||
overflow-y: auto; /* Enable scrolling for content */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
max-width: 900px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 4rem 2rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Header Styling */
|
||||
.page-header {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem 0;
|
||||
letter-spacing: -0.5px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Post List Styling */
|
||||
.post-list {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 1rem;
|
||||
border-left: 2px solid transparent;
|
||||
transition: border-left-color 0.2s;
|
||||
}
|
||||
|
||||
li:hover {
|
||||
border-left-color: var(--text-color);
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
.post-link {
|
||||
display: flex;
|
||||
flex-direction: column; /* Mobile first */
|
||||
gap: 0.5rem;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
color: var(--text-color);
|
||||
font-family: var(--font-mono);
|
||||
padding: 1.5rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
transition: all 0.2s ease;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.date {
|
||||
color: rgba(255, 103, 0, 0.6);
|
||||
margin-right: 1rem;
|
||||
.post-link:hover {
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.85rem;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.post-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
margin-right: 1rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: rgba(255, 103, 0, 0.4);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
a:hover .title {
|
||||
text-decoration: underline;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-family:
|
||||
system-ui,
|
||||
-apple-system,
|
||||
sans-serif;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 4rem;
|
||||
padding-top: 2rem;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
text-align: center;
|
||||
opacity: 0.3;
|
||||
opacity: 0.5;
|
||||
font-size: 0.8rem;
|
||||
font-family: var(--font-mono);
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (min-width: 768px) {
|
||||
.post-link {
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
min-width: 120px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.split-layout {
|
||||
flex-direction: column;
|
||||
overflow: hidden; /* Prevent body scroll, use inner scrolling */
|
||||
height: 100dvh;
|
||||
}
|
||||
|
||||
.content-workspace {
|
||||
height: auto;
|
||||
flex-grow: 1; /* Fill remaining space */
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user