Skip to content

Commit e0e522f

Browse files
committed
chore: enhance spotlight responsiveness
1 parent 1687e01 commit e0e522f

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

.changeset/pretty-oranges-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openscript-ch-website": patch
3+
---
4+
5+
Enhance spotlight responsiveness

src/components/BackgroundIcon.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ const { image, dominantColor, otherColor } = Astro.props;
2323
align-items: center;
2424
justify-content: flex-end;
2525
overflow: hidden;
26-
}
2726

28-
.background-icon img {
29-
height: 30%;
30-
object-fit: contain;
31-
z-index: 1;
27+
img {
28+
height: 30%;
29+
object-fit: contain;
30+
z-index: 1;
31+
}
3232
}
3333
</style>

src/components/Carousel.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import Sprite from "./Sprite.astro";
3939
position: absolute;
4040
inset: 0;
4141
pointer-events: none;
42-
height: 100%;
4342
padding: 0 calc(var(--size-carousel-buttons) + var(--size-gutter-big));
4443

4544
> *:not(.active) {

src/layouts/sections/SpotlightSection.astro

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@ import Carousel from "../../components/Carousel.astro";
2626
right: var(--size-page-padding);
2727
}
2828

29-
.active {
30-
display: flex;
31-
flex-direction: column;
32-
height: 100%;
29+
.carousel-overlay > div {
3330
color: var(--color-white);
3431
font-size: 1.6rem;
3532
font-weight: bold;
33+
height: 100%;
3634
padding: 0 var(--size-page-padding);
3735

36+
&.active {
37+
display: flex;
38+
flex-direction: column;
39+
}
40+
3841
&.align-center {
3942
align-items: center;
4043
justify-content: center;
@@ -67,5 +70,30 @@ import Carousel from "../../components/Carousel.astro";
6770
margin: 0;
6871
}
6972
}
73+
74+
@media screen and (max-width: 1025px) {
75+
.background-icon {
76+
align-items: flex-start;
77+
justify-content: center;
78+
79+
img {
80+
margin-inline-end: 0;
81+
margin-block-start: 10%;
82+
}
83+
}
84+
.carousel-overlay {
85+
padding-block-end: 10%;
86+
}
87+
88+
.carousel-overlay > div:is(.align-start, .align-center, .align-end) {
89+
align-items: center;
90+
justify-content: flex-end;
91+
font-size: 1.2rem;
92+
93+
> * {
94+
width: 90%;
95+
}
96+
}
97+
}
7098
}
7199
</style>

0 commit comments

Comments
 (0)