]> danix's work - danix2-hugo-theme.git/commitdiff
style: add card, feed, code, and progress bar styles
authorDanilo M. <redacted>
Sun, 5 Apr 2026 06:39:03 +0000 (08:39 +0200)
committerDanilo M. <redacted>
Sun, 5 Apr 2026 06:39:03 +0000 (08:39 +0200)
assets/css/components/card.css [new file with mode: 0644]
assets/css/components/code.css [new file with mode: 0644]
assets/css/components/feed.css [new file with mode: 0644]
assets/css/components/progress-bar.css [new file with mode: 0644]
assets/css/main.css

diff --git a/assets/css/components/card.css b/assets/css/components/card.css
new file mode 100644 (file)
index 0000000..f86c7bf
--- /dev/null
@@ -0,0 +1,155 @@
+/* card.css */
+.post-card {
+  background: var(--surface);
+  border: 1px solid var(--border);
+  border-radius: 8px;
+  overflow: hidden;
+  transition: var(--transition);
+  display: flex;
+  gap: var(--gap-md);
+}
+
+.post-card:hover {
+  border-color: var(--accent);
+  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
+}
+
+.post-card-image {
+  width: 120px;
+  height: 100px;
+  flex-shrink: 0;
+  object-fit: cover;
+  background: linear-gradient(135deg, var(--border), var(--bg2));
+  border-right: 1px solid var(--border);
+}
+
+@media (min-width: 768px) {
+  .post-card-image {
+    width: 160px;
+    height: 120px;
+  }
+}
+
+.post-card-body {
+  padding: var(--gap-md);
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  flex-grow: 1;
+}
+
+.post-type-badge {
+  display: inline-block;
+  font-family: var(--font-mono);
+  font-size: var(--fs-badge);
+  font-weight: 600;
+  text-transform: uppercase;
+  letter-spacing: 0.1em;
+  padding: 0.35rem 0.7rem;
+  border-radius: 20px;
+  margin-bottom: 0.5rem;
+  width: fit-content;
+}
+
+/* Type-specific badge colors */
+.post-type-badge.tech {
+  background: color-mix(in srgb, var(--color-tech) 15%, transparent);
+  border: 1px solid color-mix(in srgb, var(--color-tech) 30%, transparent);
+  color: var(--color-tech);
+}
+
+.post-type-badge.life {
+  background: color-mix(in srgb, var(--color-life) 15%, transparent);
+  border: 1px solid color-mix(in srgb, var(--color-life) 30%, transparent);
+  color: var(--color-life);
+}
+
+.post-type-badge.quote {
+  background: color-mix(in srgb, var(--color-quote) 15%, transparent);
+  border: 1px solid color-mix(in srgb, var(--color-quote) 30%, transparent);
+  color: var(--color-quote);
+}
+
+.post-type-badge.link {
+  background: color-mix(in srgb, var(--color-link) 15%, transparent);
+  border: 1px solid color-mix(in srgb, var(--color-link) 30%, transparent);
+  color: var(--color-link);
+}
+
+.post-type-badge.photo {
+  background: color-mix(in srgb, var(--color-photo) 15%, transparent);
+  border: 1px solid color-mix(in srgb, var(--color-photo) 30%, transparent);
+  color: var(--color-photo);
+}
+
+.post-card-title {
+  font-family: var(--font-head);
+  font-size: 1.1rem;
+  font-weight: 700;
+  line-height: 1.3;
+  margin-bottom: 0.5rem;
+  color: var(--text);
+}
+
+.post-card-title a {
+  color: var(--text);
+  text-decoration: none;
+}
+
+.post-card-title a:hover {
+  color: var(--accent);
+}
+
+.post-card-excerpt {
+  color: var(--text-dim);
+  font-size: 0.9rem;
+  line-height: 1.6;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  overflow: hidden;
+  margin-bottom: 0.5rem;
+}
+
+.post-card-meta {
+  display: flex;
+  gap: 1rem;
+  font-family: var(--font-mono);
+  font-size: 0.75rem;
+  color: var(--muted);
+  text-transform: uppercase;
+  letter-spacing: 0.08em;
+}
+
+/* Featured card in grid */
+.post-card.featured {
+  grid-row: span 2;
+}
+
+.post-card.featured .post-card-image {
+  width: 100%;
+  height: 180px;
+  border-right: none;
+  border-bottom: 1px solid var(--border);
+}
+
+.post-card.featured .post-card-body {
+  padding: var(--gap-lg);
+}
+
+@media (max-width: 768px) {
+  .post-card {
+    flex-direction: column;
+  }
+
+  .post-card-image {
+    width: 100%;
+    height: 150px;
+    border-right: none;
+    border-bottom: 1px solid var(--border);
+  }
+
+  .post-card.featured .post-card-image {
+    height: 150px;
+  }
+}
diff --git a/assets/css/components/code.css b/assets/css/components/code.css
new file mode 100644 (file)
index 0000000..4cdc57b
--- /dev/null
@@ -0,0 +1,138 @@
+/* code.css */
+pre {
+  background: var(--surface);
+  border: 1px solid var(--border);
+  border-left: 3px solid var(--accent);
+  border-radius: 6px;
+  padding: 1rem;
+  overflow-x: auto;
+  position: relative;
+  margin: 1.5rem 0;
+}
+
+pre code {
+  font-family: var(--font-mono);
+  font-size: 0.9rem;
+  line-height: 1.6;
+  color: var(--text);
+}
+
+/* Chroma syntax highlighting */
+.highlight {
+  background: var(--surface);
+  border: 1px solid var(--border);
+  border-left: 3px solid var(--accent);
+  border-radius: 6px;
+  padding: 1rem;
+  overflow-x: auto;
+  margin: 1.5rem 0;
+  position: relative;
+}
+
+.highlight code {
+  background: none;
+  padding: 0;
+  border-radius: 0;
+  color: inherit;
+}
+
+/* Chroma color overrides for dark theme */
+.highlight .k { color: #f59e0b; }
+.highlight .kn { color: #f59e0b; }
+.highlight .kp { color: #f59e0b; }
+.highlight .kr { color: #f59e0b; }
+.highlight .kt { color: #a855f7; }
+.highlight .n { color: #c4d6e8; }
+.highlight .na { color: #38bdf8; }
+.highlight .nb { color: #38bdf8; }
+.highlight .nc { color: #a855f7; }
+.highlight .no { color: #00ff88; }
+.highlight .nd { color: #f59e0b; }
+.highlight .ni { color: #a855f7; }
+.highlight .ne { color: #f59e0b; }
+.highlight .nf { color: #38bdf8; }
+.highlight .nl { color: #a855f7; }
+.highlight .nn { color: #a855f7; }
+.highlight .nt { color: #f59e0b; }
+.highlight .nv { color: #c4d6e8; }
+.highlight .s { color: #00ff88; }
+.highlight .sa { color: #00ff88; }
+.highlight .sb { color: #00ff88; }
+.highlight .sc { color: #00ff88; }
+.highlight .s1 { color: #00ff88; }
+.highlight .s2 { color: #00ff88; }
+.highlight .se { color: #f59e0b; }
+.highlight .sh { color: #00ff88; }
+.highlight .si { color: #f59e0b; }
+.highlight .sx { color: #00ff88; }
+.highlight .sr { color: #00ff88; }
+.highlight .ss { color: #00ff88; }
+.highlight .m { color: #38bdf8; }
+.highlight .mb { color: #38bdf8; }
+.highlight .mf { color: #38bdf8; }
+.highlight .mh { color: #38bdf8; }
+.highlight .mi { color: #38bdf8; }
+.highlight .il { color: #38bdf8; }
+.highlight .mo { color: #38bdf8; }
+.highlight .o { color: #c4d6e8; }
+.highlight .ow { color: #a855f7; }
+.highlight .c { color: #7a9bb8; }
+.highlight .c1 { color: #7a9bb8; }
+.highlight .ch { color: #7a9bb8; }
+.highlight .cm { color: #7a9bb8; }
+.highlight .cp { color: #f59e0b; }
+.highlight .cpf { color: #f59e0b; }
+
+html.theme-light .highlight {
+  background: var(--surface);
+  border-left-color: var(--accent);
+}
+
+html.theme-light .highlight .c { color: #6a7fa0; }
+
+/* Copy button for code blocks */
+.code-copy-btn {
+  position: absolute;
+  top: 0.75rem;
+  right: 0.75rem;
+  background: var(--accent);
+  color: #fff;
+  border: none;
+  padding: 0.4rem 0.8rem;
+  border-radius: 4px;
+  font-family: var(--font-mono);
+  font-size: 0.75rem;
+  cursor: pointer;
+  opacity: 0;
+  transition: var(--transition);
+  text-transform: uppercase;
+  letter-spacing: 0.08em;
+}
+
+.highlight:hover .code-copy-btn,
+pre:hover .code-copy-btn {
+  opacity: 1;
+}
+
+.code-copy-btn:hover {
+  background: var(--accent2);
+  color: var(--bg);
+}
+
+.code-copy-btn.copied {
+  background: var(--accent2);
+}
+
+/* Inline code */
+code {
+  font-family: var(--font-mono);
+  background: var(--surface);
+  padding: 0.25rem 0.5rem;
+  border-radius: 4px;
+  font-size: 0.9em;
+  color: var(--accent2);
+}
+
+p code {
+  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
+}
diff --git a/assets/css/components/feed.css b/assets/css/components/feed.css
new file mode 100644 (file)
index 0000000..0902198
--- /dev/null
@@ -0,0 +1,101 @@
+/* feed.css */
+.feed-section {
+  padding: var(--section-py-mobile) 0;
+}
+
+@media (min-width: 768px) {
+  .feed-section {
+    padding: var(--section-py-desktop) 0;
+  }
+}
+
+.feed-label {
+  font-family: var(--font-mono);
+  font-size: 0.75rem;
+  letter-spacing: 0.15em;
+  text-transform: uppercase;
+  color: var(--accent);
+  margin-bottom: 1.5rem;
+}
+
+.feed-grid {
+  display: grid;
+  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+  gap: var(--gap-md);
+  margin-bottom: var(--gap-xl);
+}
+
+@media (min-width: 768px) {
+  .feed-grid {
+    grid-template-columns: repeat(2, 1fr);
+  }
+}
+
+@media (min-width: 1200px) {
+  .feed-grid {
+    grid-template-columns: repeat(3, 1fr);
+  }
+}
+
+.feed-list {
+  display: flex;
+  flex-direction: column;
+  gap: var(--gap-md);
+}
+
+.feed-list .post-card {
+  flex-direction: row;
+}
+
+/* Filter bar */
+.filter-bar {
+  display: flex;
+  gap: var(--gap-sm);
+  margin-bottom: var(--gap-lg);
+  flex-wrap: wrap;
+}
+
+.filter-btn {
+  font-family: var(--font-mono);
+  font-size: var(--fs-badge);
+  padding: 0.4rem 1rem;
+  border: 1px solid var(--border);
+  border-radius: 20px;
+  background: transparent;
+  color: var(--text-dim);
+  text-transform: uppercase;
+  letter-spacing: 0.1em;
+  cursor: pointer;
+  transition: var(--transition);
+}
+
+.filter-btn:hover {
+  border-color: var(--accent);
+  color: var(--accent);
+}
+
+.filter-btn.active {
+  background: var(--accent);
+  color: #fff;
+  border-color: var(--accent);
+}
+
+/* View all link */
+.feed-cta {
+  display: inline-block;
+  padding: 0.75rem 1.5rem;
+  background: var(--accent);
+  color: #fff;
+  border-radius: 4px;
+  font-family: var(--font-mono);
+  font-size: var(--fs-btn);
+  text-transform: uppercase;
+  letter-spacing: 0.1em;
+  text-decoration: none;
+  transition: var(--transition);
+}
+
+.feed-cta:hover {
+  background: var(--accent2);
+  color: var(--bg);
+}
diff --git a/assets/css/components/progress-bar.css b/assets/css/components/progress-bar.css
new file mode 100644 (file)
index 0000000..f89f4a8
--- /dev/null
@@ -0,0 +1,22 @@
+/* progress-bar.css */
+.reading-progress {
+  position: fixed;
+  top: 0;
+  left: 0;
+  height: 3px;
+  background: linear-gradient(90deg, var(--accent), var(--accent2));
+  width: 0%;
+  z-index: 200;
+  transition: width 0.1s ease-out;
+}
+
+/* Only show on pages with sufficient content */
+.article-page .reading-progress,
+.page-page .reading-progress {
+  display: block;
+}
+
+/* Hide if no scrollable content */
+body:not(.scrollable) .reading-progress {
+  display: none;
+}
index a8ea5c7acd97b56d87788b814bf6ef88ce147dd9..3c12d228b2b6b72edd724e051b15dff2b9db98e7 100644 (file)
@@ -2,6 +2,10 @@
 
 @import 'variables.css';
 @import 'components/hero.css';
+@import 'components/card.css';
+@import 'components/feed.css';
+@import 'components/code.css';
+@import 'components/progress-bar.css';
 
 /* Base Styles */
 html {