-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b88ba0
commit bff2a65
Showing
18 changed files
with
4,838 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
"use client"; | ||
|
||
import { isLoggedIn } from "@/core/helpers/authentication"; | ||
import { authUtil } from "@/core/utils/auth.util"; | ||
import { GetInitialProps } from "@/core/interfaces/page.interface"; | ||
import Link from "next/link"; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default function Home() { | ||
if (!isLoggedIn()) redirect('/login'); | ||
interface GetInitialReturnProps { | ||
authToken: string | undefined; | ||
} | ||
|
||
export default function Home(ctx: { pageProps: GetInitialReturnProps }) { | ||
return ( | ||
<main> | ||
<h1>Cardinal</h1> | ||
<h2>Tag line...</h2> | ||
<br/> | ||
<Link href="/fit-track">Fit Track</Link> | ||
</main> | ||
); | ||
} | ||
|
||
Home.getInitialProps = async (ctx: GetInitialProps): Promise<GetInitialReturnProps> => { | ||
const authToken = authUtil.getAuthToken(ctx); | ||
|
||
if (!authToken) { | ||
redirect('/login'); | ||
} | ||
|
||
return { authToken }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#landingSection { | ||
height: 100vh; | ||
} | ||
|
||
div.overlay { | ||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
z-index: -1; | ||
} | ||
|
||
#backgroundImage { | ||
background-image: url('../../../assets/rolling-hills.png'); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
} | ||
|
||
#orangeOverlay { | ||
background: #d45b4a; | ||
background: linear-gradient(65deg, #161a1d 15%, #d45b4a 50%, #e57028 100%); | ||
opacity: .9; | ||
filter: brightness(95%); | ||
} | ||
|
||
#yellowOverlay { | ||
background: #fdb358; | ||
background: radial-gradient(ellipse at right top, #fff 0%, #ffffbf 5%, #ffffbfbf 10%, #fdb35800 45%); | ||
opacity: .8; | ||
filter: brightness(120%); | ||
} | ||
|
||
#darkOverlay1 { | ||
background: #000; | ||
background: linear-gradient(0deg, #000 0%, #00000000 50%); | ||
} | ||
|
||
#darkOverlay2 { | ||
background: #000; | ||
background: linear-gradient(25deg, #000 0%, #00000000 60%); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
@import '../../../styles/base.scss'; | ||
|
||
#sideBar { | ||
width: 5rem; | ||
position: absolute; | ||
left: 0; | ||
height: 100%; | ||
top: 4rem; | ||
text-align: center; | ||
color: $white; | ||
|
||
.nav-item { | ||
margin-top: 1.75rem; | ||
|
||
a { | ||
text-decoration: none; | ||
color: $white50; | ||
|
||
&.active { | ||
color: $mirage; | ||
|
||
.icon { | ||
background: linear-gradient(0deg, $valencia 50%, $zest 100%); | ||
|
||
} | ||
|
||
p { | ||
color: $zest; | ||
} | ||
} | ||
} | ||
|
||
.icon { | ||
height: 2.25rem; | ||
display: flex; | ||
width: 2.25rem; | ||
margin: auto; | ||
border-radius: .5rem; | ||
align-items: center; | ||
justify-content: center; | ||
transition: .1s; | ||
font-size: 14px; | ||
} | ||
|
||
p { | ||
font-size: 9px; | ||
margin-top: .25rem; | ||
color: $white50; | ||
} | ||
|
||
&:hover { | ||
.icon { | ||
background: #FFFFFF1F; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.user { | ||
position: absolute; | ||
bottom: 1.75rem; | ||
left: 1.25rem; | ||
|
||
#avatar { | ||
height: 2.5rem; | ||
aspect-ratio: 1/1; | ||
border-radius: 50%; | ||
box-shadow: $drop-shadow; | ||
cursor: pointer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from "next/link"; | ||
import styles from './SideBar.module.scss'; | ||
|
||
const SideBar = () => { | ||
return ( | ||
<> | ||
<nav> | ||
<div className={styles.navItem}> | ||
<Link href="/home"> | ||
<p>Home</p> | ||
</Link> | ||
</div> | ||
<div className={styles.navItem}> | ||
<Link href="/fit-track"> | ||
<p>Fit Track</p> | ||
</Link> | ||
</div> | ||
</nav> | ||
<div className={styles.user}> | ||
<img id="avatar" src="/assets/avatar.png"></img> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default SideBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@import '../../../styles/base.scss'; | ||
|
||
#mainHeader { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1000; | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
height: 3rem; | ||
align-items: center; | ||
padding: 0 1.5rem; | ||
|
||
.right { | ||
margin-right: 4rem; | ||
display: flex; | ||
gap: 2rem; | ||
|
||
.icon { | ||
cursor: pointer; | ||
color: #858585; | ||
font-size: 14px; | ||
} | ||
} | ||
|
||
#badge { | ||
height: 1.75rem; | ||
transform: scale(-1, 1); | ||
filter: brightness(1.25); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import styles from './TopBar.module.scss'; | ||
|
||
const TopBar = () => { | ||
return ( | ||
<header id={styles.mainHeader}> | ||
<div className={styles.left}> | ||
<img id="badge" src="../../assets/badge.png"></img> | ||
</div> | ||
<div className={styles.right}> | ||
|
||
</div> | ||
</header> | ||
) | ||
} | ||
|
||
export default TopBar; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { NextPageContext } from 'next'; | ||
|
||
export interface GetInitialProps extends NextPageContext { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NextPageContext } from "next"; | ||
import nookies from "nookies"; | ||
|
||
|
||
const setAuthToken = (username: string, password: string, ctx?: NextPageContext) => { | ||
nookies.set(ctx, "token", `${username}:${password}`, { | ||
maxAge: 30 * 24 * 60 * 60 } | ||
); | ||
}; | ||
|
||
const getAuthToken = (ctx?: NextPageContext): string | undefined => { | ||
const authToken = nookies.get(ctx)["token"]; | ||
console.log(authToken); | ||
|
||
return authToken; | ||
}; | ||
|
||
export const authUtil = { | ||
setAuthToken, | ||
getAuthToken | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
const path = require('path') | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = { | ||
sassOptions: { | ||
includePaths: [path.join(__dirname, 'styles')], | ||
} | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.