Skip to content

Commit

Permalink
home page set up
Browse files Browse the repository at this point in the history
  • Loading branch information
Kennybabs-py committed Dec 7, 2022
1 parent d9bd7a8 commit 79d7a3c
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 5 deletions.
23 changes: 23 additions & 0 deletions components/header/header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.header {
position: fixed;
top: 5px;
width: 100%;
backdrop-filter: blur(5px);
}

.header .container {
width: 95%;
margin: 0 auto;
padding: 5px 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50px;
box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
}

.header .container span {
font-size: 2rem;
font-weight: 600;
color: var(--color-grey);
}
14 changes: 14 additions & 0 deletions components/header/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import styles from "./header.module.css";

function Header() {
return (
<header className={styles.header}>
<div className={styles.container}>
<span>switch</span>
</div>
</header>
);
}

export default Header;
4 changes: 3 additions & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Head from "next/head";
import "../styles/globals.css";

import Header from "../components/header";

function MyApp({ Component, pageProps }) {
return (
<>
Expand All @@ -9,7 +11,7 @@ function MyApp({ Component, pageProps }) {
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<Header />
<Component {...pageProps} />
</>
);
Expand Down
9 changes: 6 additions & 3 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import Link from "next/link";
import styles from "../styles/Home.module.css";

export default function Home() {
return (
<main className={styles.main}>
<h1>Welcome to SWITCH</h1>
<div className={styles.container}>
<h1>Welcome to Switch</h1>

<div className="button">
<button>View products</button>
<div className={styles.view_button}>
<Link href="/">View products</Link>
</div>
</div>
</main>
);
Expand Down
30 changes: 30 additions & 0 deletions styles/Home.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.main {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}

.main .container {
width: 90%;
max-width: 700px;
display: flex;
align-items: center;
justify-content: flex-start;
flex-flow: column;
gap: 3rem;
}

.main .container h1 {
color: var(--color-grey);
font-weight: 500;
font-size: clamp(1.2rem, 2.5vw, 3rem);
}

.view_button a {
padding: 10px 15px;
background: var(--color-grey);
color: #fff;
border-radius: 5px;
}
6 changes: 5 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ body {
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

:root {
--color-grey: #808080;
}

a,
input {
outline: none;
Expand All @@ -22,7 +26,7 @@ input {
box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
@media (prefers-color-scheme: light) {
html {
color-scheme: dark;
}
Expand Down

0 comments on commit 79d7a3c

Please sign in to comment.