fix frontpage feature card scaling

This commit is contained in:
outfoxxed 2024-11-08 23:36:03 -08:00
parent 963c07f464
commit 4546105f21
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 82 additions and 29 deletions

View file

@ -1,12 +1,14 @@
--- ---
import { processMarkdown } from "@config/io/markdown"; import { processMarkdown } from "@config/io/markdown";
let codeString = `\`\`\`qml const codeDesktop = await processMarkdown(`\`\`\`qml
// a standard desktop window // a standard desktop window
FloatingWindow { FloatingWindow {
Timer { Timer {
id: timer // give the timer a name to refer to it by // assign an id to the object, which can be
property bool invert: false // our custom property // used to reference it
id: timer
property bool invert: false // a custom property
// change the value of invert every half second // change the value of invert every half second
running: true; repeat: true running: true; repeat: true
@ -17,10 +19,35 @@ FloatingWindow {
// change the window's color when timer.invert changes // change the window's color when timer.invert changes
color: timer.invert ? "purple" : "green" color: timer.invert ? "purple" : "green"
} }
\`\`\` \`\`\``);
`;
const codeHTML = await processMarkdown(codeString); const codeMobile = await processMarkdown(`\`\`\`qml
// a standard desktop window
FloatingWindow {
Timer {
// assign an id to the
// object, which can be
// used to reference it
id: timer
// a custom property
property bool invert: false
// change the value of invert
// every half second
running: true; repeat: true
interval: 500 // ms
onTriggered: {
timer.invert = !timer.invert
}
}
// change the window's color
// when timer.invert changes
color: timer.invert
? "purple"
: "green"
}
\`\`\``);
--- ---
<ul class="featurelist"> <ul class="featurelist">
<li class="featurelist-item hot-reloading left"> <li class="featurelist-item hot-reloading left">
@ -45,7 +72,12 @@ const codeHTML = await processMarkdown(codeString);
</span> </span>
</section> </section>
<section class="feature-showcase" id="qml-showcase"> <section class="feature-showcase" id="qml-showcase">
<Fragment set:html={codeHTML}/> <div class="showcase-desktop">
<Fragment set:html={codeDesktop}/>
</div>
<div class="showcase-mobile">
<Fragment set:html={codeMobile}/>
</div>
</section> </section>
</li> </li>
<li class="featurelist-item cloud-li left"> <li class="featurelist-item cloud-li left">

View file

@ -18,8 +18,7 @@
margin-block: 0.618rem; margin-block: 0.618rem;
border-radius: 9px; border-radius: 9px;
background-color: hsl(var(--blue) 60 98); background-color: hsl(var(--blue) 60 98);
padding-inline: 0.618rem; padding: 0.618rem;
padding-block: 1.217rem;
border: 1px solid hsl(var(--blue) 9 75); border: 1px solid hsl(var(--blue) 9 75);
&::before { &::before {
content: ""; content: "";
@ -47,6 +46,7 @@ html.dark .featurelist-item {
} }
.feature-text { .feature-text {
margin: 1rem 0;
text-align: center; text-align: center;
font-size: 1.2rem; font-size: 1.2rem;
& .feature-title { & .feature-title {
@ -64,21 +64,37 @@ html.dark .feature-text {
} }
.feature-showcase { .feature-showcase {
max-width: 75svw; width: 100%;
max-height: min-content; max-height: min-content;
height: 15rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
& video { & video {
scale: 0.85; width: 100%;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
border-radius: 0.681rem; border-radius: 0.681rem;
} }
& .shiki { & .shiki {
margin-block: unset; margin-block: unset;
font-size: 0.55rem; width: 100%;
height: 100%;
/*font-size: 0.55rem;*/
}
& .showcase-desktop {
width: 100%;
height: 100%;
display: none;
}
& .showcase-mobile {
width: 100%;
height: 100%;
}
&.cloud {
overflow: clip;
} }
} }
@ -92,11 +108,12 @@ html:not(.dark) .feature-showcase .shiki span {
margin: auto; margin: auto;
max-width: 21.5rem; max-width: 21.5rem;
height: 100%; height: 100%;
min-height: 20rem;
margin-bottom: 1rem;
animation: spin 40s linear infinite; animation: spin 40s linear infinite;
& .cloud-item { & .cloud-item {
position: absolute; position: absolute;
scale: 0.8;
&.wayland { &.wayland {
transform: translate(-50%, 0); transform: translate(-50%, 0);
} }
@ -127,8 +144,8 @@ html:not(.dark) .feature-showcase .shiki span {
& img, & img,
svg { svg {
animation: counter-spin 40s linear infinite; animation: counter-spin 40s linear infinite;
width: 60px; width: 80px;
height: 60px; height: 80px;
} }
left: 50%; left: 50%;
height: 100%; height: 100%;
@ -153,13 +170,19 @@ html:not(.dark) .feature-showcase .shiki span {
} }
} }
@media (min-width: 40rem) { @media (min-width: 34rem) {
.feature-showcase { .feature-showcase {
height: 21rem; & .showcase-desktop {
display: unset;
}
& .showcase-mobile {
display: none;
}
} }
} }
@media (min-width: 68rem) { @media (min-width: 63rem) {
.featurelist { .featurelist {
max-width: 75rem; max-width: 75rem;
margin: 1rem 1.618rem; margin: 1rem 1.618rem;
@ -179,6 +202,9 @@ html:not(.dark) .feature-showcase .shiki span {
.featurelist-item.right { .featurelist-item.right {
flex-direction: row-reverse; flex-direction: row-reverse;
} }
.feature-showcase {
height: 22rem;
}
.feature-text { .feature-text {
text-align: left; text-align: left;
} }
@ -189,15 +215,10 @@ html:not(.dark) .feature-showcase .shiki span {
scale: 1; scale: 1;
} }
& .shiki { & .shiki {
font-size: 1rem; font-size: 0.93rem;
} }
& .cloud-item { .feature-cloud {
scale: 1; margin-bottom: 0;
& img,
svg {
width: 80px;
height: 80px;
}
} }
} }
} }

View file

@ -47,7 +47,7 @@
} }
.marquee-item-spacing { .marquee-item-spacing {
width: 75svw; width: calc(100svw - 12rem);
max-width: 75rem; max-width: 75rem;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
display: flex; display: flex;

View file

@ -180,7 +180,7 @@ html.dark .main-page_link-card {
} }
} }
@media (min-width: 68rem) { @media (min-width: 63rem) {
.main-page_links { .main-page_links {
flex-wrap: nowrap; flex-wrap: nowrap;
max-width: 78rem; max-width: 78rem;