add background

This commit is contained in:
Lee 2023-07-02 19:22:46 +01:00
parent cabba4c21a
commit bb76d1dcf3
2 changed files with 32 additions and 1 deletions

@ -2,6 +2,15 @@
"name": "Your Name",
"description": "A description about yourself",
"avatar": "https://cdn.fascinated.cc/KWprz2.jpg",
"background": {
"showBackground": true,
"blur": true,
"darken": {
"enabled": true,
"amount": 0.7
},
"backgroundImage": "https://cdn.fascinated.cc/8twdW8.jpg"
},
"metadata": {
"title": "Your Name",
"description": "website description"

@ -4,7 +4,29 @@ import Config from "../../config.json";
export default function Home() {
return (
<main className="flex flex-col items-center justify-center w-screen h-screen bg-neutral-900 text-white">
<div className="bg-neutral-800 rounded text-center">
<div
className={`absolute inset-0 filter ${
Config.background.blur && "blur-sm"
} w-screen h-screen`}
style={
Config.background.showBackground
? {
zIndex: 0,
background: Config.background.darken.enabled
? `linear-gradient(rgba(0, 0, 0, ${Config.background.darken.amount}), rgba(0, 0, 0, ${Config.background.darken.amount})), url(${Config.background.backgroundImage})`
: `url(${Config.background.backgroundImage})`,
backgroundSize: "cover",
backgroundBlendMode: "multiply",
}
: {}
}
></div>
<div
className="bg-neutral-800 rounded text-center shadow-lg"
style={{
zIndex: 1,
}}
>
<div className="m-5">
<div className="flex flex-col items-center justify-center">
<Image