Skip to content

Commit 73f4867

Browse files
committed
Improve mobile, add color mode button
1 parent cc08bc4 commit 73f4867

2 files changed

Lines changed: 66 additions & 13 deletions

File tree

src/pages/index.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ import React from 'react';
99
import classnames from 'classnames';
1010
import Footer from '@theme/Footer';
1111
import Link from '@docusaurus/Link';
12+
import LayoutProvider from '@theme/Layout/Provider';
13+
import ColorModeToggle from '@theme/Navbar/ColorModeToggle';
1214
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
1315
import useBaseUrl from '@docusaurus/useBaseUrl';
1416
import styles from './styles.module.css';
17+
import FooterCopyright from '@theme/Footer/Copyright';
18+
import FooterLayout from '@theme/Footer/Layout';
19+
import {useThemeConfig} from '@docusaurus/theme-common';
1520

1621
const features = [
1722
{
@@ -65,9 +70,18 @@ function Feature({imageUrl, title, description}) {
6570
function Home() {
6671
const context = useDocusaurusContext();
6772
const {siteConfig = {}} = context;
73+
const {footer} = useThemeConfig();
74+
if (!footer) {
75+
return null;
76+
}
77+
const {copyright, links, logo, style} = footer;
78+
6879
return (
69-
<div>
80+
<LayoutProvider>
7081
<header className={classnames('hero hero--primary', styles.heroBanner)}>
82+
<div className={styles.colorModeToggle}>
83+
<ColorModeToggle/>
84+
</div>
7185
<div className={classnames('container', styles.container)}>
7286
<img className={classnames(styles.hero__logo)} src="img/logo-dark.svg" alt="munus-logo"/>
7387
<h1 className={classnames('hero__title', styles.hero__title)}>{siteConfig.title}</h1>
@@ -107,13 +121,16 @@ function Home() {
107121
<div className={styles.codeExample}>
108122
<h2 className={styles.codeExampleTitle}>How it works?</h2>
109123
<div className={styles.codeExampleContainer}>
110-
<img className={styles.withoutMunus} src='img/without-munus.webp' alt='Without munus' />
111-
<img className={styles.withMunus} src='img/with-munus.webp' alt='With munus' />
124+
<img className={styles.codeExampleImage} src='img/without-munus.webp' alt='Without munus' />
125+
<img className={styles.codeExampleImage} src='img/with-munus.webp' alt='With munus' />
112126
</div>
113127
</div>
114128
</main>
115-
<Footer></Footer>
116-
</div>
129+
<FooterLayout
130+
style={style}
131+
copyright={copyright && <FooterCopyright copyright={copyright} />}
132+
/>
133+
</LayoutProvider>
117134
);
118135
}
119136

src/pages/styles.module.css

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,45 @@
1111
*/
1212

1313
.heroBanner {
14-
padding: 4rem 0;
14+
padding: 0;
1515
text-align: center;
1616
position: relative;
1717
overflow: hidden;
1818
background: url('../../static/img/bg.webp') no-repeat;
1919
background-size: cover;
20+
display: flex;
21+
flex-direction: column;
2022
}
2123

2224
@media screen and (max-width: 966px) {
2325
.heroBanner {
2426
padding: 2rem;
2527
}
28+
29+
.codeExampleImage {
30+
width: 100%;
31+
filter: drop-shadow(0px 14px 30px #00000090);
32+
}
33+
34+
.hero__logo {
35+
width: 6rem;
36+
}
37+
38+
.hero__title {
39+
font-size: 3rem!important;
40+
}
41+
42+
.hero__subtitle {
43+
font-size: 1.5rem!important;
44+
}
45+
46+
.colorModeToggle {
47+
padding: 0!important;
48+
}
49+
50+
.container {
51+
padding-top: 0!important;
52+
}
2653
}
2754

2855
.buttons {
@@ -31,6 +58,7 @@
3158
justify-content: center;
3259
gap: 1rem;
3360
padding: 1.5rem 0;
61+
flex-wrap: wrap;
3462
}
3563

3664
.features {
@@ -47,6 +75,7 @@
4775

4876
.container {
4977
max-width: 48rem;
78+
padding: 1rem 0 4rem 0;
5079
}
5180

5281
.hero__logo {
@@ -76,23 +105,23 @@
76105
border-color: #FFFFFF;
77106
}
78107

108+
.getStarted, .sourceCode {
109+
width: 13rem;
110+
}
111+
79112
.main {
80113
padding: 5rem 0;
81114
}
82115

83116
.codeExampleContainer {
84117
display: flex;
85-
align-items: flex-start;
118+
align-items: flex-end;
86119
justify-content: center;
87120
flex-direction: row;
121+
flex-wrap: wrap-reverse;
88122
}
89123

90-
.withMunus {
91-
max-width: 40rem;
92-
filter: drop-shadow(0px 14px 30px #00000090);
93-
}
94-
95-
.withoutMunus {
124+
.codeExampleImage {
96125
max-width: 40rem;
97126
filter: drop-shadow(0px 14px 30px #00000090);
98127
}
@@ -107,3 +136,10 @@
107136
font-size: 2.5rem;
108137
margin-top: 3.5rem;
109138
}
139+
140+
.colorModeToggle {
141+
width: 100%;
142+
display: flex;
143+
justify-content: right;
144+
padding: 1rem;
145+
}

0 commit comments

Comments
 (0)