feat: add Blog and BlogCard styles, refactor components to use CSS modules, and remove unused CSS files

This commit is contained in:
2025-05-22 15:05:24 +02:00
parent 762fc64806
commit 77ba446d4d
8 changed files with 229 additions and 774 deletions
@@ -1,7 +1,8 @@
@use "./variables.scss" as *;
/* Page Header */
.page-header {
.pageHeader {
padding-top: 7rem;
padding-bottom: 3rem;
background-color: $secondary-dark;
@@ -9,7 +10,7 @@
overflow: hidden;
}
.page-header::before {
.pageHeader::before {
content: "";
position: absolute;
width: 100%;
@@ -22,14 +23,14 @@
z-index: 0;
}
.page-title {
.pageTitle {
font-size: 3rem;
margin-bottom: 1rem;
position: relative;
display: inline-block;
}
.page-title::after {
.pageTitle::after {
content: "";
position: absolute;
width: 60px;
@@ -41,153 +42,89 @@
box-shadow: $glow-effect;
}
.page-subtitle {
.pageSubtitle {
font-size: 1.2rem;
color: $text-ash;
}
/* Card styling */
.card {
background-color: $card-bg;
border: 1px solid $card-border;
border-radius: 8px;
transition: all 0.3s ease;
margin-bottom: 1.5rem;
overflow: hidden;
}
.card:hover {
transform: translateY(-5px);
border-color: rgba(255, 100, 0, 0.3);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.card-img-top {
height: 200px;
object-fit: cover;
}
.featured-img {
height: 300px;
}
.card-title {
font-size: 1.5rem;
margin-bottom: 0.75rem;
}
.card-title a {
color: $text-light;
text-decoration: none;
transition: color 0.3s;
}
.card-title a:hover {
color: $accent-fire;
}
.card-text {
color: $text-ash;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
}
.featured-card .card-title {
font-size: 1.8rem;
}
.card-footer {
background-color: rgba(0, 0, 0, 0.2);
border-top: 1px solid $card-border;
}
/* Category badges */
.category-badge {
position: absolute;
top: 1rem;
right: 1rem;
background-color: rgba(139, 0, 0, 0.9);
color: $text-light;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
}
.featured-badge {
position: absolute;
top: 1rem;
left: 1rem;
background: linear-gradient(45deg, $accent-dragon, $accent-fire);
color: $text-light;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
display: flex;
align-items: center;
gap: 5px;
}
/* Meta items */
.meta-item {
display: inline-flex;
align-items: center;
gap: 6px;
margin-right: 1rem;
color: $text-ash;
font-size: 0.9rem;
@mixin metaItem {
.metaItem {
display: inline-flex;
align-items: center;
gap: 6px;
margin-right: 1rem;
color: $text-ash;
font-size: 0.9rem;
}
}
.meta-icon {
color: $accent-fire;
@mixin metaIcon {
.metaIcon {
font-size: 1.2rem;
color: $text-ash;
transition: all 0.3s ease;
}
.metaIcon:hover {
color: $accent-fire;
}
}
/* Read more link */
.read-more {
display: inline-block;
color: $accent-fire;
text-decoration: none;
font-weight: 600;
transition: all 0.3s ease;
position: relative;
}
.read-more::after {
content: "";
margin-left: 5px;
transition: transform 0.3s ease;
}
@mixin readMore {
.readMore {
display: inline-block;
color: $accent-fire;
text-decoration: none;
font-weight: 600;
transition: all 0.3s ease;
position: relative;
}
.read-more:hover::after {
transform: translateX(5px);
.readMore::after {
content: "";
margin-left: 5px;
transition: transform 0.3s ease;
}
.readMore:hover::after {
transform: translateX(5px);
}
}
/* Tags */
.post-tag {
display: inline-block;
background-color: rgba(255, 100, 0, 0.1);
color: $accent-fire;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 500;
margin-right: 0.5rem;
margin-bottom: 0.5rem;
transition: all 0.3s ease;
@mixin postTag {
.postTag {
display: inline-block;
background-color: rgba(255, 100, 0, 0.1);
color: $accent-fire;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 500;
margin-right: 0.5rem;
margin-bottom: 0.5rem;
transition: all 0.3s ease;
}
.postTag:hover {
background-color: rgba(255, 100, 0, 0.2);
transform: translateY(-2px);
}
}
.post-tag:hover {
background-color: rgba(255, 100, 0, 0.2);
transform: translateY(-2px);
}
@include metaItem;
@include metaIcon;
@include readMore;
@include postTag;
/* Sidebar */
.sidebar-widget {
.sidebarWidget {
background-color: $card-bg;
border-radius: 8px;
padding: 1.5rem;
@@ -195,7 +132,7 @@
border: 1px solid $card-border;
}
.widget-title {
.widgetTitle {
font-size: 1.2rem;
margin-bottom: 1.25rem;
padding-bottom: 0.625rem;
@@ -203,7 +140,7 @@
position: relative;
}
.widget-title::after {
.widgetTitle::after {
content: "";
position: absolute;
width: 40px;
@@ -213,40 +150,40 @@
left: 0;
}
.search-form .form-control {
.searchForm .formControl {
background-color: rgba(255, 255, 255, 0.05);
border: 1px solid $card-border;
color: $text-light;
}
.search-form .form-control:focus {
.searchForm .formControl:focus {
box-shadow: 0 0 0 0.25rem rgba(255, 100, 0, 0.25);
border-color: $accent-fire;
}
.search-form .btn {
.searchForm .btn {
background-color: $accent-fire;
border-color: $accent-fire;
}
.search-form .btn:hover {
.searchForm .btn:hover {
background-color: $accent-dragon;
border-color: $accent-dragon;
}
/* Lists in sidebar */
.list-group-item {
.listGroupItem {
background-color: transparent;
border-color: rgba(255, 255, 255, 0.05);
color: $text-ash;
transition: all 0.3s ease;
}
.list-group-item:hover {
.listGroupItem:hover {
background-color: rgba(255, 100, 0, 0.1);
}
.list-group-item a {
.listGroupItem a {
color: $text-ash;
text-decoration: none;
display: flex;
@@ -254,11 +191,11 @@
align-items: center;
}
.list-group-item a:hover {
.listGroup-item a:hover {
color: $accent-fire;
}
.category-count {
.categoryCount {
background-color: rgba(255, 100, 0, 0.1);
color: $accent-fire;
padding: 2px 8px;
@@ -267,7 +204,7 @@
}
/* Recent posts in sidebar */
.recent-post-item {
.recentPostItem {
display: flex;
align-items: center;
gap: 10px;
@@ -276,65 +213,65 @@
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.recent-post-item:last-child {
.recentPostItem:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.recent-post-thumb {
.recentPostThumb {
width: 60px;
height: 60px;
border-radius: 4px;
object-fit: cover;
}
.recent-post-info {
.recentPostInfo {
flex-grow: 1;
}
.recent-post-title {
.recentPostTitle {
font-size: 0.9rem;
line-height: 1.4;
margin-bottom: 5px;
}
.recent-post-title a {
.recentPostTitle a {
color: $text-ash;
text-decoration: none;
transition: color 0.3s;
}
.recent-post-title a:hover {
.recentPostTitle a:hover {
color: $accent-fire;
}
.recent-post-date {
.recentPostDate {
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.5);
}
/* Pagination */
.page-item .page-link {
.pageItem .pageLink {
background-color: $card-bg;
border-color: $card-border;
color: $text-ash;
}
.page-item .page-link:hover {
.pageItem .pageLink:hover {
background-color: rgba(255, 100, 0, 0.1);
color: $accent-fire;
border-color: $accent-fire;
}
.page-item.active .page-link {
.pageItem.active .pageLink {
background-color: $accent-fire;
border-color: $accent-fire;
color: $text-light;
}
/* Binary background effect */
.binary-line {
.binaryLine {
position: absolute;
font-family: 'Fira Code', monospace;
color: $accent-fire;
+95
View File
@@ -0,0 +1,95 @@
@use "./variables.scss" as *;
@use "./Blog.module.scss" as Blog;
@include Blog.metaItem;
@include Blog.metaIcon;
@include Blog.readMore;
@include Blog.postTag;
/* Card styling */
.card {
background-color: $card-bg;
border: 1px solid $card-border;
border-radius: 8px;
transition: all 0.3s ease;
margin-bottom: 1.5rem;
overflow: hidden;
}
.card:hover {
transform: translateY(-5px);
border-color: rgba(255, 100, 0, 0.3);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.cardImgTop {
height: 200px;
object-fit: cover;
}
.featuredImg {
height: 300px;
}
.cardTitle {
font-size: 1.5rem;
margin-bottom: 0.75rem;
}
.cardTitle a {
color: $text-light;
text-decoration: none;
transition: color 0.3s;
}
.cardTitle a:hover {
color: $accent-fire;
}
.cardText {
color: $text-ash;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
}
.featuredCard .cardTitle {
font-size: 1.8rem;
}
.cardFooter {
background-color: rgba(0, 0, 0, 0.2);
border-top: 1px solid $card-border;
}
/* Category badges */
.categoryBadge {
position: absolute;
top: 1rem;
right: 1rem;
background-color: rgba(139, 0, 0, 0.9);
color: $text-light;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
}
.featuredBadge {
position: absolute;
top: 1rem;
left: 1rem;
background: linear-gradient(45deg, $accent-dragon, $accent-fire);
color: $text-light;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
display: flex;
align-items: center;
gap: 5px;
}
+1 -1
View File
@@ -73,7 +73,7 @@
color: $accent-fire;
font-size: 1rem;
animation: fall linear infinite;
opacity: 0.7;
opacity: 0.8;
}
@keyframes fall {