guess who forgot to add files
diff --git a/pages/nucleus/verify/about.js b/pages/nucleus/verify/about.js
new file mode 100644
index 0000000..3144db4
--- /dev/null
+++ b/pages/nucleus/verify/about.js
@@ -0,0 +1,78 @@
+import React, { Component } from 'react'
+import Header from '../../../Components/Header'
+import { AutoLayout, Panel, Title, Subtitle, Text, Divider } from '../../../Components/Panels'
+import { Code } from '../../../Components/Texttools'
+import { Card, CardRow } from '../../../Components/Card'
+import HCaptcha from 'react-hcaptcha';
+import { useReward } from 'react-rewards'
+import Link from 'next/link'
+
+function About(props) {
+ const { reward, isAnimating } = useReward('confetti', 'confetti', {
+ elementSize: 12,
+ spread: 85,
+ position: "absolute",
+ colors: ["#F27878", "#E5AB71", "#E5DC71", "#A1CC65", "#68D49E", "#71AFE5", "#6576CC", "#8D58B2", "#BF5E9F"]
+ });
+
+ return (
+ <>
+ <Header
+ name="Nucleus Verification"
+ subtext="Remove automated accounts from your server"
+ customImage={"https://assets.clicks.codes/web/logos/nucleus.svg"}
+ embedImage={"https://assets.clicks.codes/bots/nucleus/normal.png"}
+ gradient={["F27878", "D96B6B"]}
+ wave="web/waves/header/nucleus"
+ buttons={[
+ {color: "424242", buttonText: "FFFFFF", link: "#about", text: "About"},
+ {color: "424242", buttonText: "FFFFFF", link: "#privacy", text: "Privacy"},
+ {color: "F27878", buttonText: "FFFFFF", link: "#invite", text: "Invite"}
+ ]}
+ />
+ <AutoLayout>
+ <Panel halfSize={false} id="about">
+ <Title>About Verification</Title>
+ <Divider />
+ <Text>Nucleus is designed to help keep your server safe. Verification is how we remove bots from your server.</Text>
+ <Text>Many bot accounts are designed to join and spam in servers, and verification can prevent this easily:</Text>
+ <HCaptcha
+ id="Captchas mitigate problems"
+ sitekey="85074411-fa13-4d9b-b901-53095c6d1fc6"
+ onVerify={reward}
+ theme="dark"
+ />
+ <Text>Users will need to run <Code colour="F27878">/verify</Code> when they join, and will be given a link to complete this check online.</Text>
+ <Text>It is completely free to use verification, and for users to verify.</Text>
+ <div id="confetti" />
+ </Panel>
+ <Panel halfSize={true} id="privacy">
+ <Title>Privacy</Title>
+ <Divider />
+ <Text>Verification stores the smallest amount of data required to function, and is deleted automatically.</Text>
+ <Text>This includes the user's ID, the server ID, role name and server icon.</Text>
+ <Text>The full list of data stored by Nucleus can be found <Link href="https://clicksminuteper.github.io/policies/nucleus">here</Link>.</Text>
+ </Panel>
+ <Panel halfSize={true} id="invite">
+ <Title>Invite</Title>
+ <Divider />
+ <CardRow>
+ <Card
+ wave="nucleus"
+ icon="bots/nucleus/circle"
+ buttonText={"FFFFFF"} gradient={["F27878", "D96B6B"]}
+ title="Nucleus"
+ subtext="Invite Nucleus to your server"
+ buttons={[
+ {color: "424242", link: "https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands", text: "Invite"}
+ ]}
+ url="https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands"
+ />
+ </CardRow>
+ </Panel>
+ </AutoLayout>
+ </>
+ )
+}
+
+export default About;
\ No newline at end of file
diff --git a/pages/nucleus/verify/alreadyVerified.js b/pages/nucleus/verify/alreadyVerified.js
new file mode 100644
index 0000000..c31290a
--- /dev/null
+++ b/pages/nucleus/verify/alreadyVerified.js
@@ -0,0 +1,24 @@
+import { Component } from 'react'
+import Header from '../../../Components/Header'
+
+class Failed extends Component {
+ constructor(props) {
+ super(props)
+ }
+
+ render() {
+ return (
+ <Header
+ name="Already verified"
+ subtext="You are already verified, and cannot verify again"
+ gradient={["65CC76", "60B258"]}
+ wave="web/waves/header/nucleus"
+ buttons={[]}
+ fullscreen={true}
+ />
+ )
+ }
+
+}
+
+export default Failed;
\ No newline at end of file
diff --git a/pages/nucleus/verify/failure.js b/pages/nucleus/verify/failure.js
new file mode 100644
index 0000000..75c2296
--- /dev/null
+++ b/pages/nucleus/verify/failure.js
@@ -0,0 +1,25 @@
+import { Component } from 'react'
+import Header from '../../../Components/Header'
+import Link from 'next/link'
+
+class Failed extends Component {
+ constructor(props) {
+ super(props)
+ }
+
+ render() {
+ return (
+ <Header
+ name="Verification failed"
+ subtext={<p>Please try again, and if the error persists please contact us at <Link href="mailto:verification@clicks.codes" target="_blank" rel="noopener noreferrer">verification@clicks.codes</Link></p>}
+ gradient={["F27878", "D96B6B"]}
+ wave="web/waves/header/nucleus"
+ buttons={[]}
+ fullscreen={true}
+ />
+ )
+ }
+
+}
+
+export default Failed;
\ No newline at end of file
diff --git a/pages/nucleus/verify/index.js b/pages/nucleus/verify/index.js
new file mode 100644
index 0000000..1f55dec
--- /dev/null
+++ b/pages/nucleus/verify/index.js
@@ -0,0 +1,135 @@
+import HCaptcha from 'react-hcaptcha';
+import Axios from 'axios';
+import Router from 'next/router';
+import React from 'react';
+import Header from '../../../Components/Header'
+import { useReward } from 'react-rewards';
+import { Card, CardRow } from '../../../Components/Card'
+import Link from 'next/link'
+
+import { AutoLayout, Panel, Title, Text, Divider } from '../../../Components/Panels';
+import { List, ListItem } from '../../../Components/Texttools';
+import { useColorMode } from 'theme-ui';
+
+function Verify(props) {
+ const [clicked, setClicked] = React.useState(false);
+ const [theme, setTheme] = useColorMode()
+
+ if (clicked) {
+ Router.push('/nucleus/verify/alreadyVerified', '/nucleus/verify/success');
+ }
+
+ const { reward: reward, isAnimating: isAnimating } = useReward('confetti', 'confetti', {
+ elementSize: 10,
+ elementCount: 150,
+ startVelocity: 35,
+ lifetime: 300,
+ decay: 0.94,
+ spread: 170,
+ position: "absolute",
+ colors: ["#68D49E"]
+ });
+
+ async function submitForm(tkn) {
+ if ( clicked ) {
+ return
+ }
+ setClicked(true);
+ reward();
+ let code = await Axios.post('/api/nucleus/verify/complete', {
+ code: props.code,
+ tkn: tkn
+ });
+ setTimeout(() => {
+ if (code.data.success === true ) return Router.push('/nucleus/verify/success','/nucleus/verify')
+ else return Router.push('/nucleus/verify/failure','/nucleus/verify')
+ }, 2500);
+ }
+
+ return <>
+ <Header
+ name={props.guild_name}
+ customImage={props.guild_icon_url}
+ roundImage={true}
+ subtext={`${props.memberCount} members`}
+ gradient={["F27878", "D96B6B"]}
+ wave="web/waves/header/nucleus"
+ buttons={[]}
+ />
+ <AutoLayout>
+ <Panel>
+ <Title>Verify</Title>
+ <Divider name="commands"/>
+ <Text>Complete the check below to join {props.guild_name}</Text>
+ <div style={{height: "125px"}}>
+ <HCaptcha
+ id="Captchas mitigate problems"
+ sitekey="85074411-fa13-4d9b-b901-53095c6d1fc6"
+ onVerify={tkn => submitForm(tkn)}
+ theme="dark"
+ />
+ </div>
+ <List colour="F27878">
+ <ListItem>This is an automatic check performed by Nucleus.</ListItem>
+ <ListItem>By clicking Proceed, you will be given the <code>{props.role_name}</code> role in <code>{props.guild_name}</code>.</ListItem>
+ <ListItem>For the full list of data stored by Nucleus, please check <Link href="https://clicksminuteper.github.io/policies/nucleus#verification">here</Link></ListItem>
+ </List>
+ <div id="confetti" />
+ </Panel>
+ <Panel halfSize={false} id="invite">
+ <Title>Invite</Title>
+ <Divider />
+ <CardRow>
+ <Card
+ wave="nucleus"
+ icon="bots/nucleus/circle"
+ buttonText={"FFFFFF"} gradient={["F27878", "D96B6B"]}
+ title="Nucleus"
+ subtext="Invite Nucleus to your server"
+ buttons={[
+ {color: "424242", link: "https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands", text: "Invite"}
+ ]}
+ url="https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands"
+ />
+ </CardRow>
+ </Panel>
+ </AutoLayout>
+ </>
+}
+
+export default Verify;
+export async function getServerSideProps(ctx) {
+ if(!ctx.query.code) {
+ return {
+ redirect: {
+ destination: '/nucleus/verify/about',
+ permanent: true
+ }
+ }
+ }
+ let code;
+ try {
+ await Axios.patch(`http://localhost:10000/verify/${ctx.query.code}`);
+ code = await Axios.get(`http://localhost:10000/verify/${ctx.query.code}`, {code:ctx.query.code});
+ } catch (e) {
+ return {
+ redirect: {
+ destination: '/nucleus/verify/failure',
+ permanent: true
+ }
+ }
+ }
+ let headers = ctx.req.headers;
+ return {
+ props: {
+ uID: code.data.uID,
+ role_name: code.data.rName,
+ gID: code.data.gID,
+ guild_name: code.data.gName,
+ guild_icon_url: code.data.gIcon,
+ memberCount: code.data.mCount,
+ headers: headers,
+ code: ctx.query.code
+ }
+ }
+}
\ No newline at end of file
diff --git a/pages/nucleus/verify/success.js b/pages/nucleus/verify/success.js
new file mode 100644
index 0000000..de5b4d8
--- /dev/null
+++ b/pages/nucleus/verify/success.js
@@ -0,0 +1,24 @@
+import { Component } from 'react'
+import Header from '../../../Components/Header'
+
+class Success extends Component {
+ constructor(props) {
+ super(props)
+ }
+
+ render() {
+ return (
+ <Header
+ name="Verified"
+ subtext="You can now close this tab or window."
+ gradient={["65CC76", "60B258"]}
+ wave="web/waves/header/rsm"
+ buttons={[]}
+ fullscreen={true}
+ />
+ )
+ }
+
+}
+
+export default Success;
\ No newline at end of file
diff --git a/pages/nucleus/verify/testing.js b/pages/nucleus/verify/testing.js
new file mode 100644
index 0000000..036178d
--- /dev/null
+++ b/pages/nucleus/verify/testing.js
@@ -0,0 +1,96 @@
+import HCaptcha from 'react-hcaptcha';
+import Axios from 'axios';
+import Router from 'next/router';
+import React from 'react';
+import Header from '../../../Components/Header'
+import { useReward } from 'react-rewards';
+import { Card, CardRow } from '../../../Components/Card'
+
+import { AutoLayout, Panel, Title, Text, Divider } from '../../../Components/Panels';
+import { List, ListItem } from '../../../Components/Texttools';
+import { useColorMode } from 'theme-ui';
+import Link from 'next/link'
+
+function Verify(props) {
+ const [clicked, setClicked] = React.useState(false);
+ const [theme, setTheme] = useColorMode()
+
+ const { reward: reward, isAnimating: isAnimating } = useReward('confetti', 'confetti', {
+ elementSize: 10,
+ elementCount: 150,
+ startVelocity: 35,
+ lifetime: 300,
+ decay: 0.94,
+ spread: 170,
+ position: "absolute",
+ colors: ["#68D49E"]
+ });
+
+ async function submitForm(tkn) {
+ if ( clicked ) {
+ return
+ }
+ setClicked(true);
+ reward();
+ let code = await Axios.post('/api/nucleus/verify/complete', {
+ code:"TEST",
+ tkn: tkn
+ });
+ setTimeout(() => {
+ if (code.data.success === true ) return Router.push('/nucleus/verify/success','/nucleus/verify')
+ else return Router.push('/nucleus/verify/failure','/nucleus/verify')
+ }, 2500);
+ }
+
+ return <>
+ <Header
+ name="Clocks finite state machine"
+ customImage={"https://i1.sndcdn.com/artworks-000045941811-q634od-t500x500.jpg"}
+ roundImage={true}
+ subtext={`-5 members`}
+ gradient={["F27878", "D96B6B"]}
+ wave="web/waves/header/nucleus"
+ buttons={[]}
+ />
+ <AutoLayout>
+ <Panel>
+ <Title>Verify</Title>
+ <Divider name="commands"/>
+ <Text>Complete the check below to join ERROR</Text>
+ <div style={{height: "125px"}}>
+ <HCaptcha
+ id="Captchas mitigate problems"
+ sitekey="85074411-fa13-4d9b-b901-53095c6d1fc6"
+ onVerify={tkn => submitForm(tkn)}
+ theme="dark"
+ />
+ </div>
+ <List colour="F27878">
+ <ListItem>This is an automatic check performed by Nucleus.</ListItem>
+ <ListItem>By completing the CAPTCHA, you will be given the <code>MISSING</code> role in <code>ERROR</code>.</ListItem>
+ <ListItem>For the full list of data stored by Nucleus, please check <Link href="https://clicksminuteper.github.io/policies/nucleus#verification">here</Link></ListItem>
+ </List>
+ <div id="confetti" />
+ </Panel>
+ <Panel halfSize={false} id="invite">
+ <Title>Invite</Title>
+ <Divider />
+ <CardRow>
+ <Card
+ wave="nucleus"
+ icon="bots/nucleus/circle"
+ buttonText={"FFFFFF"} gradient={["F27878", "D96B6B"]}
+ title="Nucleus"
+ subtext="Invite Nucleus to your server"
+ buttons={[
+ {color: "424242", link: "https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands", text: "Invite"}
+ ]}
+ url="https://discord.com/api/oauth2/authorize?client_id=715989276382462053&permissions=121295465718&scope=bot%20applications.commands"
+ />
+ </CardRow>
+ </Panel>
+ </AutoLayout>
+ </>
+}
+
+export default Verify;