-
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.
* feat: add view more section * fix: formatting * fix: apple touch icon
- Loading branch information
1 parent
771340e
commit 859c88c
Showing
21 changed files
with
237 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.content { | ||
text-align: center; | ||
margin: 20px auto; | ||
padding: 10px; | ||
max-width: 800px; | ||
width: 100%; | ||
background-color: #ffffff; | ||
box-shadow: 0px 0px 20px 3px #ffffff; | ||
border-radius: 8px; | ||
box-sizing: border-box; | ||
} | ||
|
||
.link { | ||
color: #ffffff; | ||
text-align: center; | ||
margin: 20px 0; | ||
} | ||
|
||
.link a { | ||
color: #7777ff; | ||
} | ||
|
||
.header { | ||
width: 100%; | ||
height: auto; | ||
padding: 10px 0; | ||
display: flex; | ||
justify-content: center; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.list { | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 10px; | ||
padding: 0 10px; | ||
} | ||
|
||
.list_item { | ||
list-style: none; | ||
width: 100%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.title { | ||
font-size: 20px; | ||
text-align: center; | ||
margin-bottom: 0; | ||
} |
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,35 @@ | ||
import Link from "next/link"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import type { Saying } from "@/constants/sayings"; | ||
import { randomSayings } from "@/lib/random-sayings"; | ||
|
||
import styles from "./RandomSayings.module.css"; | ||
|
||
export const RandomSayings = () => { | ||
const [sayings, setSayings] = useState<Saying[]>([]); | ||
|
||
useEffect(() => { | ||
setSayings(randomSayings(4)); | ||
}, []); | ||
|
||
return ( | ||
<section> | ||
<h3 className={styles.title}>View More Quotes:</h3> | ||
<ul className={styles.list}> | ||
{sayings.map((saying) => ( | ||
<li className={styles.list_item} key={saying.id}> | ||
<Link href={`/${saying.id}`}> | ||
<a>{saying.text}</a> | ||
</Link> | ||
</li> | ||
))} | ||
<li className={styles.list_item}> | ||
<Link href="/"> | ||
<a>View All</a> | ||
</Link> | ||
</li> | ||
</ul> | ||
</section> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { SAYINGS } from "../constants/sayings"; | ||
|
||
const shuffle = <T>(array: T[]): T[] => { | ||
let currentIndex = array.length; | ||
let randomIndex = 0; | ||
|
||
while (currentIndex !== 0) { | ||
randomIndex = Math.floor(Math.random() * currentIndex); | ||
currentIndex--; | ||
|
||
[array[currentIndex], array[randomIndex]] = [ | ||
array[randomIndex], | ||
array[currentIndex], | ||
]; | ||
} | ||
|
||
return array; | ||
}; | ||
|
||
export const randomSayings = (count: number) => | ||
shuffle([...SAYINGS]).slice(0, count); |
Oops, something went wrong.
859c88c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
duke-adsgames-net – ./
duke-adsgames-net-git-main-adsgames.vercel.app
duke-adsgames-net.vercel.app
duke.adsgames.net
duke-adsgames-net-adsgames.vercel.app