Skip to content

Commit

Permalink
fix: lots of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshd332 committed Dec 10, 2023
1 parent 4b03f29 commit 51b1f5c
Show file tree
Hide file tree
Showing 22 changed files with 293 additions and 237 deletions.
259 changes: 129 additions & 130 deletions public/auth-callback.html
Original file line number Diff line number Diff line change
@@ -1,131 +1,130 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Delta Inductions | LOGIN REDIRECT</title>
</head>

<style>
:root {
--background: #282725;
--base: #463b33;
--accent1: #749f55;
--accent2: #ced346;
--text: #f4efe2;
--pop: #ff5757;
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

background-color: var(--background);
}

* {
color: var(--text);
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.containerz {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
min-height: 100vh;
background: var(--background);
}

.containerz .loader {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 300px;
}

.containerz .loader span {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid #fff;
pointer-events: none;
animation: animateThreads 5s linear infinite;
}

.containerz .loader span:nth-child(1) {
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.containerz .loader span:nth-child(2) {
animation-direction: reverse;
border-radius: 67% 33% 70% 30% / 75% 65% 35% 25%;
}

.containerz .loader span:nth-child(3) {
animation-duration: 3s;
border-radius: 52% 48% 70% 30% / 41% 65% 35% 59%;
}

@keyframes animateThreads {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}

.containerz .loader h2 {
color: var(--text);
/* font-family: "Courier New", Courier, monospace; */
font-weight: 500;
max-width: 200px;
text-align: center;
}
</style>

<body>
<!-- <h1>Auth Callback</h1> -->

<div class="containerz">
<div class="loader">
<span></span>
<span></span>
<span></span>
<h2>Redirecting back to the main site...</h2>
</div>
</div>
</body>

<script>
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
params.source = "dauth-login-callback";

setTimeout(() => {
if (window.opener) {
// send them to the opening window
window.opener.postMessage(params);
// close the popup
window.close();
}
}, 500);
</script>
</html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pragyan '24 | Login Redirect</title>
</head>

<style>
:root {
--background: #282725;
--base: #463b33;
--accent1: #749f55;
--accent2: #ced346;
--text: #f4efe2;
--pop: #ff5757;
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

background-color: var(--background);
}

* {
color: var(--text);
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.containerz {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
min-height: 100vh;
background: var(--background);
}

.containerz .loader {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 300px;
}

.containerz .loader span {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid #fff;
pointer-events: none;
animation: animateThreads 5s linear infinite;
}

.containerz .loader span:nth-child(1) {
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.containerz .loader span:nth-child(2) {
animation-direction: reverse;
border-radius: 67% 33% 70% 30% / 75% 65% 35% 25%;
}

.containerz .loader span:nth-child(3) {
animation-duration: 3s;
border-radius: 52% 48% 70% 30% / 41% 65% 35% 59%;
}

@keyframes animateThreads {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}

.containerz .loader h2 {
color: var(--text);
/* font-family: "Courier New", Courier, monospace; */
font-weight: 500;
max-width: 200px;
text-align: center;
}
</style>

<body>
<!-- <h1>Auth Callback</h1> -->

<div class="containerz">
<div class="loader">
<span></span>
<span></span>
<span></span>
<h2>Redirecting back to the main site...</h2>
</div>
</div>
</body>

<script>
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
params.source = 'dauth-login-callback';

setTimeout(() => {
if (window.opener) {
// send them to the opening window
window.opener.postMessage(params);
// close the popup
window.close();
}
}, 500);
</script>
</html>
5 changes: 3 additions & 2 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const About = () => {
const [isScrolled, setIsScrolled] = useState<boolean>(false);
const [scrollAllowed, setScrollAllowed] = useState<boolean>(true);
const contentCard = useRef<HTMLDivElement>(null);
const contentCardDesktop = useRef<HTMLParagraphElement>(null);
const router = useRouter();
const simulateScroll = (event: WheelEvent<HTMLDivElement>) => {
if (!isScrolled && !contentCard.current?.contains(event.target as Node)) {
if (!isScrolled && !contentCardDesktop.current?.contains(event.target as Node)) {
event.stopPropagation();
if (event.deltaY > 0) {
setTimeout(() => {
Expand Down Expand Up @@ -96,7 +97,7 @@ const About = () => {
<div className="font-ROG xl:text-8xl lg:text-7xl md:text-6xl sm:text-4xl text-2xl">
ABOUT US
</div>
<AboutCard cardRef={contentCard} />
<AboutCard cardRef={contentCardDesktop} />
<AboutCardMob cardRef={contentCard} />
</div>
<SideBar number={'02'} content={'The Present'} />
Expand Down
Binary file removed src/assets/images/LoginButton.png
Binary file not shown.
16 changes: 9 additions & 7 deletions src/components/AboutCard/AboutCard.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React from 'react';
import AboutContent from './AboutContent.json';

const AboutCard = () => {
const content = AboutContent.content + AboutContent.content2;
const AboutCard: React.FC<AboutCardProps> = ({ cardRef }) => {
const content = AboutContent.content;
return (
<div
ref={cardRef}
className="AboutCard max-md:hidden h-fit sm:w-[85%] sm:h-[70%] md:w-[70%] md:h-[60%] lg:w-[60%] lg:h-[70%] xl:w-[45%] xl:h-[55%] flex justify-center items-center p-10 "
>
<p className="pt-3 max-lg:text-base text-lg font-Nunito">{content}</p>
<div className="AboutCard max-md:hidden h-fit sm:w-[85%] sm:h-[70%] md:w-[70%] md:h-[65%] lg:w-[60%] lg:h-[70%] xl:w-[45%] xl:h-[55%] flex justify-center items-center p-10 ">
<p
ref={cardRef}
className="pt-3 max-lg:text-base text-lg font-Nunito md:h-[80%] lg:h-[85%] overflow-auto"
>
{content}
</p>
</div>
);
};
Expand Down
3 changes: 1 addition & 2 deletions src/components/AboutCard/AboutCardMob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AboutContent from './AboutContent.json';

const AboutCardMob: React.FC<AboutCardProps> = ({ cardRef }) => {
const content: string = AboutContent.content;
const content2: string = AboutContent.content2;
return (
<div
className={
Expand All @@ -19,7 +18,7 @@ const AboutCardMob: React.FC<AboutCardProps> = ({ cardRef }) => {
<div className={styles.bottomLeft + ' ' + styles.edge}></div>
<div className={styles.bottomRight + ' ' + styles.edge}></div>
<div className={styles.content + ' ' + 'w-full h-full p-3 overflow-y-scroll relative'}>
{content} + {content2}
{content}
</div>
</div>
);
Expand Down
3 changes: 1 addition & 2 deletions src/components/AboutCard/AboutContent.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"content": "Pragyan, the international techno-managerial organisation of NIT Trichy , which came into being in 2005, achieves just that by providing aplatform for a multitude of students to showcase their technicalingenuity and prowess. Pragyan has come a long way since its inception,propelling the fields of science and technology toward greater heights.",
"content2": " It basks in the limelight with the London Olympics and Manchester United as one of the three organisations to have ever achieved the ISO 20121:2012 Certification for Sustainable Event Management. Pragyan also holds the coveted honour of being the only student-run organisation amongst the three. In addition, Pragyan has the ISO 9001:2015 Certification for Quality Management Systems. Moreover, it has been registered as a case study in The Case Centre, London"
"content": "In the previous year, Pragyan grew from the hybrid fest of 2022 to a completely offline fest. The theme of Pragyan '23 was Cyberscape and was a surreal experience at that. The edition had many sessions with renowned speakers, scholars, and eminent personalities on our Pragyan Guest Lectures and Q&A sessions. With events, podcasts, and articles spreading awareness and information, Pragyan is sustaining its zeal. With \"Chronocle\" as its theme, the twentieth edition of Pragyan will be conducted on the NITT campus in all its grandeur. With this edition, we aim to introspect time - what has been, what is, and what will be. The past, the present, and the future is carried by each of us. Pragyan '24 will bring these three together, so that to make the best of all the parallels and celebrate technology."
}
4 changes: 2 additions & 2 deletions src/components/AuthLayout/AuthLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link';
import { Login } from './login';
import { SignUp } from './signup';
import Arrow from '../../assets/images/arrow_back_auth.svg';
import PragyanLogo from '../../assets/images/main-logo-22-white.svg';
import PragyanLogo from '../../assets/images/main-logo.png';
import styles from './AuthLayout.module.css';
// import { userContext } from "../../contexts/UserContext";

Expand All @@ -16,7 +16,7 @@ const AuthLayout: React.FC<AuthLayoutProps> = ({ formType }) => {
<div className={styles.authWrapper}>
<div className={styles.authContainer}>
<div className={styles.authHeader}>
<Link className={styles.homeNavLink} href="/">
<Link className={styles.homeNavLink} href="/home">
<Image src={Arrow} alt="Arrow Left" width={20} height={20} />
<span className={styles.homeNavLinkText}>Home</span>
</Link>
Expand Down
4 changes: 1 addition & 3 deletions src/components/AuthLayout/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ export const Login: React.FC<SignupFormProps> = ({ setForm }) => {
const handleLogin = useCallback(() => {
try {
setAuthStatus(AuthStatusEnum.WAITING);
//backend url
console.log(loginForm);

const authApi = new UserApi(authConfig);
authApi
.authUserLogin({
// @ts-ignore-next-line
user_email: loginForm.userEmail,
user_password: loginForm.userPassword,
})
Expand Down
1 change: 1 addition & 0 deletions src/components/AuthLayout/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const SignUp: React.FC<SignupFormProps> = ({ setForm }) => {
console.log('submitting');
userApi
.authUserRegister({
// @ts-ignore-next-line
user_name: registerForm.userName,
user_othercollege: registerForm.userCollege,
user_referral_code: registerForm.userReferralCode,
Expand Down
2 changes: 1 addition & 1 deletion src/components/BackButton/back.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ImageChanger = (props: ImageChangerProps) => {
alt="Back to cluster"
className={`${styles.Back} xl:w-52 lg:w-44 md:w-32 sm:w-24 w-16 absolute left-28 top-32 max-md:hidden`}
onClick={() => {
router.back();
router.push('/clusters');
}}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
Expand Down
Loading

0 comments on commit 51b1f5c

Please sign in to comment.