Skip to content

Commit 3d4ff62

Browse files
authored
Merge pull request lf-lang#208 from axmmisaka/responsive-slider
Make slider more responsive and fix button layout
2 parents cdd1d05 + 052c7de commit 3d4ff62

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

src/components/HomepageSlider/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const CodeContainer = ({
7979
</CSSTransition>
8080
</SwitchTransition>
8181
</div>
82-
<div className={clsx(styles.linkButton)}>
82+
<div className={clsx(styles.gitPodLinkButton)}>
8383
<Link href="https://gitpod.io/new#https://github.com/lf-lang/playground-lingua-franca/tree/main">
8484
<img src="https://raw.githubusercontent.com/gitpod-io/gitpod/30da76375c996109f243491b23e47feefab7217f/components/dashboard/public/button/open-in-gitpod.svg" />
8585
</Link>

src/components/HomepageSlider/styles.module.css

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.codeContainer.title {
12-
max-height: 2rem;
12+
height: auto;
1313
border-radius: 8px 8px 0 0;
1414
font-size: 1.2rem;
1515
color: white;
@@ -35,12 +35,34 @@
3535
/* Override Infima's button */
3636
}
3737

38-
.linkButton {
38+
/* Why 996? 996 is Docusaurus and Infima's breakpoint */
39+
/* If the container is extended to the full width of the screen having the advance button 1.5rem more to the right will cause layout issues. */
40+
@media only screen and (max-width: 996px) {
41+
.advance {
42+
right: 0;
43+
}
44+
}
45+
46+
.gitPodLinkButton {
3947
position: absolute;
4048
right: 1rem;
4149
top: 3rem;
4250
}
4351

52+
/* Why 575? Because Bootstrap 5 uses 575px as "xs" and 575 px looks fine with gitpod */
53+
@media only screen and (max-width: 575px) {
54+
.gitPodLinkButton {
55+
display: none;
56+
}
57+
}
58+
59+
/* For screens narrower than 256px reading code is like crap honestly */
60+
@media only screen and (max-width: 256px) {
61+
.codeContainer {
62+
display: none;
63+
}
64+
}
65+
4466
.codeContent {
4567
height: 30rem;
4668
}

src/pages/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
}
142142

143143
.buttonContainer .button:last-of-type {
144-
margin: 0px 36px;
144+
margin: 10px 18px;
145145
}
146146

147147
/* Hardcode stuff */

0 commit comments

Comments
 (0)