Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

styles: updates the home page #93

Merged
merged 15 commits into from
Oct 9, 2024
26 changes: 26 additions & 0 deletions app/components/HomePage/HomePage.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.column{
display: flex;
flex-direction: column;
gap: 0.5em;
}

.HomePageLinks{
width: 440px;
display: flex;
justify-content:center;
align-items: center;
gap: 4em;
position: relative;
margin-top: 2em;
color: hsl(var(--primary));
}

.HomePageLinkTitle{
text-decoration: underline;
text-underline-offset: 0.15em;
text-decoration-color: hsl(var(--primary) / 0.3);
}

.HomePageLinkTitle:hover {
text-decoration-color: hsl(var(--primary));
}
32 changes: 32 additions & 0 deletions app/components/HomePage/HomePage.tsx
Copy link
Member

@JeelRajodiya JeelRajodiya Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Great, can you please use CSS grid of 4 rows each, this can make the links dynamic, incase we need to add more additional chapters we won't need to modify this component.

This video can help: https://www.youtube.com/watch?v=705XCEruZFs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks I will do it once the design is finalized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey i tried using grid, but the thing is it fills row wise. So the outcome will look like
1.Getting Started 2.PrimitiveTypes
and then from next line. So i have modified the previous code such that if we add additional chapters it works fine.

Copy link
Member

@JeelRajodiya JeelRajodiya Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can resolve the row wise filling issue using the grid-auto-flow CSS property. Let me know if that does not work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that property is not working as desired

Copy link
Member

@JeelRajodiya JeelRajodiya Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay. You can continue working on the rest of the design.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { contentManager } from "@/lib/contentManager"
import styles from "./HomePage.module.css"
import Link from "next/link"

export default function () {
const outline = contentManager.getOutline()

const half = Math.ceil(outline.length / 2)
const firstColumn = outline.slice(0, half)
const secondColumn = outline.slice(half)

return (
<div className={styles.HomePageLinks}>
<div className={styles.column}>
{firstColumn.map((ele, index) => (
<Link key={index} className={styles.HomePageLink} href={contentManager.getPathWithPrefix(ele.steps[0].fullPath) as string}>
<span>{index + 1}. </span>
<span className={styles.HomePageLinkTitle}>{ele.title}</span>
</Link>
))}
</div>
<div className={styles.column}>
{secondColumn.map((ele, index) => (
<Link key={index + half + 1} className={styles.HomePageLink} href={contentManager.getPathWithPrefix(ele.steps[0].fullPath) as string}>
<span>{index + half + 1}. </span>
<span className={styles.HomePageLinkTitle}>{ele.title}</span>
</Link>
))}
</div>
</div>
)
}
1 change: 1 addition & 0 deletions app/components/HomePage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {default as default} from "./HomePage"
19 changes: 3 additions & 16 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import styles from "./styles/page.module.css";
import Link from "next/link";
import cx from "classnames";
import { interFont, outfitFont } from "./styles/fonts";
import RightArrow from "./styles/icons/RightArrow";
import CompanyLogos from "./components/CommunityLinks/CommunityLinks";
import { contentManager } from "@/lib/contentManager";
import HomePage from "./components/HomePage/HomePage";

export default function Home() {
const outline = contentManager.getOutline();
return (
<div className={cx(styles.main, outfitFont.className)}>
<div className={styles.background}></div>
<div className={styles.wrapper}>
<div className={styles.titleWrapper}>
<div className={styles.title}>
Expand All @@ -25,18 +23,7 @@ export default function Home() {
</div>
</div>
</div>
<Link
href={
contentManager.getPathWithPrefix(
outline[0].steps[0].fullPath,
) as string
}
>
<button className={styles.mainBtn}>
START NOW
<RightArrow />
</button>
</Link>
<HomePage/>
</div>
<div className={styles.footer}>
<div className={cx(styles.footerText, interFont.className)}>
Expand Down
4 changes: 4 additions & 0 deletions app/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ html {
--link-color-light: 240 100% 50%;
--error-light: 0 100% 50%;
--success-light: 120 50% 50%;
--backgroundImage-light: 232 66% 50%;

/* Dark Mode colors */

Expand All @@ -43,6 +44,7 @@ html {
--link-color-dark: 240 100% 87%;
--error-dark: 0 100% 50%;
--success-dark: 120 90% 45%;
--backgroundImage-dark: 232 78% 35%;
}

:root[data-theme="dark"] {
Expand All @@ -54,6 +56,7 @@ html {
--primary: var(--primary-dark);
--error: var(--error-dark);
--success: var(--success-dark);
--backgroundImage: var(--backgroundImage-dark)
}

:root[data-theme="light"] {
Expand All @@ -65,6 +68,7 @@ html {
--primary: var(--primary-light);
--error: var(--error-light);
--success: var(--success-light);
--backgroundImage: var(--backgroundImage-light)
}

/* html[data-theme="dark"] svg {
Expand Down
22 changes: 16 additions & 6 deletions app/styles/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@
display: flex;
flex-direction: column;
height: inherit;

position: relative;
justify-content: space-between;
align-items: center;
overflow-x: hidden;
overflow-y: hidden;
}

.background {
position: absolute;
background-color: hsl(var(--backgroundImage));
top: -9em;
height: 640px;
width: 120%;
rotate: -8.17deg;
z-index: -1;
overflow: hidden;
}

.wrapper {
Expand All @@ -14,6 +27,7 @@
gap: 64px;
justify-content: center;
align-items: center;
color: white;
}

.titleWrapper {
Expand All @@ -24,19 +38,17 @@
}
.title {
font-size: 6rem;
font-weight: 900;
font-weight: 800;
display: flex;
flex-direction: column;
gap: 0px;
text-shadow: 4px 4px 2px rgba(0, 0, 0, 0.25);
}

.title > div {
line-height: 115%;
letter-spacing: -2px;
}
.jsonSchemaTitle {
color: hsl(var(--primary));
text-decoration: underline;
text-decoration-thickness: 0.075em;
/* add some gap between the underline and text */
Expand All @@ -52,8 +64,6 @@
}
.subtitle2 {
font-size: 1.3rem;

color: hsl(var(--text) / 0.5);
}
.subtitleWrapper {
display: flex;
Expand Down