Skip to content

Commit 6e7f5c0

Browse files
committed
Update frontpage
1 parent 62401af commit 6e7f5c0

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

components/FormattedLink.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ import Link from "next/link"
22
import { ForwardedRef, forwardRef } from "react"
33

44

5-
const Wrapped = forwardRef(function FLink({ children, onClick, href, font = "semibold", size = "xl", className = "", location, target = undefined }: any, innerRef: ForwardedRef<HTMLAnchorElement>) {
5+
const Wrapped = forwardRef(function FLink({ children, onClick, href, font = "semibold", size = "xl", className = "", style={}, location, target = undefined }: any, innerRef: ForwardedRef<HTMLAnchorElement>) {
66
let colors = "text-blue-800 dark:text-blue-100 hover:text-blue-500 dark:hover:text-blue-400"
77
if (href == location)
88
colors = "text-blue-600 dark:text-blue-400 hover:text-blue-400 dark:hover:text-blue-500"
99
else if (location?.startsWith(href) && href != "/")
1010
colors = "text-blue-700 dark:text-blue-300 hover:text-blue-400 dark:hover:text-blue-400"
1111

1212
return (
13-
<a ref={innerRef} className={`${className} text-${size} font-${font} no-underline transition-all duration-200 ${colors}`} onClick={onClick} href={href} target={target} >
13+
<a ref={innerRef} className={`${className} text-${size} font-${font} no-underline transition-all duration-200 ${colors}`} style={style} onClick={onClick} href={href} target={target} >
1414
{children}
1515
</a>
1616
)
1717
})
1818

19-
function FormattedLink({ children, href, font = "semibold", size = "xl", className = "", location, target = undefined }: any) {
19+
function FormattedLink({ children, href, font = "semibold", size = "xl", className = "", style = {}, location, target = undefined }: any) {
2020
return (
21-
<Link href={href} passHref><Wrapped font={font} size={size} location={location} className={className} target={target}>{children}</Wrapped></Link>
21+
<Link href={href} passHref><Wrapped font={font} size={size} location={location} className={className} target={target} style={style}>{children}</Wrapped></Link>
2222
)
2323
}
2424

pages/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ export default function Home({ location }: { location: string }) {
3434
<h3 className="p-3 mt-10 text-3xl text-left">
3535
Features:
3636
</h3>
37-
<div className="flex flex-wrap items-center justify-around max-w-4xl mt-1">
38-
<div className="md:flex md:flex-row items-center justify-around max-w-4xl">
37+
<div className="grid items-center justify-around max-w-4xl mt-1">
38+
<div className="md:flex md:flex-row items-center max-w-4xl">
3939
<Card href="/guides" title="Guides &rarr;" desc="Find where those Specters are hiding" location={location} src={book} alsoSite />
4040
<Card href="/reminders" title="Reminders &rarr;" desc="Remind yourself of that Parametric Transformer you forgot for the 5th time" location={location} src={alarm} alsoSite="Can be managed on site as well" />
4141
</div>
4242

43-
<div className="md:flex md:flex-row items-center justify-around max-w-4xl">
43+
<div className="md:flex md:flex-row items-center max-w-4xl">
4444
<Card title="Character and Weapon Information" desc="Check which books that character needs or how many enhancement ores you need to level that shiny new weapon" location={location} src={person} />
4545
<Card title="News and Events" desc="Don't miss out on the latest drip marketing" location={location} src={newspaper} />
4646
</div>
4747

48-
<div className="md:flex md:flex-row items-center justify-around max-w-4xl">
48+
<div className="md:flex md:flex-row items-center max-w-4xl">
4949
<Card title="Gacha calculator" desc="Want to check the odds of getting C1 from the 134 pulls you've got right now?" location={location} src={calc} />
5050
<Card title="And more!" desc="Abyss schedule/floors, this month's Paimon's Bargains, ..." location={location} />
5151
</div>
@@ -67,12 +67,13 @@ function Button({ href, title, location, colors = "bg-neutral-300 dark:bg-neutra
6767
}
6868

6969
function Card({ href, src, title, desc, location, colors = "bg-slate-300 dark:bg-slate-800", alsoSite }: { href?: string, src?: string, title: string, desc: string, colors?: string, location: string, alsoSite?: string | boolean }) {
70-
const className = `px-6 py-4 m-1.5 h-48 text-left border max-w-full items-start justify-center flex flex-col rounded-2xl ${colors}`
70+
const className = `px-6 py-1.5 m-1.5 h-full text-left border max-w-full items-start justify-center flex flex-col rounded-2xl ${colors}`
7171

7272
if (href)
7373
return <FormattedLink
7474
href={href}
7575
className={className}
76+
style={{ minHeight: "12rem" }}
7677
location={location}
7778
>
7879
<h3 className="text-3xl font-semibold">{src && <Image src={src} width={24} height={24} alt="Icon"/>} {title}</h3>
@@ -84,7 +85,7 @@ function Card({ href, src, title, desc, location, colors = "bg-slate-300 dark:bg
8485
</p>
8586
</FormattedLink>
8687
else
87-
return <div className={className}>
88+
return <div className={className} style={{ minHeight: "12rem" }}>
8889
<h3 className="text-3xl font-semibold">{src && <Image src={src} width={24} height={24} alt="Icon"/>} {title}</h3>
8990
<p className="mt-2 text-lg">
9091
{desc}

0 commit comments

Comments
 (0)