-
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.
Merge pull request #32 from swat-sccs/dcrepublic-dev
Fix admin pannel... again, New login front page
- Loading branch information
Showing
5 changed files
with
589 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,117 @@ | ||
"use client"; | ||
import { Card } from "@nextui-org/react"; | ||
import { Button, Card } from "@nextui-org/react"; | ||
import { title } from "../../components/primitives"; | ||
import Particles, { initParticlesEngine } from "@tsparticles/react"; | ||
import { | ||
type Container, | ||
type ISourceOptions, | ||
MoveDirection, | ||
OutMode, | ||
} from "@tsparticles/engine"; | ||
// import { loadAll } from "@tsparticles/all"; // if you are going to use `loadAll`, install the "@tsparticles/all" package too. | ||
// import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too. | ||
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too. | ||
import { useEffect, useMemo, useState } from "react"; | ||
import { signIn, useSession } from "next-auth/react"; | ||
import { useRouter } from "next/navigation"; | ||
// import { loadBasic } from "@tsparticles/basic"; // if you are going to use `loadBasic`, install the "@tsparticles/basic" package too. | ||
|
||
export default function LoginPage() { | ||
return ( | ||
<div className="w-5/6 justify-center text-center ml-auto mr-auto grid gap-10"> | ||
<div className="text-7xl">Welcome to the</div> | ||
<div className={title({ size: "lg", color: "logo" })}>SCCS</div> | ||
<div className={title({ size: "lg" })}>Course Planner </div> | ||
<div className={title({ size: "sm" })}>Version 2.0 </div> | ||
const { data: session, status } = useSession(); | ||
const router = useRouter(); | ||
|
||
<div className="text-xl"> | ||
Please excuse us as we polish some remaining bugs, but feel free to | ||
explore and plan your classes! If you have suggestions or feedback, | ||
please email [email protected]. | ||
</div> | ||
</div> | ||
const [init, setInit] = useState(false); | ||
|
||
// this should be run only once per application lifetime | ||
useEffect(() => { | ||
initParticlesEngine(async (engine) => { | ||
// you can initiate the tsParticles instance (engine) here, adding custom shapes or presets | ||
// this loads the tsparticles package bundle, it's the easiest method for getting everything ready | ||
// starting from v2 you can add only the features you need reducing the bundle size | ||
//await loadAll(engine); | ||
//await loadFull(engine); | ||
await loadSlim(engine); | ||
//await loadBasic(engine); | ||
}).then(() => { | ||
setInit(true); | ||
}); | ||
}, []); | ||
|
||
const particlesLoaded = async (container?: Container): Promise<void> => { | ||
console.log(container); | ||
}; | ||
|
||
const options: ISourceOptions = useMemo( | ||
() => ({ | ||
fpsLimit: 120, | ||
fullScreen: true, | ||
particles: { | ||
color: { value: "#fff" }, | ||
move: { | ||
direction: "bottom", | ||
enable: true, | ||
outModes: "out", | ||
speed: 2, | ||
}, | ||
number: { | ||
density: { | ||
enable: true, | ||
area: 800, | ||
}, | ||
value: 400, | ||
}, | ||
opacity: { | ||
value: 0.7, | ||
}, | ||
shape: { | ||
type: "circle", | ||
}, | ||
size: { | ||
value: 5, | ||
}, | ||
wobble: { | ||
enable: true, | ||
distance: 10, | ||
speed: 10, | ||
}, | ||
zIndex: { | ||
value: { min: 0, max: 100 }, | ||
}, | ||
}, | ||
detectRetina: true, | ||
}), | ||
[] | ||
); | ||
if (init) { | ||
return ( | ||
<div className=" align-middle justify-center p-2 sm:p-0"> | ||
<div className="z-50 justify-center text-center align-middle grid grid-rows-4"> | ||
<div className="text-7xl">Welcome to the </div> | ||
<div className={title({ size: "lg", color: "logo" })}>SCCS</div> | ||
<div className={title({ size: "lg" })}>Course Planner </div> | ||
|
||
<Button | ||
variant="shadow" | ||
size="lg" | ||
className="w-2/6 justify-center align-middle justify-self-center sm:text-2xl sm:mt-20" | ||
onClick={() => | ||
status != "authenticated" | ||
? signIn("keycloak", { callbackUrl: "/" }) | ||
: router.push("/") | ||
} | ||
> | ||
Get Started! | ||
</Button> | ||
</div> | ||
|
||
<div className="-z-50"> | ||
<Particles | ||
id="tsparticles" | ||
particlesLoaded={particlesLoaded} | ||
options={options} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
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
Oops, something went wrong.