Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekch33 committed Oct 21, 2023
2 parents d249d13 + 454d5c8 commit d6c5c06
Show file tree
Hide file tree
Showing 24 changed files with 734 additions and 209 deletions.
9 changes: 4 additions & 5 deletions enyugma-backend/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default class Database {
this.client.query(`CREATE TABLE IF NOT EXISTS users (
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
college VARCHAR(255) NOT NULL,
state VARCHAR(255) NOT NULL,
city VARCHAR(255) NOT NULL,
Expand All @@ -60,11 +59,11 @@ export default class Database {
async createUser(user) {
// postgres query for inserting a user
return this.client.query(
"INSERT INTO users (name, email, password, college, state, city, pincode, type, events, teamSize, teamMembers, token, transactionId) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,$11,$12,$13)",
"INSERT INTO users (name, email, college, state, city, pincode, type, events, teamSize, teamMembers, token, transactionId) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,$11,$12)",
[
user.name,
user.email,
user.password,
// user.password,
user.college,
user.state,
user.city,
Expand Down Expand Up @@ -132,11 +131,11 @@ export default class Database {
async modifyUser(email, user) {
// postgres query for modifying a user where provided data might not be complete
return this.client.query(
"UPDATE users SET name=$1, email=$2, password=$3, college=$4, state=$5, city=$6, pincode=$7, type=$8,events=$9, teamSize=$10, teamMembers=$11 WHERE email=$12",
"UPDATE users SET name=$1, email=$2, college=$3, state=$4, city=$5, pincode=$6, type=$7,events=$8, teamSize=$9, teamMembers=$10 WHERE email=$11",
[
user.name,
user.email,
user.password,
// user.password,
user.college,
user.state,
user.city,
Expand Down
208 changes: 167 additions & 41 deletions enyugma-frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,191 @@
import "./App.scss";
import { Routes, Route } from "react-router-dom";
import { useEffect, useState } from "react";
import Home from "./Pages/Home/index.jsx";
import TechnicalEvent from "./Pages/TechnicalEvent";
import { useEffect, useState, lazy, Suspense } from "react";
// import Home from "./Pages/Home/index.jsx";
// import TechnicalEvent from "./Pages/TechnicalEvent";
import GlowBall from "./Components/cursor/index.jsx";
import Footer from "./Components/Footer/index.jsx";
import Preloader from "./Components/Preloader/Preloader";
import Spin from "./Components/Spin/Preloader";
import CulturalEvent from "./Pages/CulturalEvent/index.jsx";
import GalleryPage from "./Pages/Gallery/index.jsx";
import Events from "./Pages/Events/index.jsx";
import EventDetail from "./Pages/EventDetail/index.jsx";
import SponsorCard from "./Components/SponsorCard/index.jsx";
import Sponsors from "./Pages/Sponsors/index.jsx";
import WorkshopEvent from "./Pages/WorkshopEvent/index.jsx";
import Register from "./Pages/Register/index.jsx";
// import Spin from "./Components/Spin/Preloader";
// import CulturalEvent from "./Pages/CulturalEvent/index.jsx";
// import GalleryPage from "./Pages/Gallery/index.jsx";
// import Events from "./Pages/Events/index.jsx";
// import EventDetail from "./Pages/EventDetail/index.jsx";
// import SponsorCard from "./Components/SponsorCard/index.jsx";
// import Sponsors from "./Pages/Sponsors/index.jsx";
// import WorkshopEvent from "./Pages/WorkshopEvent/index.jsx";
// import Register from "./Pages/Register/index.jsx";
// lazy loading
const Home = lazy(() => import("./Pages/Home/index.jsx"));
const TechnicalEvent = lazy(() => import("./Pages/TechnicalEvent"));

const CulturalEvent = lazy(() => import("./Pages/CulturalEvent/index.jsx"));
const GalleryPage = lazy(() => import("./Pages/Gallery/index.jsx"));
const Events = lazy(() => import("./Pages/Events/index.jsx"));
const EventDetail = lazy(() => import("./Pages/EventDetail/index.jsx"));
const Sponsors = lazy(() => import("./Pages/Sponsors/index.jsx"));
const WorkshopEvent = lazy(() => import("./Pages/WorkshopEvent/index.jsx"));
const Register = lazy(() => import("./Pages/Register/index.jsx"));

function App() {
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
setTimeout(() => {
setIsLoading(false);
}, 2000);
}, []);
// const [isLoading, setIsLoading] = useState(true);
// useEffect(() => {
// setTimeout(() => {
// setIsLoading(false);
// }, 2000);
// }, []);

return (
<>
{isLoading && (
<div className="preloader">
<Preloader />
</div>
)}
<div
className="App"
style={{
opacity: isLoading ? 0 : 1,
}}
>
<div className="App">
<GlowBall />
<Routes>
<Route index element={<Home />} />
<Route
index
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<Home />{" "}
</Suspense>
}
/>
<Route path="events">
<Route index element={<Events />} />
<Route
index
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<Events />{" "}
</Suspense>
}
/>
<Route path="technical">
<Route index element={<TechnicalEvent />} />
<Route path=":id" element={<EventDetail />} />
<Route
index
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<TechnicalEvent />{" "}
</Suspense>
}
/>
<Route
path=":id"
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<EventDetail />{" "}
</Suspense>
}
/>
</Route>
<Route path="cultural">
<Route index element={<CulturalEvent />} />
<Route path=":id" element={<EventDetail />} />
<Route
index
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<CulturalEvent />{" "}
</Suspense>
}
/>
<Route
path=":id"
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<EventDetail />{" "}
</Suspense>
}
/>
</Route>
<Route path="workshop" >
<Route index element={<WorkshopEvent />} />
<Route path=":id" element={<EventDetail />} />
<Route path="workshop">
<Route
index
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<WorkshopEvent />{" "}
</Suspense>
}
/>
<Route
path=":id"
element={
<Suspense
fallback={
<>
<Preloader />
</>
}
>
<EventDetail />{" "}
</Suspense>
}
/>
</Route>
</Route>
<Route path="contact" element={<h1>Contact</h1>} />

<Route path="gallery" element={<GalleryPage />} />
<Route path="sponsors" element={<Sponsors />} />
<Route path="register" element={<Register />} />
<Route
path="gallery"
element={
<Suspense fallback={<Preloader />}>
<GalleryPage />{" "}
</Suspense>
}
/>
<Route
path="sponsors"
element={
<Suspense fallback={<Preloader />}>
<Sponsors />{" "}
</Suspense>
}
/>
<Route
path="register"
element={
<Suspense fallback={<Preloader />}>
<Register />{" "}
</Suspense>
}
/>
</Routes>
<Footer />
</div>
Expand Down
4 changes: 2 additions & 2 deletions enyugma-frontend/src/Components/CulturalCard/CulturalCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const CulturalCard = (props) => {
}}
>
<Paper
className="card"
className="ccard"
{...props.others}
style={{
backgroundImage: `url(${props.banner})`,
Expand All @@ -70,7 +70,7 @@ const CulturalCard = (props) => {
>
{/* <img src={border} alt="bg-removebg-preview" border="0" className="bg" /> */}
<div className="overlay" ref={bgref}>
<div className="info" ref={hoverRef}>
<div className="cinfo" ref={hoverRef}>
<h1>{props.name}</h1>
<p>
{props.description.length > 100
Expand Down
20 changes: 16 additions & 4 deletions enyugma-frontend/src/Components/CulturalCard/CulturalCard.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.card {
.ccard {
height: 300px;
width: 300px;
/* border: 1px solid black; */
Expand All @@ -22,17 +22,29 @@
justify-content: center;
transition: 500ms;

.info {
.cinfo {
width: 100%;
height: 100%;
position: absolute;
bottom: 0px;
padding: 0px 40px;
left: 0;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
align-items: flex-start;
z-index: 2;
border-radius: 16px;
color: var(--t);
transition: 500ms;
opacity: 0;
font-size: 20px;
gap: 16px;
h1,
p {
// font-family: "Lucida Sans", "Lucida Sans Regular",
// "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana,
// sans-serif;
// sans-serif;
color: white;
font-size: 20px;
font-weight: 400;
Expand Down
2 changes: 1 addition & 1 deletion enyugma-frontend/src/Components/Footer/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
rgba(6, 12, 32, 1) 20%,
rgba(0, 0, 0, 0.7)
),
url(https://wallpaper-house.com/data/out/6/wallpaper2you_112356.webp);
url(https://wallpaper-house.com/data/out/6/wallpaper2you_112356.jpg);
color: #fff;
padding: 20px;
background-size: cover;
Expand Down
16 changes: 16 additions & 0 deletions enyugma-frontend/src/Components/Gallery/gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,20 @@
margin: 20px 0px 25px;
flex: 0 1 150px;
}

.load {
animation: wave 1.5s infinite ease-in-out;
}

@keyframes wave {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
}
Loading

0 comments on commit d6c5c06

Please sign in to comment.