Skip to content

Commit cc42c32

Browse files
authored
Make the homepage responsive (#56)
1 parent cfe3567 commit cc42c32

2 files changed

Lines changed: 52 additions & 33 deletions

File tree

src/main/resources/scss/abstracts/_overrides.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
max-width: max(900px, 65vw);
44
margin-left: auto;
55
margin-right: auto;
6+
7+
@media (max-width: 970px) {
8+
max-width: none;
9+
}
610
}
711

812
pre {

src/main/resources/scss/pages/_home.scss

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
grid-template-columns: 1fr 1fr;
3939
grid-gap: 2rem;
4040
overflow: hidden;
41+
42+
@media (max-width: 970px) {
43+
display: flex;
44+
flex-direction: column;
45+
}
4146
}
4247

4348
.app-card__container {
@@ -68,19 +73,20 @@
6873
transition: var(--standard-transition);
6974
border-radius: 10px;
7075
z-index: 0;
71-
}
7276

73-
.app-card__preview svg {
74-
width: 100%;
75-
height: 100%;
76-
max-width: 40%;
77-
max-height: 40%;
78-
}
77+
svg {
78+
width: 40%;
79+
height: 40%;
80+
}
7981

80-
.app-card__preview img {
81-
height: 100%;
82-
max-width: 40%;
83-
max-height: 40%;
82+
img {
83+
position: absolute;
84+
top: 50%;
85+
left: 50%;
86+
transform: translate(-50%, -50%);
87+
max-width: 40%;
88+
max-height: max(40%, 80px)
89+
}
8490
}
8591

8692
.app-card__preview__introduction {
@@ -90,18 +96,21 @@
9096
align-items: center;
9197
justify-content: center;
9298
z-index: 1;
93-
}
9499

95-
.app-card__preview__introduction::before {
96-
content: "";
97-
position: absolute;
98-
inset: -4rem;
99-
top: -82.5%;
100-
aspect-ratio: 1;
101-
background: repeating-conic-gradient(var(--background) 0deg, rgba(100, 100, 100, 0.25) 20deg);
102-
animation: sunburst-rotation 100s infinite linear;
103-
z-index: -1;
104-
opacity: 0.2;
100+
&::before {
101+
content: "";
102+
display: inline-block;
103+
position: relative;
104+
width: 100%;
105+
margin: -10%;
106+
aspect-ratio: 1;
107+
background: repeating-conic-gradient(var(--background) 0deg, rgba(100, 100, 100, 0.25) 20deg);
108+
animation: sunburst-rotation 100s infinite linear;
109+
z-index: -1;
110+
opacity: 0.2;
111+
border-radius: 100%;
112+
flex: 1;
113+
}
105114
}
106115

107116
@keyframes sunburst-rotation {
@@ -120,6 +129,13 @@
120129
background-repeat: no-repeat;
121130
--sidebar-width: 340px;
122131
--content-width: max(900px, 65vw);
132+
133+
@media (max-width: 970px) {
134+
--sidebar-width: 0;
135+
--content-width: 100%;
136+
background-size: 100%;
137+
}
138+
123139
background-position-x: calc(var(--sidebar-width) + ((100vw - (var(--content-width) + var(--sidebar-width))) / 2));
124140
}
125141

@@ -135,37 +151,36 @@
135151
}
136152

137153
.app-card__preview::after {
138-
background-image: radial-gradient(at 40% 20%, hsla(212, 100%, 74%, 1) 0, transparent 50%),
139-
radial-gradient(at 80% 0%, hsla(13, 100%, 56%, 1) 0, transparent 50%),
140-
radial-gradient(at 0% 50%, hsla(179, 85%, 93%, 1) 0, transparent 50%),
154+
background-image: radial-gradient(at 80% 0%, hsla(13, 100%, 56%, 1) 0, transparent 50%),
155+
radial-gradient(at 0% 50%, hsl(31, 100%, 80%) 0, transparent 50%),
141156
radial-gradient(at 80% 50%, hsla(164, 100%, 76%, 1) 0, transparent 50%),
142-
radial-gradient(at 0% 100%, hsla(206, 100%, 77%, 1) 0, transparent 50%),
143-
radial-gradient(at 80% 100%, hsla(66, 100%, 70%, 1) 0, transparent 50%),
157+
radial-gradient(at 0% 100%, hsl(206, 60%, 57%) 0, transparent 50%),
158+
radial-gradient(at 80% 100%, hsl(146, 64%, 79%) 0, transparent 50%),
144159
radial-gradient(at 0% 0%, hsla(167, 100%, 76%, 1) 0, transparent 50%);
145160
animation: rotate-colors-2 10s linear infinite;
146161
}
147162

148163
@keyframes rotate-colors {
149164
0% {
150-
opacity: 0;
165+
opacity: 0.2;
151166
}
152167
50% {
153-
opacity: 0.45;
168+
opacity: 0.55;
154169
}
155170
100% {
156-
opacity: 0;
171+
opacity: 0.2;
157172
}
158173
}
159174

160175
@keyframes rotate-colors-2 {
161176
0% {
162-
opacity: 0.45;
177+
opacity: 0.55;
163178
}
164179
50% {
165-
opacity: 0;
180+
opacity: 0.1;
166181
}
167182
100% {
168-
opacity: 0.45;
183+
opacity: 0.55;
169184
}
170185
}
171186

0 commit comments

Comments
 (0)