Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend deploy #3

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
60e7c54
Cost property added !!
Harususan Oct 22, 2022
13fe1ba
loader on every page and code clean
VanshTeppalwar Oct 22, 2022
d06bac0
Merge branch 'dev' of https://github.com/credenz/CTD-NTH-22 into dev
VanshTeppalwar Oct 22, 2022
97c4961
xhanged homepage in package.json
devrajshetake Oct 22, 2022
e5ed641
warnings solved
VanshTeppalwar Oct 22, 2022
3c8a33e
404 added
VanshTeppalwar Oct 22, 2022
38562c7
small changes
VanshTeppalwar Oct 22, 2022
3c99382
base url
VanshTeppalwar Oct 22, 2022
3218dd3
resolving
devrajshetake Oct 22, 2022
b106859
resolving
devrajshetake Oct 22, 2022
fc03d86
resolving
devrajshetake Oct 22, 2022
53529b1
added _redirects
devrajshetake Oct 22, 2022
b438fc4
hompage package.json
devrajshetake Oct 22, 2022
3358cd8
hintCost and isEnded added
devrajshetake Oct 23, 2022
1bea44a
web team , conatct , bugs fixed
VanshTeppalwar Oct 23, 2022
6b9a45d
Merge branch 'frontend_deploy' of https://github.com/credenz/CTD-NTH-…
VanshTeppalwar Oct 23, 2022
4b312ff
integrated hint cost
devrajshetake Oct 23, 2022
68efdc4
integrated hint cost
devrajshetake Oct 23, 2022
6aa802f
Merge branch 'frontend_deploy' of https://github.com/credenz/CTD-NTH-…
devrajshetake Oct 23, 2022
9cff314
web-team updated
VanshTeppalwar Oct 23, 2022
dc995cf
Merge branch 'frontend_deploy' of https://github.com/credenz/CTD-NTH-…
VanshTeppalwar Oct 23, 2022
db8a704
contest ended
VanshTeppalwar Oct 23, 2022
6aeeab7
contest ended
VanshTeppalwar Oct 23, 2022
984aae3
instructions added
VanshTeppalwar Oct 24, 2022
5044213
instructions updated
VanshTeppalwar Oct 24, 2022
4d0fc47
instructions updated
VanshTeppalwar Oct 24, 2022
62ac6b7
instructions updated
VanshTeppalwar Oct 24, 2022
fb34a98
leaderboard updated
VanshTeppalwar Oct 24, 2022
8f8da49
contact page updated
VanshTeppalwar Oct 24, 2022
7a06cfb
margin
VanshTeppalwar Nov 2, 2022
b09ac18
Contact Page
VanshTeppalwar Nov 6, 2022
94cc4dc
5th question finalized
devrajshetake Nov 8, 2022
23abb69
Feed Back form added
VanshTeppalwar Nov 9, 2022
4b4bb10
Merge branch 'frontend_deploy' of https://github.com/credenz/CTD-NTH-…
VanshTeppalwar Nov 9, 2022
f11dd75
Instruction Video
VanshTeppalwar Nov 10, 2022
e5a8881
level 5 page auth
devrajshetake Nov 11, 2022
ebb8d54
level 5 page auth
devrajshetake Nov 11, 2022
69be010
Event end timmer added
VanshTeppalwar Nov 11, 2022
264c1ae
feedback
VanshTeppalwar Nov 12, 2022
d796ce9
leaderboard update
VanshTeppalwar Nov 12, 2022
4b598cb
leaderboard update
VanshTeppalwar Nov 12, 2022
de89b40
end timer update
VanshTeppalwar Nov 12, 2022
f0c7e4b
event overrr
VanshTeppalwar Nov 12, 2022
a163517
event overrr
VanshTeppalwar Nov 12, 2022
406780e
event overrr
VanshTeppalwar Nov 12, 2022
d3e3ece
static pages
VanshTeppalwar Nov 13, 2022
5e67cc5
Updated Bhakti's Info
devrajshetake Jul 27, 2023
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
3,424 changes: 1,724 additions & 1,700 deletions client/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nth_frontend",
"homepage": "localhost",
"homepage": "https://nth-ctd.netlify.app/",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand All @@ -14,7 +14,7 @@
"react-dom": "^18.2.0",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"react-scripts": "^5.0.1",
"react-toastify": "^9.0.8",
"redux": "^4.2.0",
"web-vitals": "^2.1.4"
Expand Down
1 change: 1 addition & 0 deletions client/public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
Binary file removed client/public/favicon.ico
Binary file not shown.
11 changes: 8 additions & 3 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/nth-logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="PISB's annual tech fest credenz tech days, Network Treasure Hunt event-Decrypt the Encrypted! Start Hunting."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta
name="keyword"
content="pisb,credenz,credenz tech days,ctd,CTD,pune,college,college event,tech fest,contest,computer science,coding,programming,event,annual event,competition,pcsb,pict,xenia,csi,pulzion,pasc,debsoc,ieee,acm,college club,event website"
/>
<meta name="author" content="PISB Web Team" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/nth-logo.ico" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
Binary file removed client/public/logo192.png
Binary file not shown.
Binary file removed client/public/logo512.png
Binary file not shown.
6 changes: 3 additions & 3 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"src": "nth-logo.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"src": "nth-logo.ico",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"src": "nth-logo.ico",
"type": "image/png",
"sizes": "512x512"
}
Expand Down
Binary file added client/public/nth-logo.ico
Binary file not shown.
Binary file removed client/public/r2d2.png
Binary file not shown.
6 changes: 3 additions & 3 deletions client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
} */
* {font-size: 13px;}
.margin-br{
height: 84vh;
height: 85vh;
margin: 20px;
border-radius: 25px;
border: 2px solid #ffffff;
/* opacity: 0.5 %; */
/* z-index: ; */
/* display: block;
overflow: auto; */
display: block;
overflow: auto;
/* background-color: rgba(0, 0, 0, 0.551); */
/* background-color: #090a0f; */

Expand Down
6 changes: 5 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import toast, { ToastUtils } from "./utils/toastifyContainer";
import Leaderboard from './pages/Leaderboard/Leaderboard';
import Team from './pages/Team/Team';
import Contact from './pages/Contact/Contact';
import ErrorPage from './pages/404/ErrorPage';
import Feedback from './pages/Feedback/Feedback';
function App() {
return (
<>
Expand All @@ -33,8 +35,10 @@ function App() {
<Route path="/instructions" element={<Instructions toast={{ container: <ToastUtils />, toast }} />} />
<Route path="/question/:ans" element={<Question toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="/question" element={<Question toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="/question/ronald" element={<Harry toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="/question/dementors" element={<Harry toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="/leaderboard" element = {<Leaderboard toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="/feedback" element = {<Feedback toast={{ container: <ToastUtils />, toast }}/>} />
<Route path="*" element={<ErrorPage />} />
</Routes>
</div>
<Footer />
Expand Down
10 changes: 5 additions & 5 deletions client/src/api/requests.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import axios from "axios";

const host = window.location.host
const hostname = window.location.hostname
const port = host.split(':')[1]
let url = ""
if(port == "3000") url = "http://localhost:8000/api"
else url = `http://${hostname}/api`
if(hostname === "localhost") url = "http://localhost:8000/api"
else url = `https://admin.nth.pictieee.in/api`
const backend = axios.create({
baseURL: url
});
Expand All @@ -17,13 +15,15 @@ const user = () => backend.get( `/auth/users/me/`, {headers: { "content-type": "
const extrahint= () => backend.post( `/question/extra-hint/`,null, {headers: { "content-type": "application/json", Authorization:`Token ${localStorage.getItem("auth-token")}` }} );
const leaderboard = () => backend.get( `/leaderboard/`, {headers: { "content-type": "application/json"}} );
const time=() => backend.get( `/timer/`, {headers: { "content-type": "application/json"}} );
const feedback = (data) => backend.post( `/auth/feedback/`, data,{headers: { "content-type": "application/json" }} );
const Requests = {
login,
register,
userquestion,
user,
extrahint,
leaderboard,
time
time,
feedback
};
export default Requests;
Binary file removed client/src/assets/nth-logo-starwars.png
Binary file not shown.
Binary file added client/src/assets/team/bhakti.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/devraj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/harsh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/mrunal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/omkar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/safiya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/vansh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/team/vidhi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 3 additions & 11 deletions client/src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ const Footer = () => {
</Col>
<Col lg={4} md={12} sm={12}>
<div >
<a href="https://www.instagram.com/pisbcredenz/" target="_blank">
<a href="https://www.instagram.com/nth__live/" target="_blank" rel="noopener noreferrer">
{/* <i className="fab fa-instagram instagram"></i> */}
<i class="nes-icon instagram me-5 ms-5"></i>
</a>
<a
href="https://www.linkedin.com/company/pisbieee/"
target="_blank"
>
<a href="https://www.linkedin.com/company/pisbieee/" target="_blank" rel="noopener noreferrer" >
{/* <i className="fab fa-linkedin-in linkedin"></i> */}
<i class="nes-icon linkedin me-5"></i>
</a>
<a href="https://www.facebook.com/pictieee/" target="_blank">
<a href="https://www.facebook.com/pictieee/" target="_blank" rel="noopener noreferrer">
{/* <i className="fab fa-facebook-f facebook"></i> */}
<i class="nes-icon facebook me-5"></i>
</a>
Expand All @@ -43,11 +40,6 @@ const Footer = () => {
</div>
);
// }

return null;



};

export default Footer;
2 changes: 1 addition & 1 deletion client/src/components/Loader/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './Loader.css'
const Loader = () => {
return (
<div class='layout'>
{console.log('in loader')}
{/* {console.log('in loader')} */}
<div class='position'>

<div class="loader">
Expand Down
14 changes: 8 additions & 6 deletions client/src/components/Navbar/Navbar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 49 additions & 55 deletions client/src/components/Timer/Timer.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,71 @@

import {useState,useEffect} from 'react';
import { useState, useEffect } from 'react';
import Requests from '../../api/requests';
import { Link } from 'react-router-dom';
import './Timer.css'
const Timer=(props)=>{
// Unix timestamp (in seconds) to count down to
const [day,setDay]=useState(props.format.day) ;
const [hour,setHour]=useState(props.format.hour);
const [minutes,setMinutes]=useState(props.format.minutes);
const [seconds,setSeconds]=useState(props.format.seconds);
const Timer = (props) => {
// Unix timestamp (in miliseconds) to count down to
const [day, setDay] = useState(props.format.day);
const [hour, setHour] = useState(props.format.hour);
const [minutes, setMinutes] = useState(props.format.minutes);
const [seconds, setSeconds] = useState(props.format.seconds);
// console.log(props)
const fetchTime= async()=>{
const fetchTime = async () => {
await Requests.time()
.then((res)=>
{
console.log(res)
.then((res) => {
// console.log(res)
props.fetchTimeHome();
}
)
.catch((err)=>console.log(err))

)
.catch((err) => console.log(err))

}
// useEffect(()=>{
// fetchTime();
// },[eventDate])
useEffect(()=>{
// var test = new Date(Date.UTC(2022, 9, 28));
// let props.time=1666999800000;
// const props.time=1666174920000
let curr=props.time;
// var test = new Date();
// console.log(test);
// console.log(test.getDay(),test.getDate(),test.getTime())
// let start=new Date(eventDate);
// console.log(start);
// var date = new Date(1324339200000);
// var dateToStr = date.toUTCString().split(' ');
// var cleanDate = dateToStr[2] + ' ' + dateToStr[1] ;
// console.log(cleanDate);
// console.log('i useeffet',curr);
// if(curr==undefined) return;
curr-=Date.now();
useEffect(() => {
let curr = props.time;
curr -= Date.now();
// console.log(curr);
if(curr<=0){
if (curr <= 0) {
fetchTime();
return;
}
// fetchTime();
const interval= setInterval(() => {
const interval = setInterval(() => {
curr--;
let cal=Math.floor((curr / 1000) % 60);
let cal = Math.floor((curr / 1000) % 60);
// console.log('In interval here',eventDate, seconds,minutes,hour,day, cal);
setSeconds( cal<10 ? '0'+cal.toString():cal.toString() ) ;
cal=Math.floor((curr / (1000 * 60)) % 60);
setMinutes( cal<10 ? '0'+cal.toString():cal.toString() ) ;
cal=Math.floor((curr / (1000 * 60 * 60)) % 24);
setHour( cal<10 ? '0'+cal.toString():cal.toString() ) ;
cal=Math.floor((curr)/(1000*60*60*24));
setDay( cal<10 ? '0'+cal.toString():cal.toString() ) ;
}, 1000);
return () => clearInterval(interval);
},[day,hour,minutes,seconds,day])
return(
setSeconds(cal < 10 ? '0' + cal.toString() : cal.toString());
cal = Math.floor((curr / (1000 * 60)) % 60);
setMinutes(cal < 10 ? '0' + cal.toString() : cal.toString());
cal = Math.floor((curr / (1000 * 60 * 60)) % 24);
setHour(cal < 10 ? '0' + cal.toString() : cal.toString());
cal = Math.floor((curr) / (1000 * 60 * 60 * 24));
setDay(cal < 10 ? '0' + cal.toString() : cal.toString());
}, 1000);
return () => clearInterval(interval);
}, [day, hour, minutes, seconds]) // eslint-disable-line react-hooks/exhaustive-deps
return (
<div className='timer'>
{/* <p class="mr-3 ml-2 mt-3 mb-2" style={{color:'yellow',fontSize:'15px'}}>Hunt Begins In </p> */}
<p class=" mr-3 ml-2 mt-3 mb-2 " className='format' style={{color:'yellow'}}>Days Hours Minutes Seconds</p>
<p class="mr-3 ml-2 mt-3 mb-2" className='date' style={{color:'yellow'}}>{day}:{hour}:{minutes}:{seconds}</p>
<Link to="/instructions">
<button className="mr-3 ml-2 mt-2 mb-2 inst-btn">
Instructions
</button>
</Link>
<p class=" mr-3 ml-2 mt-3 mb-2 " className='format' style={{ color: 'yellow' }}>Days Hours Minutes Seconds</p>
<p class="mr-3 ml-2 mt-3 mb-2" className='date' style={{ color: 'yellow' }}>{day}:{hour}:{minutes}:{seconds}</p>
{
props.display === 'start'
?
<Link to={props.loginStatus === true ? "/instructions" : "/login"}>

<button className="mr-3 ml-2 mt-2 mb-2 hunt-button ">
Start Hunting
</button>
</Link>
:
<Link to="/instructions">
<button className="mr-3 ml-2 mt-2 mb-2 inst-btn">
Instructions
</button>
</Link>
}

</div>
)
}
Expand Down
37 changes: 37 additions & 0 deletions client/src/pages/404/ErrorPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.error-page{
font-family: 'Press Start 2P', cursive;
color: white;
margin: 7% auto;
text-align: center;
}

.error-page h1{
color: red;
text-align: center;
font-size: 700%;
}
.error-page h2{
margin-top: 3%;
font-size:350%;
}
.error-page h3{
font-size: 200%;
margin: 4.5% 1% 1.5%;
}

@media screen and (max-width:1000px) {
.error-page{
margin: 17% auto;
}
.error-page h1{
font-size: 500%;
}
.error-page h2{
margin-top: 15%;
font-size:250%;
}
.error-page h3{
margin-top: 13%;
font-size: 150%;
}
}
Loading