KaibanJS-Blog-Posts / style.css
AnthonyAlex
Refactor index.html and style.css for improved layout and design. Enhanced background effects, updated article presentation, and added responsive styles for better user experience.
6b5a30e
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, sans-serif;
background: #0f172a;
min-height: 100vh;
padding: 2rem 1rem;
line-height: 1.6;
color: #333;
position: relative;
overflow-x: hidden;
}
/* Background Effects */
.bg-grid {
position: absolute;
z-index: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.4;
overflow: hidden;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0;
transform: translateX(-13rem);
pointer-events: none;
}
.bg-blur {
width: 100%;
height: 9rem;
filter: blur(106px);
border-radius: 50%;
}
.bg-blur-cyan {
margin-left: -13rem;
}
.bg-blur-purple {
background: linear-gradient(to bottom right, #a855f7, #c084fc);
}
.bg-blur-cyan {
background: linear-gradient(to right, #06b6d4, #0ea5e9);
}
.bg-polygon {
position: absolute;
left: 0;
right: 0;
top: calc(100% - 13rem);
z-index: -10;
transform: translate3d(0, 0, 0);
overflow: hidden;
pointer-events: none;
}
@media (min-width: 640px) {
.bg-polygon {
top: calc(100% - 30rem);
}
}
.bg-polygon-shape {
position: relative;
left: calc(50% + 3rem);
aspect-ratio: 1155 / 678;
width: 36.125rem;
transform: translateX(-50%);
background: linear-gradient(to top right, #ff80b5, #9089fc);
opacity: 0.3;
clip-path: polygon(
74.1% 44.1%,
100% 61.6%,
97.5% 26.9%,
85.5% 0.1%,
80.7% 2%,
72.5% 32.5%,
60.2% 62.4%,
52.4% 68.1%,
47.5% 58.3%,
45.2% 34.5%,
27.5% 76.7%,
0.1% 64.9%,
17.9% 100%,
27.6% 76.8%,
76.1% 97.7%,
74.1% 44.1%
);
filter: blur(3rem);
}
@media (min-width: 640px) {
.bg-polygon-shape {
left: calc(50% + 36rem);
width: 72.1875rem;
}
}
.bg-pattern {
position: absolute;
z-index: 10;
top: 0;
right: 0;
bottom: 0;
left: 0;
mask-image: linear-gradient(to bottom, transparent, black);
-webkit-mask-image: linear-gradient(to bottom, transparent, black);
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(15 23 42 / 0.04)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
pointer-events: none;
}
.container {
max-width: 1400px;
margin: 0 auto;
position: relative;
z-index: 1;
}
.header {
text-align: center;
margin-bottom: 3rem;
color: white;
position: relative;
z-index: 2;
}
.header h1 {
font-size: 3rem;
font-weight: 700;
margin-bottom: 1rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
letter-spacing: -0.02em;
}
.subtitle {
font-size: 1.25rem;
opacity: 0.95;
font-weight: 300;
max-width: 600px;
margin: 0 auto;
}
.articles-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 2rem;
margin-top: 2rem;
position: relative;
z-index: 2;
}
.article-card {
background: white;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
display: flex;
flex-direction: column;
height: 100%;
}
.article-card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.article-image {
width: 100%;
height: 200px;
overflow: hidden;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
position: relative;
}
.article-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.article-card:hover .article-image img {
transform: scale(1.1);
}
.article-content {
padding: 1.5rem;
flex: 1;
display: flex;
flex-direction: column;
}
.article-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 1rem;
color: #1a202c;
line-height: 1.4;
flex: 1;
}
.article-meta {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.25rem;
font-size: 0.875rem;
color: #718096;
flex-wrap: wrap;
}
.author {
display: flex;
align-items: center;
font-weight: 500;
}
.author::before {
content: 'πŸ‘€';
margin-right: 0.5rem;
font-size: 1rem;
}
.date {
display: flex;
align-items: center;
}
.date::before {
content: 'πŸ“…';
margin-right: 0.5rem;
font-size: 1rem;
}
.read-link {
display: inline-flex;
align-items: center;
padding: 0.75rem 1.5rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
text-decoration: none;
border-radius: 8px;
font-weight: 600;
font-size: 0.9375rem;
transition: all 0.3s ease;
margin-top: auto;
width: fit-content;
}
.read-link:hover {
background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
transform: translateX(4px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.read-link:active {
transform: translateX(2px);
}
/* Responsive Design */
@media (max-width: 768px) {
.header h1 {
font-size: 2rem;
}
.subtitle {
font-size: 1rem;
}
.articles-grid {
grid-template-columns: 1fr;
gap: 1.5rem;
}
.article-card {
border-radius: 12px;
}
.article-image {
height: 180px;
}
.article-content {
padding: 1.25rem;
}
.article-title {
font-size: 1.125rem;
}
}
@media (max-width: 480px) {
body {
padding: 1rem 0.5rem;
}
.header {
margin-bottom: 2rem;
}
.header h1 {
font-size: 1.75rem;
}
.article-meta {
font-size: 0.8125rem;
}
.read-link {
padding: 0.625rem 1.25rem;
font-size: 0.875rem;
}
}
/* Smooth scrolling */
html {
scroll-behavior: smooth;
}
/* Loading state for images */
.article-image img {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
.article-image img[src] {
animation: none;
}