Skip to content

Commit 7107eaa

Browse files
authored
fix(doc): improve responsive design (#395)
Co-authored-by: jeremydolle <[email protected]>
1 parent 583905e commit 7107eaa

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

documentation/src/components/Quickstart.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import CodeBlock from '@theme/CodeBlock';
44

55
export default function Quickstart() {
66
return (
7-
<section className="relative flex justify-end bg-red-400 mb-0 pb-10 sm:-mb-[170px] sm:-mb-[100px] lg:-mb-[270px]">
7+
<section className="relative flex justify-end bg-red-400 mb-0 pb-10 sm:-mb-[100px] lg:-mb-[270px]">
88
<div className="relative max-w-7xl m-auto">
99
<div className="relative flex justify-end">
1010

1111
<div className="absolute bottom-0 sm:top-1/2 right-0">
1212
<Circles color="red" animate="animate-circle-delay-1" />
1313
</div>
1414

15-
<div className="relative sm:absolute sm:left-16 sm:-top-5 w-full sm:w-[60%] p-5 sm:p-2">
15+
<div className="relative w-[320px] sm:absolute sm:left-16 sm:-top-5 sm:w-[62%] p-5 sm:p-2">
1616

1717
<h2 className="font-bold text-3xl font-black text-white w-full mb-5 sm:mb-10">
1818
Quickstart -
19-
<span className="w-full sm:w-auto text-sm font-normal text-red-800 ml-3"> Open your terminal and run the following </span>
19+
<span className="hidden sm:block w-full sm:w-auto text-sm font-normal text-red-800 ml-3"> Open your terminal and run the following </span>
2020
</h2>
2121

2222
<CodeBlock
@@ -26,6 +26,7 @@ export default function Quickstart() {
2626
npx react-native@latest init MyApp --template
2727
@thecodingmachine/react-native-boilerplate
2828
</CodeBlock>
29+
2930
<div>
3031
<button
3132
type="button"
@@ -40,13 +41,13 @@ export default function Quickstart() {
4041
</div>
4142

4243
<img
43-
className="pointer-events-none hidden dark:sm:block w-3/4 md:w-[70%] 2xl:w-[85%] lg:w-2/3 mr-0 translate-x-[27%] md:translate-x-[20%] lg:translate-x-[15%] 2xl:translate-x-[28%] -translate-y-[43%]"
44+
className="pointer-events-none hidden dark:block object-contain absolute -top-6 w-[400px] sm:relative dark:sm:block sm:w-3/4 sm:left-3 md:w-[70%] 2xl:w-[85%] lg:w-2/3 mr-0 translate-x-[27%] md:translate-x-[20%] lg:translate-x-[15%] 2xl:translate-x-[28%] -translate-y-[43%]"
4445
src="./img/phone_dark.png"
4546
alt="phone"
4647
/>
4748

4849
<img
49-
className="dark:hidden pointer-events-none hidden sm:block w-3/4 md:w-[70%] 2xl:w-[85%] lg:w-2/3 mr-0 translate-x-[27%] md:translate-x-[20%] lg:translate-x-[15%] 2xl:translate-x-[28%] -translate-y-[43%]"
50+
className="dark:hidden pointer-events-none object-contain absolute -top-6 w-[400px] sm:relative sm:block sm:w-3/4 md:w-[70%] 2xl:w-[85%] lg:w-2/3 mr-0 translate-x-[27%] md:translate-x-[20%] lg:translate-x-[15%] 2xl:translate-x-[28%] -translate-y-[43%]"
5051
src="./img/phone_light.png"
5152
alt="phone"
5253
/>

documentation/src/pages/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ function HomepageHeader() {
1111

1212
return (
1313
<header>
14-
<div className="mt-10 pt-0 md:pt-28 md:pt-0 -ml-5 md:ml-auto flex justify-end top-10 right-12 md:top-auto md:left-auto md:justify-center absolute w-full md:w-1/3 top-20 m-auto md:right-20">
14+
<div className="bottom-0 w-screen left-1/2 top-24 ml-3 mt-10 pt-0 md:pt-0 sm:-ml-5 md:ml-auto flex justify-end right-12 md:top-auto md:left-auto md:-right-12 md:justify-center absolute md:w-2/3 sm:top-20 m-auto lg:w-1/2">
15+
1516
<img
16-
className="dark:block pointer-events-none hidden dark:block z-10 w-1/4 md:w-3/4"
17+
className="dark:block pointer-events-none hidden object-contain z-10 w-full md:w-3/4"
1718
src="./img/tom_dark.png"
1819
alt="tom"
1920
/>
2021

2122
<img
22-
className="dark:hidden pointer-events-none sm:block z-10 w-1/4 md:w-3/4"
23+
className="dark:hidden pointer-events-none sm:block object-contain z-10 w-full md:w-3/4"
2324
src="./img/tom_light.png"
2425
alt="tom"
2526
/>
@@ -30,7 +31,7 @@ function HomepageHeader() {
3031
The React Native
3132
<span className="font-extralight mt-4 md:mt-8 lg:mt-0 text-[66px] sm:text-[83px] md:text-[92px] lg:text-9xl block text-red-500 dark:text-red-600">Boilerplate</span>
3233
</h1>
33-
<p className="mt-6 sm:mt-12 lg:mt-5 w-full sm:w-2/3 md:w-1/2 text-sm font-bold ml-1 text-slate-700 dark:text-white">
34+
<p className="mt-6 pr-20 sm:pr-0 sm:mt-12 lg:mt-5 w-full sm:w-2/3 md:w-1/2 text-sm font-bold ml-1 text-slate-700 dark:text-white">
3435
{siteConfig.tagline}
3536
<span className="ml-1 text-slate-400">
3637
Explore the optimal React Native boilerplate for your project,
@@ -63,7 +64,7 @@ export default function Home(): JSX.Element {
6364
description="A React Native template for building solid applications, using JavaScript or Typescript (YOU choose)."
6465
wrapperClassName="relative overflow-hidden"
6566
>
66-
<div className="relative max-w-7xl m-auto w-full">
67+
<div className="relative max-w-7xl m-auto w-full opacity-40">
6768
<div className="animate-blob opacity-80 absolute top-0 -right-10 md:top-0 md:right-0 bg-gradient-to-r from-indigo-600 via-blue-700 to-blue-400 h-[210px] w-[210px] md:h-[350px] md:w-[350px] lg:h-[382px] lg:w-[382px]" style={{ borderRadius: '30% 70% 67% 33% / 64% 30% 70% 36%' }} />
6869
<div className="animate-blob-delay-1 opacity-80 absolute top-0 right-32 md:top-[250px] md:right-1/4 lg:right-60 bg-gradient-to-r from-red-600 via-pink-700 to-pink-400 h-[180px] w-[180px] md:h-[230px] md:w-[230px] lg:h-[282px] lg:w-[282px]" style={{ borderRadius: '30% 70% 67% 33% / 64% 30% 70% 36%' }} />
6970
</div>
@@ -89,7 +90,7 @@ export default function Home(): JSX.Element {
8990
<path fill="current" fillOpacity="1" d="M0,320L60,272C120,224,240,128,360,128C480,128,600,224,720,234.7C840,245,960,171,1080,122.7C1200,75,1320,53,1380,42.7L1440,32L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z" />
9091
</svg>
9192
<Quickstart />
92-
<svg className="pointer-events-none absolute bottom-0 sm:bottom-[169px] sm:bottom-[99px] lg:bottom-[269px] w-full sm:-mt-20 fill-neutral-100 dark:fill-neutral-900" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
93+
<svg className="-mb-[1px] pointer-events-none absolute bottom-0 sm:bottom-[169px] sm:bottom-[99px] lg:bottom-[269px] w-full sm:-mt-20 fill-neutral-100 dark:fill-neutral-900" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
9394
<path fill="current" fillOpacity="1" d="M0,288L48,272C96,256,192,224,288,197.3C384,171,480,149,576,165.3C672,181,768,235,864,250.7C960,267,1056,245,1152,250.7C1248,256,1344,288,1392,304L1440,320L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z" />
9495
</svg>
9596
</main>

0 commit comments

Comments
 (0)