From 4a0e1e614d5847a48cb19aec8918f416e1d88f43 Mon Sep 17 00:00:00 2001
From: 112Nisha <127508325+112Nisha@users.noreply.github.com>
Date: Fri, 14 Jun 2024 21:53:48 +0530
Subject: [PATCH 001/103] Outreach issue fixed
---
src/about_data.json | 41 +
src/analytics_data.json | 20 +-
src/components/Card.jsx | 21 +
src/components/Devcontent.jsx | 11 +-
src/components/ExpComponent.jsx | 184 +++++
src/components/ExperimentCard.jsx | 3 +-
src/components/ExperimentLoader.jsx | 781 +++++++++++++++++++
src/components/Footer.astro | 2 +-
src/components/Navbar.astro | 990 +++++++++++++------------
src/components/OrderTable.jsx | 73 +-
src/components/Role.astro | 56 +-
src/components/chart.jsx | 80 +-
src/components/exp.jsx | 5 +
src/components/faqs.jsx | 241 +++---
src/components/flask.jsx | 17 +
src/components/gears.jsx | 21 +
src/components/landing-card1-image.jsx | 43 ++
src/components/landing-card1.jsx | 39 +
src/components/landing-card2.jsx | 59 ++
src/components/landing-card3.jsx | 49 ++
src/components/loader.jsx | 4 +-
src/components/outreach.jsx | 73 ++
src/components/people_card.jsx | 238 +-----
src/components/random_experiment.jsx | 70 +-
src/components/role.jsx | 2 +-
src/components/search_filters.jsx | 42 +-
src/components/testimonials.jsx | 11 +-
src/components/timeline.jsx | 24 +
src/css/Devcontent.css | 4 +-
src/css/exp.css | 27 +
src/css/faq.css | 24 +-
src/css/gears.css | 176 +++++
src/css/landing-card1.css | 76 ++
src/css/landing-card2.css | 56 ++
src/css/landing-card3.css | 56 ++
src/css/linkcard.css | 59 ++
src/css/outreach.css | 59 ++
src/css/theme.css | 105 ++-
src/css/timeline.css | 76 ++
src/devprocess_docs.json | 58 +-
src/home_data.json | 16 +-
src/layouts/Base.astro | 60 +-
src/outreach.json | 26 +-
src/pages/404.astro | 14 +-
src/pages/VLEAD.astro | 141 ++++
src/pages/Vlabs.astro | 93 +++
src/pages/analytics.astro | 38 +-
src/pages/development.astro | 208 ++++++
src/pages/experiments.astro | 28 +-
src/pages/faq_page.astro | 9 +-
src/pages/index.astro | 252 ++-----
src/pages/outreach.astro | 561 ++++----------
src/pages/research.astro | 150 ++++
src/pages/virtual-box.astro | 31 +
src/particlesjs-config.json | 110 +++
src/research_docs.json | 33 +
56 files changed, 4021 insertions(+), 1725 deletions(-)
create mode 100644 src/about_data.json
create mode 100644 src/components/Card.jsx
create mode 100644 src/components/ExpComponent.jsx
create mode 100644 src/components/ExperimentLoader.jsx
create mode 100644 src/components/exp.jsx
create mode 100644 src/components/flask.jsx
create mode 100644 src/components/gears.jsx
create mode 100644 src/components/landing-card1-image.jsx
create mode 100644 src/components/landing-card1.jsx
create mode 100644 src/components/landing-card2.jsx
create mode 100644 src/components/landing-card3.jsx
create mode 100644 src/components/outreach.jsx
create mode 100644 src/components/timeline.jsx
create mode 100644 src/css/exp.css
create mode 100644 src/css/gears.css
create mode 100644 src/css/landing-card1.css
create mode 100644 src/css/landing-card2.css
create mode 100644 src/css/landing-card3.css
create mode 100644 src/css/linkcard.css
create mode 100644 src/css/outreach.css
create mode 100644 src/css/timeline.css
create mode 100644 src/pages/VLEAD.astro
create mode 100644 src/pages/Vlabs.astro
create mode 100644 src/pages/development.astro
create mode 100644 src/pages/research.astro
create mode 100644 src/pages/virtual-box.astro
create mode 100644 src/particlesjs-config.json
create mode 100644 src/research_docs.json
diff --git a/src/about_data.json b/src/about_data.json
new file mode 100644
index 0000000..d659358
--- /dev/null
+++ b/src/about_data.json
@@ -0,0 +1,41 @@
+{
+ "vlabs": {
+ "title": "Virtual Labs",
+ "description": "Making Engineering Education Engaging, Enjoyable, Immersive and Online",
+ "content": "The Virtual Labs project, which was established in 2009, represents a significant initiative of the Ministry of Education, Government of India. This innovative program, poised to drive a meaningful change in education and research in India, provides a platform for interactive learning through experiments.\n\nAmong the key groups targeted are students and faculty members of science and engineering colleges, who may lack access to high-quality laboratory facilities and equipment. Additionally, high school students are encouraged to explore their curiosity through the program, potentially inspiring them to pursue further studies in these fields.\n\nThe Virtual Labs project also seeks to create a network of researchers across different institutes, who can collaborate and share resources, thereby promoting the exchange of knowledge and ideas. Importantly, the project's content and teaching resources are designed to benefit engineering colleges and other institutions, making it a highly inclusive and impactful initiative.\n"
+ },
+ "vlead": {
+ "title": "Virtual Labs Engineering and Architecture Design",
+ "description": "A Platform for Hands-On Learning in Engineering and Architecture",
+ "content": "The Virtual Labs Engineering and Architecture Design (VLEAD) project is an extension of the Virtual Labs initiative, aimed at providing a platform for hands-on learning in engineering and architecture. This project, which was launched in 2019, seeks to enhance the practical skills and knowledge of students and faculty members in these disciplines.\n\nVLEAD offers a range of virtual experiments and simulations in various engineering and architecture domains, allowing users to explore and understand complex concepts through interactive modules. The project covers a wide spectrum of topics, including civil engineering, mechanical engineering, electrical engineering, and architecture, among others.\n\nBy providing a virtual environment for experimentation and learning, VLEAD enables users to engage with real-world scenarios and challenges, thereby enhancing their problem-solving abilities and critical thinking skills. The project also aims to foster collaboration and knowledge sharing among students, faculty members, and researchers, creating a vibrant community of learners in the engineering and architecture domains.\n"
+ },
+ "stats": {
+ "time": "Jan 2020 - Feb 2024",
+ "labs": 176,
+ "disciplines": 15,
+ "pageviews": "93.5 million",
+ "users": "14.6 million"
+ },
+ "phases": [
+ {
+ "phase": "Phase-1",
+ "years": "2009 - 2013",
+ "description": "Development of 27 Labs\n260 experiments across 4 domains\nOutreach Workshops"
+ },
+ {
+ "phase": "Phase-2",
+ "years": "2014 - 2017",
+ "description": "Virtual Labs Platform on Open edX\nFOSS Conversion Methodology\nCentralized Integration Platform\nLab Hosting on Central Cloud\nPerformance Enhancements\nVersion Control on GitHub\nSecurity Enhancements\nIntegration Workshops\nLab Development Kits\nMaintenance of Labs\nOutreach Portal"
+ },
+ {
+ "phase": "Phase-3",
+ "years": "2018 - 2020",
+ "description": "Centralized Analytics Reporting\nDevelopment of 2 CS Labs - 23 Data Structures experiments\nFOSS Conversion of 26 Labs\nAutomated Network Clusters\nPerformance Enhancements\nSecurity Enhancements\nPilot Translation of 2 Labs - Translated into Hindi & Telugu\nSummer/Winter/Remote Internships\nUniform UI across labs\nDeveloper Workshops\nMaintenance of Labs"
+ },
+ {
+ "phase": "Ext-Phase-3",
+ "years": "2021 - 2026",
+ "description": "Development of 16 Labs - Year 1 & 2\n140 experiments across 4 domains\nAutomated Lab Deployment Tool\nEnhanced Cloud Architecture\nCommon Developer Tools\nVirtual Labs Mobile App"
+ }
+ ]
+}
diff --git a/src/analytics_data.json b/src/analytics_data.json
index 644a48d..b1e7fe0 100644
--- a/src/analytics_data.json
+++ b/src/analytics_data.json
@@ -12,52 +12,52 @@
},
{
"heading": "IITB",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_kgv1t9wy0c",
"image": "https://cdn.vlabs.ac.in/logo/iitb.png"
},
{
"heading": "IITR",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_43b31nxy0c",
"image": "https://cdn.vlabs.ac.in/logo/iitr.png"
},
{
"heading": "IITG",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_gx2abgxy0c",
"image": "https://cdn.vlabs.ac.in/logo/iitg.png"
},
{
"heading": "IIITH",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_vg67w6wy0c",
"image": "https://cdn.vlabs.ac.in/logo/iiith.png"
},
{
"heading": "IITD",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_e13vjdxy0c",
"image": "https://cdn.vlabs.ac.in/logo/iitd.png"
},
{
"heading": "NITK",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_etrfqrxy0c",
"image": "https://cdn.vlabs.ac.in/logo/nitk.png"
},
{
"heading": "Amrita",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/M1UPB",
"image": "https://cdn.vlabs.ac.in/logo/amrita.png"
},
{
"heading": "Dayalbagh",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_hazvfvun0c",
"image": "https://cdn.vlabs.ac.in/logo/dayalbagh.png"
},
{
"heading": "COEP",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/p_k1d13trl0c",
"image": "https://cdn.vlabs.ac.in/logo/coep.png"
},
{
"heading": "Experiments",
- "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/5fLPB",
+ "iframe_src": "https://lookerstudio.google.com/embed/reporting/b40ac724-41f1-4b46-ba1b-c83f65284092/page/IKsQB",
"image": "https://cdn.vlabs.ac.in/logo/experiments.jpg"
}
]
diff --git a/src/components/Card.jsx b/src/components/Card.jsx
new file mode 100644
index 0000000..f2d1c00
--- /dev/null
+++ b/src/components/Card.jsx
@@ -0,0 +1,21 @@
+import React from 'react';
+import '../css/linkcard.css'
+
+const Card = ({ title, body, href, img }) => {
+ return (
+
+
+
+ {title}
+ →
+
+
+
+
+ {body}
+
+
+ );
+};
+
+export default Card;
\ No newline at end of file
diff --git a/src/components/Devcontent.jsx b/src/components/Devcontent.jsx
index 9b4b047..0f2ed41 100644
--- a/src/components/Devcontent.jsx
+++ b/src/components/Devcontent.jsx
@@ -84,7 +84,11 @@ export function Devcontent(props) {
);
}
+
+// use this function for document without contents menu
export function Outreach_devcontent(props) {
+
+ // pass "page" as a prop - either "workshop", or "workshop_faq", or pass the required raw github content url
const [content, setContent] = useState("");
const [loaded, setLoaded] = useState(false);
const [change, setchange] = useState(false);
@@ -102,17 +106,20 @@ export function Outreach_devcontent(props) {
`https://raw.githubusercontent.com/virtual-labs/outreach-web-pages-iiith/main/workshop-process/workshop-process.md`
);
}
+ else{
+ setUrl(props.page);
+ }
setchange(true);
}, []);
useEffect(() => {
const abc1 = async () => {
if (change) {
- if (props.page === "workshop") {
+ if (props.page !== "workshop_faq") {
const response = await fetch(url);
const text = await response.text();
setContent(text);
- } else {
+ } else{
let new_text = "\n";
for (let i = 1; i < 14; i++) {
const new_url = url + i + "/index.mdx";
diff --git a/src/components/ExpComponent.jsx b/src/components/ExpComponent.jsx
new file mode 100644
index 0000000..2cf8af3
--- /dev/null
+++ b/src/components/ExpComponent.jsx
@@ -0,0 +1,184 @@
+// not in use
+
+import 'bulma/css/bulma.min.css';
+import { FcSearch } from 'react-icons/fc';
+import { AiOutlineArrowLeft, AiOutlineArrowRight } from 'react-icons/ai'
+import ExperimentLoader from './ExperimentLoader.jsx';
+import React, { useState } from 'react';
+import { HiFilter } from 'react-icons/hi'
+import { RxCounterClockwiseClock } from 'react-icons/rx'
+import { AiFillExperiment, AiFillStar } from 'react-icons/ai'
+import { BsFillBookmarkStarFill } from 'react-icons/bs';
+import "../css/theme.css"
+import "../css/exp.css"
+import Loader from './loader.jsx';
+function ExpComponent() {
+ const [experiments, setExperiments] = React.useState([]);
+ const [nav, setNav] = useState(3);
+ const [word, setWord] = useState("");
+ const [page, setPage] = useState(1);
+ const [totalPage, setTotal] = useState(1);
+ const [Pop, setPop] = useState([]);
+ const [fetched, setFetched] = useState(false);
+ const LoadRecents = () => {
+ setPage(1)
+ setNav(1);
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("pop-tab").className = "dropdown-item"
+ document.getElementById("all-tabs").className = "dropdown-item"
+ document.getElementById("save-tabs").className = "dropdown-item"
+ document.getElementById("rec-tab").className = "dropdown-item is-active"
+ }
+ const LoadAll = () => {
+ setPage(1)
+ setNav(0);
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("pop-tab").className = "dropdown-item"
+ document.getElementById("rec-tab").className = "dropdown-item"
+ document.getElementById("save-tabs").className = "dropdown-item"
+ document.getElementById("all-tabs").className = "dropdown-item is-active"
+ }
+ const LoadSaved = () => {
+ setPage(1)
+ setNav(2);
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("pop-tab").className = "dropdown-item"
+ document.getElementById("all-tabs").className = "dropdown-item"
+ document.getElementById("rec-tab").className = "dropdown-item"
+ document.getElementById("save-tabs").className = "dropdown-item is-active"
+ }
+ const LoadPop = () => {
+ setPage(1)
+ setNav(3);
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ document.getElementById("rec-tab").className = "dropdown-item"
+ document.getElementById("all-tabs").className = "dropdown-item"
+ document.getElementById("save-tabs").className = "dropdown-item"
+ document.getElementById("pop-tab").className = "dropdown-item is-active"
+ }
+ const PrevPage = () => {
+ setPage(page - 1)
+ }
+ const NextPage = () => {
+ setPage(page + 1)
+ }
+ React.useEffect(() => {
+ const navsearch = sessionStorage.getItem("search")
+ if(navsearch)
+ {
+ setWord(navsearch)
+ sessionStorage.removeItem("search")
+ }
+ fetch("https://8kne7udek3.execute-api.ap-southeast-2.amazonaws.com/items")
+ .then((resp) => resp.json())
+ .then((data) => {
+ setExperiments(data);
+ setTotal(Math.ceil(data.length / 8))
+ let copy = [...data]
+ setPop(copy.sort((a, b) => b["Pageviews"] - a["Pageviews"]))
+ setFetched(true)
+ });
+ }, []);
+ const SearchExp = (e) => {
+ setWord(e.target.value)
+ }
+ const ToggleFilter = () => {
+ if (!document.getElementById("filter-set").className.includes("is-hidden-desktop is-hidden-tablet")) {
+ document.getElementById("filter-set").className = document.getElementById("filter-set").className + " is-hidden-desktop is-hidden-tablet";
+ document.getElementById("divider").className = document.getElementById("divider").className + " is-hidden-desktop is-hidden-tablet";
+ }
+ else {
+ document.getElementById("filter-set").className = 'column is-2 is-hidden-mobile is-hidden-tablet-only mr-4';
+ document.getElementById("divider").className = 'is-divider-vertical is-white is-hidden-mobile is-hidden-tablet-only';
+ }
+ document.getElementById("filter-model").className = document.getElementById("filter-model").className + " is-active"
+ }
+ const DropTabs = () => {
+ if (document.getElementById("tabs").className.includes("is-active")) {
+ document.getElementById("tabs").className = "dropdown is-hidden-desktop"
+ }
+ else document.getElementById("tabs").className = document.getElementById("tabs").className + " is-active"
+ }
+ return (
+ <>
+
+
+
+ {/*
+
+
*/}
+
+
+
+
+
+ Select Tab
+
+
+
+
+
+
+
+
+ {
+ totalPage != 0 ?
+ :
+ {/* {fetched ?
+ No Results Found
+ :
+ } */}
+ }
+ >
+ );
+}
+
+export default ExpComponent;
\ No newline at end of file
diff --git a/src/components/ExperimentCard.jsx b/src/components/ExperimentCard.jsx
index 935d1ca..8722405 100644
--- a/src/components/ExperimentCard.jsx
+++ b/src/components/ExperimentCard.jsx
@@ -1,3 +1,5 @@
+// not in use
+
import * as React from "react";
import Box from "@mui/joy/Box";
import AspectRatio from "@mui/joy/AspectRatio";
@@ -132,7 +134,6 @@ export const ExperimentCard = ({ data }) => {
mb: "6px",
}}
>
- {console.log(data["Tags"])}
{(data["Tags"].split(",")).map((tag, i) => (
{tag}
diff --git a/src/components/ExperimentLoader.jsx b/src/components/ExperimentLoader.jsx
new file mode 100644
index 0000000..d633bb3
--- /dev/null
+++ b/src/components/ExperimentLoader.jsx
@@ -0,0 +1,781 @@
+// not in use
+
+import React, { useState } from 'react'
+import 'bulma/css/bulma.min.css';
+import 'bulma-divider'
+import '@fortawesome/fontawesome-free/css/all.min.css'
+import 'bulma-switch'
+import { RxCounterClockwiseClock } from 'react-icons/rx'
+import { AiFillExperiment, AiFillStar, AiFillStepBackward, AiFillDelete, AiFillSave } from 'react-icons/ai'
+import { BsFillSave2Fill, BsFillBookmarkStarFill, BsFillBookmarkPlusFill, BsFillStickyFill } from 'react-icons/bs';
+import {ExpComponent} from 'cmp-exp-browser'
+import "../css/theme.css"
+import Loader from './loader';
+export default function ExperimentLoader(props) {
+ const [Instis, setInstis] = useState(["option1-Insti", "option2-Insti"])
+ const [Discipline, setDiscipline] = useState(["option1-discipline", "option2-dis"])
+ const [Display, setDisplay] = useState([])
+ const [SelectInstis, setSelectInstis] = useState([])
+ const [SelectDisciplines, setSelectDiscipline] = useState([])
+ const [History, setHistory] = useState([])
+ const [saved, setSaved] = useState([])
+ const [saved_filters, setSavedFilters] = useState(JSON.parse(localStorage.getItem("Saved_Filters")))
+ const [apply, setApply] = useState(1);
+ const [rename1, setRename1] = useState(0);
+ const [rename2, setRename2] = useState(0);
+ const [rename3, setRename3] = useState(0);
+ const [Exp,setExp] = useState([])
+ const [Word,setWord] = useState("")
+ const disc = {
+ "Civil Engineering": "CIVIL",
+ "Computer Science and Engineering": "CSE",
+ "Electronics and Communication Engineering": "ECE",
+ "Electrical Engineering": "ELECTRICAL",
+ "Mechanical Engineering": "MECHANICAL",
+ "Biotechnology and Biomedical Engineering": "BIO-TECH",
+ "Chemical Sciences": "CHEM-SCI",
+ "Physical Sciences": "PHY-SCI",
+ "Chemical Engineering": "CHEMICAL",
+ }
+
+ const IncludeDis = (element) => {
+ let copy = [...SelectDisciplines]
+ copy.push(element)
+ setSelectDiscipline(copy)
+ }
+ const ExcludeDis = (element) => {
+ let copy = [...SelectDisciplines]
+ let idx = copy.indexOf(element)
+ copy.splice(idx, 1)
+ setSelectDiscipline(copy)
+ }
+ const IncludeInsti = (element) => {
+ let copy = [...SelectInstis]
+ copy.push(element)
+ setSelectInstis(copy)
+ }
+ const ExcludeInsti = (element) => {
+ let copy = [...SelectInstis]
+ let idx = copy.indexOf(element)
+ copy.splice(idx, 1)
+ setSelectInstis(copy)
+ }
+ const CloseModal = () => {
+ document.getElementById("filter-model").className = "modal is-hidden-desktop";
+ }
+ const OpenLink = (link) => {
+ let name
+ for (let i of Display) {
+ if (i["Experiment URL"]===link)
+ name = i["Experiment Name"]
+ }
+ var a = localStorage.getItem("history");
+ if (a === null) a = ""
+ else a += ","
+ a = a.replace(name, "")
+ a += name
+ let links = a.split(",");
+ links = links.filter((ele) => {
+ return ele !==""
+ })
+ links.reverse()
+ setHistory(links.slice(0, 8))
+ localStorage.setItem("history", a);
+ var win = window.open("https://" + link, '_blank');
+ win.focus();
+ }
+ const LoadRecents = () => {
+ document.getElementById("recent-tab").className = document.getElementById("recent-tab").className.replace("primary", "info")
+ document.getElementById("save-tab").className = document.getElementById("save-tab").className.replace("info", "primary")
+ document.getElementById("all-tab").className = document.getElementById("all-tab").className.replace("info", "primary")
+ document.getElementById("popular-tab").className = document.getElementById("popular-tab").className.replace("info", "primary")
+ props.settp(Math.ceil(History.length / 8))
+ props.setp(1)
+ props.setNav(1);
+ }
+ const LoadSaved = () => {
+ document.getElementById("save-tab").className = document.getElementById("save-tab").className.replace("primary", "info")
+ document.getElementById("all-tab").className = document.getElementById("all-tab").className.replace("info", "primary")
+ document.getElementById("popular-tab").className = document.getElementById("popular-tab").className.replace("info", "primary")
+ document.getElementById("recent-tab").className = document.getElementById("recent-tab").className.replace("info", "primary")
+ props.settp(Math.ceil(saved.length / 8))
+ props.setp(1)
+ props.setNav(2);
+ }
+ const LoadAll = () => {
+ document.getElementById("all-tab").className = document.getElementById("all-tab").className.replace("primary", "info")
+ document.getElementById("save-tab").className = document.getElementById("save-tab").className.replace("info", "primary")
+ document.getElementById("popular-tab").className = document.getElementById("popular-tab").className.replace("info", "primary")
+ document.getElementById("recent-tab").className = document.getElementById("recent-tab").className.replace("info", "primary")
+ props.settp(Math.ceil(Display.length / 8))
+ props.setp(1)
+ props.setNav(0);
+ }
+ const LoadPop = () => {
+ document.getElementById("popular-tab").className = document.getElementById("recent-tab").className.replace("primary", "info")
+ document.getElementById("save-tab").className = document.getElementById("save-tab").className.replace("info", "primary")
+ document.getElementById("all-tab").className = document.getElementById("all-tab").className.replace("info", "primary")
+ document.getElementById("recent-tab").className = document.getElementById("popular-tab").className.replace("info", "primary")
+ props.settp(Math.ceil(History.length / 8))
+ props.setp(1)
+ props.setNav(3);
+ }
+ const SaveFilter = () => {
+ let a = {};
+ if (saved_filters) a = JSON.parse(JSON.stringify(saved_filters))
+ if (!a || !a["Filter1"]) {
+ a["Filter1"] = {
+ Instis: JSON.parse(JSON.stringify(SelectInstis)),
+ Discipline: JSON.parse(JSON.stringify(SelectDisciplines)),
+ AltName: "Filter1"
+ }
+ window.alert("Saved as Filter1")
+ localStorage.setItem("Saved_Filters", JSON.stringify(a));
+ setSavedFilters(a);
+ }
+ else if (!a["Filter2"]) {
+ a["Filter2"] = {
+ Instis: JSON.parse(JSON.stringify(SelectInstis)),
+ Discipline: JSON.parse(JSON.stringify(SelectDisciplines)),
+ AltName: "Filter2"
+ }
+ window.alert("Saved as Filter2")
+ localStorage.setItem("Saved_Filters", JSON.stringify(a));
+ setSavedFilters(a);
+ }
+ else if (!a["Filter3"]) {
+ a["Filter3"] = {
+ Instis: JSON.parse(JSON.stringify(SelectInstis)),
+ Discipline: JSON.parse(JSON.stringify(SelectDisciplines)),
+ AltName: "Filter3"
+ }
+ window.alert("Saved as Filter3")
+ localStorage.setItem("Saved_Filters", JSON.stringify(a));
+ setSavedFilters(a);
+ }
+ else {
+ window.alert("3 filters already saved. Delete some first")
+ }
+ }
+ const ToggleSave = (exp) => {
+ if (saved.includes(exp)) {
+ let a = localStorage.getItem("saved");
+ a = a.replace(exp, "")
+ let saves = a.split(",");
+ saves = saves.filter((ele) => {
+ return ele !==""
+ })
+ setSaved(saves)
+ localStorage.setItem("saved", saves.join(","))
+ }
+ else {
+ let a = localStorage.getItem("saved");
+ a += "," + exp
+ let saves = a.split(",");
+ saves = saves.filter((ele) => {
+ return ele !==""
+ })
+ setSaved(saves)
+ localStorage.setItem("saved", saves.join(","))
+ }
+ }
+ const ClearFilter = () => {
+ setSelectDiscipline([])
+ setSelectInstis([])
+ }
+ const ApplyFilter = (name) => {
+ setSelectDiscipline(saved_filters[name]["Discipline"]);
+ setSelectInstis(saved_filters[name]["Instis"])
+ window.alert(saved_filters[name]["AltName"] + " Applied")
+ setApply(1);
+ }
+ const RenameFilter = (name) => {
+ if (name==="Filter1") setRename1(1 - rename1);
+ else if (name==="Filter2") setRename2(1 - rename2);
+ else if (name==="Filter3") setRename3(1 - rename3);
+ }
+ const ChangeName = (name, val) => {
+ if (val && val !=="") {
+ let a = JSON.parse(JSON.stringify(saved_filters))
+ a[name]["AltName"] = val;
+ setSavedFilters(a)
+ localStorage.setItem("Saved_Filters", JSON.stringify(a));
+ RenameFilter(name)
+ }
+ }
+ const DeleteFilter = (name) => {
+ let a = JSON.parse(JSON.stringify(saved_filters))
+ a[name] = null;
+ setSavedFilters(a)
+ localStorage.setItem("Saved_Filters", JSON.stringify(a));
+ window.alert("Filter deleted")
+ }
+ React.useEffect(()=>{
+ const card = sessionStorage.getItem("selectedCard")
+ if(card)
+ {
+ setSelectDiscipline([card])
+ sessionStorage.removeItem("selectedCard")
+ }
+ },[])
+ React.useEffect(() => {
+ setExp(props.experiments)
+ setWord(props.word)
+ }, [props]);
+ React.useEffect(() => {
+ let arr = []
+ let arr_dis = []
+ for (let i of Exp) {
+ if (!arr.includes(i["Insitute Name"]))
+ arr.push(i["Insitute Name"])
+ if (!arr_dis.includes(i["Discipline Name"]))
+ arr_dis.push(i["Discipline Name"])
+ }
+ let a = ""
+ if (localStorage.getItem("history") !== undefined && localStorage.getItem("history") !== null) {
+ a = localStorage.getItem("history")
+ }
+ let links = a.split(",")
+ links = links.filter((ele) => {
+ return ele !==""
+ })
+ links.reverse()
+ if (localStorage.getItem("saved") === null) {
+ localStorage.setItem("saved", "")
+ }
+ else {
+ setSaved(localStorage.getItem("saved").split(",").filter((ele) => {
+ return ele !=="";
+ }))
+ }
+ setInstis(arr)
+ setDiscipline(arr_dis)
+ setDisplay(Exp)
+ setHistory(links)
+ }, [Exp]);
+
+ React.useEffect(() => {
+ let arr = []
+ let arr_after_search = []
+ if (Word === "") {
+ arr_after_search = [...Exp]
+ }
+ else {
+ for (let i of Exp) {
+ if (i["Experiment Name"].toLowerCase().includes(Word.toLowerCase()) ||
+ i["Lab Name"].toLowerCase().includes(Word.toLowerCase())) {
+ arr_after_search.push(i)
+ }
+ else {
+ let flag = false
+ for (let j of i["Tags"].split()) {
+ if (j.toLowerCase().includes(Word.toLowerCase())) {
+ flag = true;
+ break;
+ }
+ }
+ if (flag) arr_after_search.push(i)
+ }
+ }
+ }
+ if (SelectDisciplines.length === 0 && SelectInstis.length === 0) {
+ setDisplay(arr_after_search)
+ props.setp(1);
+ props.settp(Math.ceil(arr_after_search.length / 8))
+ return;
+ }
+ for (let i of arr_after_search) {
+ if ((SelectDisciplines.includes(i["Discipline Name"]) || SelectDisciplines.length===0) &&
+ (SelectInstis.includes(i["Insitute Name"]) || SelectInstis.length===0)) {
+ arr.push(i)
+ }
+ }
+ setDisplay(arr)
+ props.setp(1);
+ props.settp(Math.ceil(arr.length / 8))
+ }, [Exp,SelectDisciplines, SelectInstis, Word]);//eslint-disable-line
+ return (
+
+
+
+
+
+
+
+ {apply ? <>
+ Institutes
+ {
+ Instis.map((element) => {
+ if (SelectInstis.includes(element))
+ return (
+ <>
+ { ExcludeInsti(element) }} style={{ height: "max-content", whiteSpace: "inherit" }}>{element}
+ >
+ )
+ else
+ return (
+ <>
+ { IncludeInsti(element) }}
+ style={{
+ boxShadow: "0 8px 8px 8px rgba(0,0,0,0.4)",
+ height: "max-content", whiteSpace: "inherit"
+ }}>{element}
+ >
+ )
+ })
+ }
+
+
+
+ Discipline
+ {
+ Discipline.map((element) => {
+ if (SelectDisciplines.includes(element))
+ return (
+ <>
+ { ExcludeDis(element) }} style={{ height: "max-content", whiteSpace: "inherit" }}>{disc[element]}
+
+ >
+ )
+ else
+ return (
+ <>
+ { IncludeDis(element) }}
+ style={{
+ boxShadow: "0 8px 8px 8px rgba(0,0,0,0.4)",
+ height: "max-content", whiteSpace: "inherit"
+ }}>{disc[element]}
+
+ >
+ )
+ })
+ }
+
> : null}
+ {
+ apply===0 ? <>
+
+ > : null
+ }
+
+
+ {apply ?
+ <> {
+ setApply(0);
+ }}> View Saved
+ Clear
+ Save > : null}
+ {
+ !apply ? <> {
+ setApply(1);
+ }}> Back
+ > : null
+ }
+
+
+
+
+
+
Popular
+
+
Recents
+
+
All Experiments
+
+
Starred
+
+
+
+ {
+ props.nav===0 ? (
+
+ {
+ props.settp(Math.ceil(Display.length / 8))
+ }
+ {
+ Display.slice((props.pagenum - 1) * 8, (props.pagenum) * 8).map((exp) => {
+ return (
+
+ { OpenLink(exp["Experiment URL"]) }} onValueChange={() => { ToggleSave(exp["Experiment Name"]) }} UserData={{
+ exp_name: exp["Experiment Name"],
+ institute: exp["Insitute Name"],
+ exp_link: exp["Experiment URL"],
+ exp_img: exp["Image"],
+ institute_img: "https://cdn.vlabs.ac.in/logo/" + exp["Insitute Name"].toLowerCase() + ".png",
+ card_content: exp["Description"],
+ rating: exp["Rating"],
+ domain: exp["Discipline Name"],
+ lab: exp["Lab Name"],
+ saved: saved.includes(exp["Experiment Name"])
+ }} />
+
+ )
+ })
+ }
+
) : null}
+ {
+ props.nav===1 ? (
+
+ {
+ props.settp(Math.ceil(History.filter((ele) => {
+ for (let i of Display) {
+ if (i["Experiment Name"] === ele) {
+ return true;
+ }
+ }
+ return false;
+ }).length / 8))
+ }
+ {
+ History.filter((ele) => {
+ for (let i of Display) {
+ if (i["Experiment Name"] === ele) {
+ return true;
+ }
+ }
+ return false;
+ }).slice((props.pagenum - 1) * 8, (props.pagenum) * 8).map((exp) => {
+ let a = {}
+ for (let i of props.experiments) {
+ if (i["Experiment Name"] === exp) {
+ a = i;
+ break;
+ }
+ }
+ return (
+
+ { OpenLink(a["Experiment URL"]) }} onValueChange={() => { ToggleSave(a["Experiment Name"]) }} UserData={{
+ exp_name: a["Experiment Name"],
+ institute: a["Insitute Name"],
+ exp_link: a["Experiment URL"],
+ exp_img: a["Image"],
+ institute_img: "https://cdn.vlabs.ac.in/logo/" + a["Insitute Name"].toLowerCase() + ".png",
+ card_content: a["Description"],
+ rating: a["Rating"],
+ domain: a["Discipline Name"],
+ lab: a["Lab Name"],
+ saved: saved.includes(a["Experiment Name"])
+ }} />
+
+ )
+ })
+ }
+
) : null}
+ {
+ props.nav===2 ? (
+ {
+ props.settp(Math.ceil(saved.filter((ele) => {
+ for (let i of Display) {
+ if (i["Experiment Name"] === ele) {
+ return true;
+ }
+ }
+ return false;
+ }).length / 8))
+
+ }
+ {
+ saved.filter((ele) => {
+ for (let i of Display) {
+ if (i["Experiment Name"] === ele) {
+ return true;
+ }
+ }
+ return false;
+ }).slice((props.pagenum - 1) * 8, (props.pagenum) * 8).map((exp) => {
+ let a = {}
+ for (let i of props.experiments) {
+ if (i["Experiment Name"] === exp) {
+ a = i;
+ break;
+ }
+ }
+ return (
+
+ { OpenLink(a["Experiment URL"]) }} onValueChange={() => { ToggleSave(a["Experiment Name"]) }} UserData={{
+ exp_name: a["Experiment Name"],
+ institute: a["Insitute Name"],
+ exp_link: a["Experiment URL"],
+ exp_img: a["Image"],
+ institute_img: "https://cdn.vlabs.ac.in/logo/" + a["Insitute Name"].toLowerCase() + ".png",
+ card_content: a["Description"],
+ rating: a["Rating"],
+ domain: a["Discipline Name"],
+ lab: a["Lab Name"],
+ saved: saved.includes(a["Experiment Name"])
+ }} />
+
+ )
+ })
+ }
+
) : null}
+ {
+ props.nav===3 ? (
+ {
+ props.settp(Math.ceil(Math.min(8, Display.length) / 8))
+ }
+ {
+ props.pop.filter((ele) => {
+ if (Display.includes(ele)) return true;
+ else return false;
+ }).slice(0, 8).slice((props.pagenum - 1) * 8, (props.pagenum) * 8).map((exp) => {
+ return (
+
+ { OpenLink(exp["Experiment URL"]) }} onValueChange={() => { ToggleSave(exp["Experiment Name"]) }} UserData={{
+ exp_name: exp["Experiment Name"],
+ institute: exp["Insitute Name"],
+ exp_link: exp["Experiment URL"],
+ exp_img: exp["Image"],
+ institute_img: "https://cdn.vlabs.ac.in/logo/" + exp["Insitute Name"].toLowerCase() + ".png",
+ card_content: exp["Description"],
+ rating: exp["Rating"],
+ domain: exp["Discipline Name"],
+ lab: exp["Lab Name"],
+ saved: saved.includes(exp["Experiment Name"])
+ }} />
+
+ )
+ })
+ }
+
) : null}
+ {
+ props.pages===0?(
+ {props.fetched ?
+ No Results Found
+ :
+ }
+ ):(null)
+ }
+
+
+
+
+
+ {apply ? <>
+
+
+ {" "}Apply
+
+
+
+ {
+ setApply(0);
+ }}>
+ Load
+
+
+ > : null}
+ {!apply ? <>
+
+ {
+ setApply(1);
+ }}>
+ {" "}Apply
+
+
+
+
+ Load
+
+
+ > : null}
+
+
+ {apply ? <>
+
+ Institutes
+
+ {
+ Instis.map((element) => {
+ if (SelectInstis.includes(element))
+ return (
+ <>
+ { ExcludeInsti(element) }} style={{ height: "max-content", whiteSpace: "inherit" }}>{element}
+ >
+ )
+ else
+ return (
+ <>
+ { IncludeInsti(element) }}
+ style={{
+ boxShadow: "0 8px 8px 8px rgba(0,0,0,0.4)",
+ height: "max-content", whiteSpace: "inherit"
+ }}>{element}
+ >
+ )
+ })
+ }
+
+
+
+ Discipline
+
+ {
+ Discipline.map((element) => {
+ if (SelectDisciplines.includes(element))
+ return (
+ <>
+ { ExcludeDis(element) }} style={{ height: "max-content", whiteSpace: "inherit" }}>{disc[element]}
+ >
+ )
+ else
+ return (
+ <>
+ { IncludeDis(element) }}
+ style={{
+ boxShadow: "0 8px 8px 8px rgba(0,0,0,0.4)",
+ height: "max-content", whiteSpace: "inherit"
+ }}>{disc[element]}
+ >
+ )
+ })
+ }
+
+
+
+ > : null}
+ {
+ apply===0 ? <>
+
+ > : null
+ }
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
index 614ab8e..52c0a43 100644
--- a/src/components/Footer.astro
+++ b/src/components/Footer.astro
@@ -3,7 +3,7 @@ import all from "../footer_data.json";
---
-