From b6894fac9b97d920b7c6b4b42de07d5199e01f0f Mon Sep 17 00:00:00 2001 From: seccodesmith Date: Thu, 22 May 2025 15:44:26 +0200 Subject: [PATCH] feat: refactor PageHeader component to use CSS modules and remove unused styles from Blog module --- src/assets/styles/Blog.module.scss | 58 ------------------------ src/assets/styles/PageHeader.module.scss | 58 ++++++++++++++++++++++++ src/components/PageHeader.tsx | 18 ++++---- src/pages/Blog.tsx | 6 +-- 4 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 src/assets/styles/PageHeader.module.scss diff --git a/src/assets/styles/Blog.module.scss b/src/assets/styles/Blog.module.scss index 154a440..b593ec5 100644 --- a/src/assets/styles/Blog.module.scss +++ b/src/assets/styles/Blog.module.scss @@ -1,53 +1,5 @@ @use "./variables.scss" as *; - -/* Page Header */ -.pageHeader { - padding-top: 7rem; - padding-bottom: 3rem; - background-color: $secondary-dark; - position: relative; - overflow: hidden; -} - -.pageHeader::before { - content: ""; - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - background-image: url('/api/placeholder/1200/400'); - opacity: 0.15; - filter: brightness(0.3); - z-index: 0; -} - -.pageTitle { - font-size: 3rem; - margin-bottom: 1rem; - position: relative; - display: inline-block; -} - -.pageTitle::after { - content: ""; - position: absolute; - width: 60px; - height: 3px; - background: $accent-fire; - bottom: -10px; - left: 50%; - transform: translateX(-50%); - box-shadow: $glow-effect; -} - -.pageSubtitle { - font-size: 1.2rem; - color: $text-ash; -} - - /* Meta items */ @mixin metaItem { .metaItem { @@ -269,13 +221,3 @@ border-color: $accent-fire; color: $text-light; } - -/* Binary background effect */ -.binaryLine { - position: absolute; - font-family: 'Fira Code', monospace; - color: $accent-fire; - font-size: 0.8rem; - opacity: 0.15; - pointer-events: none; -} \ No newline at end of file diff --git a/src/assets/styles/PageHeader.module.scss b/src/assets/styles/PageHeader.module.scss new file mode 100644 index 0000000..7323e42 --- /dev/null +++ b/src/assets/styles/PageHeader.module.scss @@ -0,0 +1,58 @@ +@use "./variables.scss" as *; + + +/* Binary background effect */ +.binaryLine { + position: absolute; + font-family: 'Fira Code', monospace; + color: $accent-fire; + font-size: 0.8rem; + opacity: 0.15; + pointer-events: none; +} + +/* Page Header */ +.pageHeader { + padding-top: 7rem; + padding-bottom: 3rem; + background-color: $secondary-dark; + position: relative; + overflow: hidden; +} + +.pageHeader::before { + content: ""; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-image: url('/api/placeholder/1200/400'); + opacity: 0.15; + filter: brightness(0.3); + z-index: 0; +} + +.pageTitle { + font-size: 3rem; + margin-bottom: 1rem; + position: relative; + display: inline-block; +} + +.pageTitle::after { + content: ""; + position: absolute; + width: 60px; + height: 3px; + background: $accent-fire; + bottom: -10px; + left: 50%; + transform: translateX(-50%); + box-shadow: $glow-effect; +} + +.pageSubtitle { + font-size: 1.2rem; + color: $text-ash; +} \ No newline at end of file diff --git a/src/components/PageHeader.tsx b/src/components/PageHeader.tsx index 474f396..a52935a 100644 --- a/src/components/PageHeader.tsx +++ b/src/components/PageHeader.tsx @@ -1,3 +1,5 @@ +import style from '@styles/PageHeader.module.scss' + interface PageHeaderProps { title: string; subtitle?: string; @@ -5,17 +7,17 @@ interface PageHeaderProps { export const PageHeader: React.FC = ({ title, subtitle }) => { return ( -
-
-

{title}

- {subtitle &&

{subtitle}

} +
+
+

{title}

+ {subtitle &&

{subtitle}

} {/* Binary background effect */}
-
01001100 01101111 01110010 01100101 01101101
-
01001001 01110000 01110011 01110101 01101101
-
01000100 01101111 01101100 01101111 01110010
-
01010011 01101001 01110100 00100000 01000001 01101101 01100101 01110100
+
01001100 01101111 01110010 01100101 01101101
+
01001001 01110000 01110011 01110101 01101101
+
01000100 01101111 01101100 01101111 01110010
+
01010011 01101001 01110100 00100000 01000001 01101101 01100101 01110100
diff --git a/src/pages/Blog.tsx b/src/pages/Blog.tsx index 8e2b5da..bbad834 100644 --- a/src/pages/Blog.tsx +++ b/src/pages/Blog.tsx @@ -75,9 +75,9 @@ export const Blog = () => { -
  • 1
  • -
  • 2
  • -
  • 3
  • +
  • 1
  • +
  • 2
  • +
  • 3