Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 12 additions & 22 deletions app/(pages)/_components/AuthForm/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import Link from 'next/link';
import Image from 'next/image';

import useAuthForm from '@hooks/useAuthForm';
import Froggy from 'public/judges/login/LogIn_Froggy.svg';
import Drumstick from 'public/judges/login/LogIn_DrumStick.svg';
import arrowRight from '@public/icons/arrow-right.svg';
import hackerStyles from './HackerAuthForm.module.scss';
import judgeStyles from './JudgeAuthForm.module.scss';

Expand Down Expand Up @@ -98,25 +97,6 @@ export default function AuthForm({
</div>

<div className={styles.bottom_container}>
{role === 'judge' && (
<div className={styles.froggy_container}>
<Image
src={Drumstick}
alt="froggy_drumstick"
width={10}
height={10}
className={styles.drumstick}
/>
<Image
src={Froggy}
alt="froggy"
width={50}
height={50}
className={styles.froggy}
/>
</div>
)}

<div className={styles.bottom}>
<div />
<button
Expand All @@ -126,7 +106,17 @@ export default function AuthForm({
valid ? styles.valid : null
}`}
>
{loading ? 'Checking...' : buttonText}
<span className={styles.submit_content}>
{loading ? 'Checking...' : buttonText}
{role === 'judge' ? (
<Image
src={arrowRight}
alt=""
aria-hidden="true"
className={styles.submit_arrow}
/>
) : null}
</span>
</button>
</div>
<p className={styles.error_msg}>{errors.submit}</p>
Expand Down
115 changes: 76 additions & 39 deletions app/(pages)/_components/AuthForm/JudgeAuthForm.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
.container {
width: 100%;
height: 60vh;
border-radius: var(--b-radius);
display: flex;
height: 100%;
min-height: 100%;
border-radius: 28px;
color: #000;
}

.form {
display: flex;
flex-direction: column;
align-items: space-between;
justify-content: flex-start;
height: 100%;
width: 100%;
color: #000;

.input_container {
position: relative;
Expand Down Expand Up @@ -39,31 +44,44 @@
}

input {
padding-top: var(--small-medium-spacer);
padding-left: var(--small-spacer);
height: 64px;
border: 1.5px solid #5e5e65;
border-radius: 8px;
background: #fff;
padding: 30px 12px 10px 12px;
width: 100%;
color: #000;
}

label {
position: absolute;
margin-top: var(--tiny-spacer);
left: var(--small-spacer);
font-size: 0.9rem;
top: 7px;
left: 12px;
font-size: 14px;
color: #8b8b8b;
pointer-events: none;
}
}

.error_msg {
color: var(--text-error);
font-size: 0.875rem;
font-weight: 500;
margin-bottom: 4px;
font-size: 0.75rem;
line-height: 1.5;
text-align: end;
margin-top: 4px;
min-height: calc(0.75rem * 1.5 + 4px); // calcs space taken up by error message
}

.fields {
display: flex;
flex-direction: column;
gap: var(--small-spacer);
}

.top_container {
color: #000;
display: flex;
flex-direction: column;
gap: 8px;
}

.error {
Expand All @@ -72,49 +90,68 @@

.bottom_container {
display: flex;
justify-content: center;
justify-content: flex-end;
margin-top: auto;
flex-direction: column;
padding-top: 24px;
}

.bottom {
width: 100%;
}

.submit_button {
padding: 15px 18px;
font-size: 1.125rem;
padding: 15px 32px;
font-size: 18px;
font-weight: 700;
line-height: normal;
color: var(--text-light);
border: none;
border-radius: var(--b-radius);
background-color: var(--background-secondary-light);
color: #000;
border-radius: 9999px;
background-color: #fff;
cursor: not-allowed;
width: 100%;
opacity: 0.7;
opacity: 1;
}

.valid {
background-color: var(--background-secondary);
opacity: 1;
cursor: pointer;
.submit_content {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 12px;
}

.froggy_container {
// display: flex;
justify-content: flex-end;
position: relative;
.submit_arrow {
width: 22px;
height: 22px;
filter: brightness(0);
}

img {
position: absolute;
}
.filled {
background-color: #000;
color: #fff;
border-color: #000;

.froggy {
z-index: 1;
left: 280px;
top: -59px;
.submit_arrow {
filter: brightness(0) invert(1);
}
}

.drumstick {
z-index: 2;
left: 277px;
top: -47px;
.valid {
background-color: #000;
color: #fff;
border-color: #000;
opacity: 1;
cursor: pointer;

.submit_arrow {
filter: brightness(0) invert(1);
}
}

.forgot {
color: #000;
text-align: center;
text-decoration: none;
font-size: 1rem;
font-size: 14px;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,82 @@
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
padding: var(--spacer) var(--small-spacer);
align-content: space-around;
height: 100vh;
justify-content: flex-end;
align-items: center;
padding: 66px 32px;
background: #fafaff;
color: #000;
}

.section {
margin-bottom: var(--spacer);
}
width: min(100%, 560px);
}

.logo_section {
display: flex;
justify-content: center;
margin-bottom: 36px;
}

.logo_container {
position: relative;
width: 128px;
height: 128px;
display: inline-flex;
align-items: center;
justify-content: center;
}

.logo_container::before {
content: '';
position: absolute;
inset: 0;
background: url('/judges/login/pink_cloud.svg') center/contain no-repeat;
animation: spin_cloud 12s linear infinite;
}

.logo_container :global(img) {
width: 74px;
height: 74px;
position: relative;
z-index: 1;
filter: brightness(0) invert(1);
}

.title_section {
text-align: center;
margin-bottom: 28px;
}

.title_section h3 {
font-size: 32px;
color: #000;
}

.title_section p {
font-size: 16px;
color: #444;
}

.form_section {
width: min(100%, 560px);
height: 48vh;
display: flex;
justify-content: space-between;
}

.form_section > div {
width: 100%;
height: 100%;
}

@keyframes spin_cloud {
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ export default async function AuthFormBackground({
}) {
return (
<div className={styles.container}>
<div className={styles.section}>
<Image src={hd_logo} alt="hd_logo" height={50} width={50} />
<div className={`${styles.section} ${styles.logo_section}`}>
<div className={styles.logo_container}>
<Image src={hd_logo} alt="hd_logo" height={74} width={74} />
</div>
</div>

<div className={styles.section}>
<div className={`${styles.section} ${styles.title_section}`}>
<h3>
<b>{title}</b>
</h3>
<p style={{ whiteSpace: 'pre-line' }}>{subtitle}</p>
</div>

<div className={styles.section}>{children}</div>
<div className={`${styles.section} ${styles.form_section}`}>
{children}
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ForgotPasswordForm() {
<AuthForm
role="judge"
fields={formFields}
buttonText="Send Email →"
buttonText="Reset Password"
initialValues={{
email: '',
}}
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/judges/_components/AuthForms/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function LoginForm() {
{
name: 'email' as const,
type: 'email',
label: 'Email',
label: 'Username',
placeholder: '',
readOnly: false,
},
Expand All @@ -37,7 +37,7 @@ export default function LoginForm() {
<AuthForm
role="judge"
fields={formFields}
buttonText="Log in"
buttonText="Log in"
linkText="Forgot Password?"
linkHref="/judges/login/forgot-password"
initialValues={{
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/judges/login/forgot-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default async function ForgotPasswordPage() {

return (
<AuthFormBackground
title="Hello!"
subtitle="Please enter your email below to receive a reset password email."
title="Hello Judge!"
subtitle="Please enter your email below."
>
<ForgotPasswordForm />
</AuthFormBackground>
Expand Down
3 changes: 3 additions & 0 deletions public/judges/login/pink_cloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading