Skip to content

Commit

Permalink
Merge branch 'production' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LuvGuptaa authored Mar 1, 2024
2 parents 4753cd4 + c28208c commit 897fdb2
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 75 deletions.
4 changes: 2 additions & 2 deletions src/Components/PDFDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const options = {
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;

// Create Document Component
export default function PDFDocument() {
export default function PDFDocument({file}) {

const [numPages, setNumPages] = React.useState(1);
function onDocumentLoadSuccess({ numPages }) {
Expand All @@ -30,7 +30,7 @@ export default function PDFDocument() {

return (
<Document
file={pdfFile}
file={file}
onLoadSuccess={onDocumentLoadSuccess}
options={options}
className={styles.pdf}
Expand Down
6 changes: 3 additions & 3 deletions src/Components/ScoreCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export default function ScoreCard({ data = null }) {
)}
</div>
<div className={styles.teamNames}>
<span className={`${styles.teamName} ${team2 && team1 !== data.winner && data.winner !== null && styles.winningTeam}`}>
{data === null ? "BITS P" : team1}
<span className={`${styles.teamName} ${team2 && team1 !== data.winner && data.winner !== "" && styles.winningTeam}`}>
{data === "" ? "BITS P" : team1}
</span>
{data !== null && data.team_scores.length === 2 && (
<>
<span className={styles.vsText}>VS</span>
<span className={`${styles.teamName} ${team2 && team2 !== data.winner && data.winner !== null && styles.winningTeam}`}>{team2}</span>
<span className={`${styles.teamName} ${team2 && team2 !== data.winner && data.winner !== "" && styles.winningTeam}`}>{team2}</span>
</>
)}
</div>
Expand Down
32 changes: 25 additions & 7 deletions src/Styles/Articles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
scale: 0.7;
width: 10%;
/* margin-right: auto; */

display: none;
}

.title {
Expand Down Expand Up @@ -67,7 +69,7 @@
}

.slide {
background-color: white;
/* background-color: white; */
overflow: scroll;
}

Expand All @@ -84,6 +86,8 @@

display: grid;
justify-items: center;

background-color: transparent !important;
}

.pdfpage > canvas {
Expand Down Expand Up @@ -125,6 +129,21 @@
cursor: pointer;
}

.noArticles{
color: black;
font-family: Montserrat;
font-size: 1.8rem;
font-style: normal;
font-weight: 600;
line-height: normal;
letter-spacing: 2.4px;
text-align: center;

height: 100%;
display: grid;
place-items: center;
}

@media screen and (max-width: 768px) {
.heading {
height: 7vh;
Expand All @@ -151,16 +170,15 @@
.heading {
height: 7vh;
}
.carouselWrapper {
/* height: 90%; */
}
.heading h1 {
font-size: 1.3rem;
}
.carousel {
/* height: 85%; */
}
.articleAuthor p {
font-size: 1rem;
}

.noArticles{
font-size: 1.2rem;
}

}
3 changes: 2 additions & 1 deletion src/Styles/Sponsors.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
width: 100vw;
height: 100vh;
background: url('../images/contact_bg.png') no-repeat center center fixed;
background-size: cover;
overflow: scroll;
background-size: cover;
}
Expand Down Expand Up @@ -87,4 +88,4 @@
.sponsor p{
font-size: 1rem;
}
}
}
Binary file added src/images/EPC Day 1.pdf
Binary file not shown.
Binary file added src/images/EPC Day 2.pdf
Binary file not shown.
Binary file added src/images/EPC Day 3.pdf
Binary file not shown.
Binary file added src/images/EPC Day 4.pdf
Binary file not shown.
Binary file added src/images/HPC Day 1.pdf
Binary file not shown.
Binary file added src/images/HPC Day 2.pdf
Binary file not shown.
Binary file added src/images/HPC Day 3.pdf
Binary file not shown.
Binary file added src/images/HPC Day 4.pdf
Binary file not shown.
Binary file removed src/images/Shreyas.png
Binary file not shown.
Binary file removed src/images/shreyas.jpg
Binary file not shown.
Binary file removed src/images/shreyas.png
Binary file not shown.
20 changes: 16 additions & 4 deletions src/pages/EPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import { Navigation, Mousewheel } from "swiper/modules";
// PDF Compoenent
import PDFDocument from "../Components/PDFDocument";

// Importing all pdfs
import day1 from "../images/EPC Day 1.pdf"
import day2 from "../images/EPC Day 2.pdf"
import day3 from "../images/EPC Day 3.pdf"
import day4 from "../images/EPC Day 4.pdf"

export default function EPC() {
return (
<main className={styles.pageWrapper}>
Expand All @@ -27,7 +33,7 @@ export default function EPC() {
content="width=device-width, user-scalable=no"
></meta> */}
<header className={styles.heading}>
<Link to="/" className={styles.back}>
{/* <Link to="/" className={styles.back}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="49"
Expand All @@ -43,7 +49,7 @@ export default function EPC() {
stroke-linejoin="round"
/>
</svg>
</Link>
</Link> */}
<div className={styles.title}>
<h1>Articles</h1>
</div>
Expand Down Expand Up @@ -81,10 +87,16 @@ export default function EPC() {
modules={[Navigation, Mousewheel]}
>
<SwiperSlide className={styles.slide}>
<PDFDocument />
<PDFDocument file={day4}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument />
<PDFDocument file={day3}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument file={day2}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument file={day1}/>
</SwiperSlide>
{/* <SwiperSlide className={styles.slide}>
<PDFDocument />
Expand Down
46 changes: 32 additions & 14 deletions src/pages/HPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ import { Navigation, Mousewheel } from "swiper/modules";
// PDF Compoenent
import PDFDocument from "../Components/PDFDocument";

export default function EPC() {
// Import pdf files
import day1 from "../images/HPC Day 1.pdf"
import day2 from "../images/HPC Day 2.pdf"
import day3 from "../images/HPC Day 3.pdf"
import day4 from "../images/HPC Day 4.pdf"

export default function HPC() {

return (
<main className={styles.pageWrapper}>
<meta
Expand Down Expand Up @@ -81,32 +88,43 @@ export default function EPC() {
modules={[Navigation, Mousewheel]}
>
<SwiperSlide className={styles.slide}>
<PDFDocument />
<PDFDocument file={day4}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument file={day3}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument file={day2}/>
</SwiperSlide>
<SwiperSlide className={styles.slide}>
<PDFDocument />
<PDFDocument file = {day1}/>
</SwiperSlide>
{/* <SwiperSlide className={styles.slide}>
<PDFDocument />
</SwiperSlide> */}
</Swiper>

<div className={styles.carouselController}>
<button className={styles.leftArrow} onClick={()=>{
const swiper = document.querySelector('.swiper').swiper
swiper.slidePrev()
}}>
<button
className={styles.leftArrow}
onClick={() => {
const swiper = document.querySelector(".swiper").swiper;
swiper.slidePrev();
}}
>
<img src={leftArrow} alt="" />
</button>
<div className={styles.articleAuthor}>
<p>Hindi Press Club</p>
</div>
<button className={styles.rightArrow} onClick={()=>{
const swiper = document.querySelector('.swiper').swiper
swiper.slideNext()
}}>
<button
className={styles.rightArrow}
onClick={() => {
const swiper = document.querySelector(".swiper").swiper;
swiper.slideNext();
}}
>
<img src={rightArrow} alt="" />
</button>
</div>

</div>
</main>
);
Expand Down
40 changes: 14 additions & 26 deletions src/pages/developers.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const Developers = () => {
jersey: "07",
hostel: "SK",
},

{
id: 2,
name: "Shreyas Gantayet",
Expand All @@ -68,6 +69,18 @@ const Developers = () => {
jersey: "09",
hostel: "RM",
},
{
id: 3,
name: "Shreyas Gantayet",
desc: "git touch grass",
image: shreyasDVM,
linkedin: "https://www.linkedin.com/in/shreyas-gantayet-4b5993280/",
github: "https://github.com/Y0shicon",
instagram: "https://www.instagram.com/shreyyas.04/",
behance: "",
jersey: "18",
hostel: "VY",
},
{
id: 4,
name: "Bharat Raj Singal",
Expand Down Expand Up @@ -102,7 +115,6 @@ const Developers = () => {
linkedin: "https://www.linkedin.com/in/shirsh-jain-5a5b751b9",
github: "",
instagram: "",
behance: "",
jersey: "00",
hostel: "AK",
},
Expand All @@ -120,7 +132,7 @@ const Developers = () => {
},
{
id: 3,
name: "RaCl",
name: "Raj Clerk",
desc: "only person in back who has a gf",
image: raj,
linkedin: "https://www.linkedin.com/in/rajclerk",
Expand All @@ -142,18 +154,6 @@ const Developers = () => {
jersey: "18",
hostel: "AK",
},
{
id: 5,
name: "",
desc: "",
image: "",
linkedin: "",
github: "",
instagram: "",
behance: "",
jersey: "",
hostel: "",
},
]
const DesignTeam = [
{
Expand Down Expand Up @@ -204,18 +204,6 @@ const Developers = () => {
jersey: "36",
hostel: "RM",
},
{
id: 5,
name: "",
desc: "",
image: "",
linkedin: "",
github: "",
instagram: "",
behance: "",
jersey: "",
hostel: "",
},
]

// const FrontTeam = [
Expand Down
38 changes: 20 additions & 18 deletions src/pages/scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ export default function Index() {
const marqueeRef = React.useRef(null);

React.useEffect(() => {
// fetch("https://test.bitsbosm.org/2023/live-score/send-data")
// .then((res) => res.json())
// .then((data) => {
// // setData([...JSON.parse(data), ...JSON.parse(data), ...JSON.parse(data), ...JSON.parse(data)]);
// setData(JSON.parse(data).slice(0, -1));
// console.log(JSON.parse(data).at(-1));
// setAnnouncement(JSON.parse(data).at(-1).text);
// });

const socket = new WebSocket("wss://test.bitsbosm.org/2023/ws/live_score/");
fetch("https://bitsbosm.org/2023/live-score/send-data")
.then((res) => res.json())
.then((data) => {
// setData([...JSON.parse(data), ...JSON.parse(data), ...JSON.parse(data), ...JSON.parse(data)]);
setData(JSON.parse(data));
});

const socket = new WebSocket("wss://bitsbosm.org/2023/ws/live_score/");
socket.onopen = (e) => {
console.log("connected");
// console.log(e.data)
Expand Down Expand Up @@ -70,11 +68,11 @@ export default function Index() {
}

// temp for testing
setAllScoreCards(
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((item, index) => {
return <ScoreCard key={index} />;
})
);
// setAllScoreCards(
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((item, index) => {
// return <ScoreCard key={index} />;
// })
// );

// console.log(data);
// console.log(announcement);
Expand Down Expand Up @@ -112,7 +110,7 @@ export default function Index() {
</div>
<h1>SCOREBOARD</h1>
</div>
{typeof window !== "undefined" &&
{/* {typeof window !== "undefined" &&
announcement !== null &&
window.innerWidth > 768 &&
isPlaying ? (
Expand All @@ -131,12 +129,16 @@ export default function Index() {
announcement !== null &&
window.innerWidth > 768 &&
!isPlaying ? (
<div ref={marqueeRef} className={styles.announcement} style={{justifyContent: "center"}}>
<div
ref={marqueeRef}
className={styles.announcement}
style={{ justifyContent: "center" }}
>
<p ref={pRef}>{announcement}</p>
</div>
) : (
<></>
)}
)} */}
<div
className={
data || allScoreCards ? styles.scoreboardGrid : styles.loaderGrid
Expand Down

0 comments on commit 897fdb2

Please sign in to comment.