-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from isd-sgcu/feat/shared-border-frame
feat: shared border frame
- Loading branch information
Showing
7 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,3 +1,13 @@ | ||
import Border from '@/components/Border'; | ||
|
||
export default function Home() { | ||
return <main className="w-full">home</main>; | ||
return ( | ||
<main className="w-full flex justify-center items-center flex-col p-10"> | ||
<Border variant="dark-pink"> | ||
<h1 className="text-4xl font-bold text-center text-white"> | ||
Hello, World! | ||
</h1> | ||
</Border> | ||
</main> | ||
); | ||
} |
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,57 @@ | ||
import React from 'react'; | ||
import darkPinkBorder from '../../public/border/darkPinkBorder.webp'; | ||
import lightPinkBorder from '../../public/border/lightPinkBorder.webp'; | ||
import whiteBrownBorder from '../../public/border/whiteBrownBorder.webp'; | ||
import transparentBorder from '../../public/border/transparentBorder.webp'; | ||
|
||
interface BorderProps { | ||
variant: 'dark-pink' | 'light-pink' | 'white-brown' | 'transparent'; | ||
className?: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const borderStyles = { | ||
'dark-pink': { | ||
base: 'bg-cover bg-center', | ||
style: { | ||
backgroundImage: `url(${darkPinkBorder.src})`, | ||
}, | ||
}, | ||
'light-pink': { | ||
base: 'bg-cover bg-center opacity-70', | ||
style: { | ||
backgroundImage: `url(${lightPinkBorder.src})`, | ||
}, | ||
}, | ||
'white-brown': { | ||
base: 'bg-cover bg-center', | ||
style: { | ||
backgroundImage: `url(${whiteBrownBorder.src})`, | ||
}, | ||
}, | ||
transparent: { | ||
base: 'bg-cover bg-center opacity-70', | ||
style: { | ||
backgroundImage: `url(${transparentBorder.src})`, | ||
}, | ||
}, | ||
}; | ||
|
||
const Border: React.FC<BorderProps> = ({ | ||
variant = 'dark-pink', | ||
className, | ||
children, | ||
}) => { | ||
const { base, style } = borderStyles[variant]; | ||
|
||
return ( | ||
<div | ||
className={`flex pt-24 p-10 items-center flex-col w-[360px] h-[799px] ${base} ${className}`} | ||
style={style} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Border; |