Skip to content

Commit 4546105

Browse files
committed
fix frontpage feature card scaling
1 parent 963c07f commit 4546105

File tree

4 files changed

+82
-29
lines changed

4 files changed

+82
-29
lines changed

src/components/featurelist/FeatureList.astro

+39-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
import { processMarkdown } from "@config/io/markdown";
33
4-
let codeString = `\`\`\`qml
4+
const codeDesktop = await processMarkdown(`\`\`\`qml
55
// a standard desktop window
66
FloatingWindow {
77
Timer {
8-
id: timer // give the timer a name to refer to it by
9-
property bool invert: false // our custom property
8+
// assign an id to the object, which can be
9+
// used to reference it
10+
id: timer
11+
property bool invert: false // a custom property
1012
1113
// change the value of invert every half second
1214
running: true; repeat: true
@@ -17,10 +19,35 @@ FloatingWindow {
1719
// change the window's color when timer.invert changes
1820
color: timer.invert ? "purple" : "green"
1921
}
20-
\`\`\`
21-
`;
22+
\`\`\``);
2223
23-
const codeHTML = await processMarkdown(codeString);
24+
const codeMobile = await processMarkdown(`\`\`\`qml
25+
// a standard desktop window
26+
FloatingWindow {
27+
Timer {
28+
// assign an id to the
29+
// object, which can be
30+
// used to reference it
31+
id: timer
32+
// a custom property
33+
property bool invert: false
34+
35+
// change the value of invert
36+
// every half second
37+
running: true; repeat: true
38+
interval: 500 // ms
39+
onTriggered: {
40+
timer.invert = !timer.invert
41+
}
42+
}
43+
44+
// change the window's color
45+
// when timer.invert changes
46+
color: timer.invert
47+
? "purple"
48+
: "green"
49+
}
50+
\`\`\``);
2451
---
2552
<ul class="featurelist">
2653
<li class="featurelist-item hot-reloading left">
@@ -45,7 +72,12 @@ const codeHTML = await processMarkdown(codeString);
4572
</span>
4673
</section>
4774
<section class="feature-showcase" id="qml-showcase">
48-
<Fragment set:html={codeHTML}/>
75+
<div class="showcase-desktop">
76+
<Fragment set:html={codeDesktop}/>
77+
</div>
78+
<div class="showcase-mobile">
79+
<Fragment set:html={codeMobile}/>
80+
</div>
4981
</section>
5082
</li>
5183
<li class="featurelist-item cloud-li left">

src/styles/components/featurelist.css

+41-20
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
margin-block: 0.618rem;
1919
border-radius: 9px;
2020
background-color: hsl(var(--blue) 60 98);
21-
padding-inline: 0.618rem;
22-
padding-block: 1.217rem;
21+
padding: 0.618rem;
2322
border: 1px solid hsl(var(--blue) 9 75);
2423
&::before {
2524
content: "";
@@ -47,6 +46,7 @@ html.dark .featurelist-item {
4746
}
4847

4948
.feature-text {
49+
margin: 1rem 0;
5050
text-align: center;
5151
font-size: 1.2rem;
5252
& .feature-title {
@@ -64,21 +64,37 @@ html.dark .feature-text {
6464
}
6565

6666
.feature-showcase {
67-
max-width: 75svw;
67+
width: 100%;
6868
max-height: min-content;
69-
height: 15rem;
7069
display: flex;
7170
justify-content: center;
7271

7372
& video {
74-
scale: 0.85;
73+
width: 100%;
7574
aspect-ratio: 16 / 9;
7675
border-radius: 0.681rem;
7776
}
7877

7978
& .shiki {
8079
margin-block: unset;
81-
font-size: 0.55rem;
80+
width: 100%;
81+
height: 100%;
82+
/*font-size: 0.55rem;*/
83+
}
84+
85+
& .showcase-desktop {
86+
width: 100%;
87+
height: 100%;
88+
display: none;
89+
}
90+
91+
& .showcase-mobile {
92+
width: 100%;
93+
height: 100%;
94+
}
95+
96+
&.cloud {
97+
overflow: clip;
8298
}
8399
}
84100

@@ -92,11 +108,12 @@ html:not(.dark) .feature-showcase .shiki span {
92108
margin: auto;
93109
max-width: 21.5rem;
94110
height: 100%;
111+
min-height: 20rem;
112+
margin-bottom: 1rem;
95113
animation: spin 40s linear infinite;
96114

97115
& .cloud-item {
98116
position: absolute;
99-
scale: 0.8;
100117
&.wayland {
101118
transform: translate(-50%, 0);
102119
}
@@ -127,8 +144,8 @@ html:not(.dark) .feature-showcase .shiki span {
127144
& img,
128145
svg {
129146
animation: counter-spin 40s linear infinite;
130-
width: 60px;
131-
height: 60px;
147+
width: 80px;
148+
height: 80px;
132149
}
133150
left: 50%;
134151
height: 100%;
@@ -153,13 +170,19 @@ html:not(.dark) .feature-showcase .shiki span {
153170
}
154171
}
155172

156-
@media (min-width: 40rem) {
173+
@media (min-width: 34rem) {
157174
.feature-showcase {
158-
height: 21rem;
175+
& .showcase-desktop {
176+
display: unset;
177+
}
178+
179+
& .showcase-mobile {
180+
display: none;
181+
}
159182
}
160183
}
161184

162-
@media (min-width: 68rem) {
185+
@media (min-width: 63rem) {
163186
.featurelist {
164187
max-width: 75rem;
165188
margin: 1rem 1.618rem;
@@ -179,6 +202,9 @@ html:not(.dark) .feature-showcase .shiki span {
179202
.featurelist-item.right {
180203
flex-direction: row-reverse;
181204
}
205+
.feature-showcase {
206+
height: 22rem;
207+
}
182208
.feature-text {
183209
text-align: left;
184210
}
@@ -189,15 +215,10 @@ html:not(.dark) .feature-showcase .shiki span {
189215
scale: 1;
190216
}
191217
& .shiki {
192-
font-size: 1rem;
218+
font-size: 0.93rem;
193219
}
194-
& .cloud-item {
195-
scale: 1;
196-
& img,
197-
svg {
198-
width: 80px;
199-
height: 80px;
200-
}
220+
.feature-cloud {
221+
margin-bottom: 0;
201222
}
202223
}
203224
}

src/styles/components/marquee.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848

4949
.marquee-item-spacing {
50-
width: 75svw;
50+
width: calc(100svw - 12rem);
5151
max-width: 75rem;
5252
aspect-ratio: 16 / 9;
5353
display: flex;

src/styles/main-page.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ html.dark .main-page_link-card {
180180
}
181181
}
182182

183-
@media (min-width: 68rem) {
183+
@media (min-width: 63rem) {
184184
.main-page_links {
185185
flex-wrap: nowrap;
186186
max-width: 78rem;

0 commit comments

Comments
 (0)