Skip to content

Commit eac78e7

Browse files
committed
"Refactor hero and code demo styles for improved layout and responsiveness"
1 parent a4f1b21 commit eac78e7

1 file changed

Lines changed: 44 additions & 19 deletions

File tree

styles/home.css

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -510,27 +510,18 @@ aside.tips .social-media .icon-twitter {
510510
}
511511

512512
.code-content {
513-
position: relative;
514-
height: 440px;
515-
overflow: hidden;
513+
display: flex;
514+
flex-direction: column;
516515
}
517516

518517
.code-demo {
519-
position: absolute;
520-
top: 0;
521-
left: 0;
522-
right: 0;
523-
bottom: 0;
524518
padding: 1.5rem;
525-
opacity: 0;
526-
transform: translateX(20px);
527-
transition: all 0.4s ease;
528519
text-align: left;
520+
display: none;
529521
}
530522

531523
.code-demo.active {
532-
opacity: 1;
533-
transform: translateX(0);
524+
display: block;
534525
}
535526

536527
.code-demo pre {
@@ -603,7 +594,7 @@ aside.tips .social-media .icon-twitter {
603594
.hero-container,
604595
.versions-container,
605596
.content-container {
606-
padding: 0 clamp(1rem, 3vw, 2rem);
597+
padding: 1em clamp(1rem, 3vw, 2rem);
607598
}
608599
}
609600

@@ -641,6 +632,24 @@ aside.tips .social-media .icon-twitter {
641632
}
642633
}
643634

635+
@media (max-width: 1135px) and (min-width: 884px) {
636+
.hero-content {
637+
grid-template-columns: 1fr 1fr;
638+
gap: 2rem;
639+
text-align: left;
640+
}
641+
642+
.code-dots {
643+
display: none;
644+
}
645+
646+
.hero-actions a {
647+
display: block;
648+
width: 100%;
649+
text-align: center;
650+
}
651+
}
652+
644653
@media (max-width: 768px) {
645654
.modern-hero {
646655
min-height: auto;
@@ -669,7 +678,6 @@ aside.tips .social-media .icon-twitter {
669678

670679
.btn-primary, .btn-secondary {
671680
width: 100%;
672-
max-width: 300px;
673681
justify-content: center;
674682
}
675683

@@ -693,10 +701,6 @@ aside.tips .social-media .icon-twitter {
693701
font-size: 1rem;
694702
}
695703

696-
.code-content {
697-
height: 585px;
698-
}
699-
700704
.code-actions {
701705
flex-direction: column;
702706
gap: 0.25rem;
@@ -768,3 +772,24 @@ aside.tips .social-media .icon-twitter {
768772
height: 28px;
769773
}
770774
}
775+
776+
@media (max-width: 375px) {
777+
.hero-content {
778+
grid-template-columns: 1fr;
779+
}
780+
781+
#intro .container {
782+
padding: 0;
783+
display: block;
784+
}
785+
}
786+
787+
@media (max-width: 320px) {
788+
.hero-content {
789+
grid-template-columns: 1fr 1fr;
790+
}
791+
792+
.hero-code-demo {
793+
display: none;
794+
}
795+
}

0 commit comments

Comments
 (0)