Skip to content

Commit

Permalink
Add: Search
Browse files Browse the repository at this point in the history
  • Loading branch information
selsayed25 committed Feb 25, 2024
1 parent 900c053 commit dd31a44
Show file tree
Hide file tree
Showing 15 changed files with 381 additions and 70 deletions.
Binary file added public/assets/team.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions src/app/College/Stanford/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import Image from "next/image";
import React from 'react';
import
// import collegediversity fro../m '../../../../public/data/collegediversity.json' assert {type: 'json'};
// import historicaltuition from '../../../../public/data/historicaltuition.json';
// import salarypotential fro../m '../../../../public/data/salarypotential.json';
// import tuitioncost fro../m '../../../../public/data/tuitioncost.json';


import Nav from '../../components/nav';import { promises as fs } from 'fs';

export default async function School(collegename) {
// const file = await fs.readFile(process.cwd() + '../../../public/data/collegediversity.json', 'utf8');
// const data = JSON.parse(file);
const dictionary = new Map();
async function fetchData(collegename) {
try {
for (var i = 0; i < arr.length; i++){
//document.write("<br><br>array index: " + i);
var obj = collegediversity[i];
if (obj["name"] === collegename) {
dictionary.set(obj["catagory"],obj["enrollment"]);
}
}

if(response.catagory == "Woman") {
throw new Error("Could not fetch resource");
}
}

catch(error){
console.error(error);
}
}
return (
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden">
<Nav />
<section className="grid grid-cols-1 place-items-center" id="welcome">
<div className=" text- text-6xl font-bold py-64">
<h1 className="text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">Colleges</h1>
</div>
</section>

{/* Collge Info */}
<section className="text-center">
<div class="container">
<h1 className="text-4xl font-bold">University of Phoenix-Arizona</h1>
</div >
<div className="" id="">
<h1 className="text-4xl font-bold">State: {collegediversity[0].state}</h1>
</div>
<div className="" id="">
enenrollment <h1 className="text-4xl font-bold">Total Enrollment: {collegediversity[0].state}</h1>
</div>
<h1>Racial Distribution of Pheonix-Arizona University</h1>
<div>
<canvas id = "pie-chart"></canvas>
</div>
<script src = "chart.min.js"></script>
<script>
new Chart(document.getElementById('pie-chart'), {
type: 'pie',
data : {
lables : ['Black','American Indian / Alaska Native','Asian', 'Hispanic','Native Hawaiian / Pacific Islander','White','Mixed'],
datasets: [{
backgroundColor: ["#e63946", "#254BDD",
"#ffbe0b", "#1d3557", "#326998","#99FFFF","#FF6666"
],
data: [ ]
}]
}
})
</script>
</section>
</main>
);
}
/*
async function fetchData() {
try {
const response = await fetch('../../../public/data/tuitioncost.json')
if(response.catagory == "Woman") {
throw new Error("Could not fetch resource");
}
const data = await resoponse.json();
console.log(dat)
}
catch(error){
console.error(error)
}
}*/
File renamed without changes.
13 changes: 11 additions & 2 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ import Nav from "../components/nav";
export default function About() {
return (
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden">
<section className="grid bg-no-repeat bg-contain bg-opaque-50 opaque-20 " style={{
backgroundImage: `url('https://scontent-lga3-1.xx.fbcdn.net/v/t1.15752-9/429620811_1210826496561105_8084450748745246719_n.jpg?stp=dst-jpg_s2048x2048&_nc_cat=102&ccb=1-7&_nc_sid=8cd0a2&_nc_ohc=JsbuXfAUewwAX_vgzLL&_nc_ht=scontent-lga3-1.xx&oh=03_AdQI1O4-DE41K8tObuXq8D2l_V3XbrZqNLBwo6X-50w7Xg&oe=66024DFA')`,
height: "972px",

}} >
<Nav />
<section className="grid grid-cols-1 place-items-center" id="welcome">
<div className=" text- text-6xl font-bold py-64">
<h1 className="text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">About Us</h1>
{/* <div className=" text- text-6xl font-bold py-64">
<h1 className="text-white text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">About Us</h1>
</div> */}
<div className="text-8xl font-bold">
<h1 className="mb-20 text-white drop-shadow-lg text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 brightness-100 p-50">About Us</h1>
</div>
</section>
</section>

{/* About */}

Expand Down
20 changes: 20 additions & 0 deletions src/app/college/Stanford/chart.min.js

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions src/app/college/Stanford/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import Image from "next/image";
import React from 'react';
import collegediversity from '../../../../public/data/collegediversity.json' assert {type: 'json'};
import historicaltuition from '../../../../public/data/historicaltuition.json';
import salarypotential from '../../../../public/data/salarypotential.json';
import tuitioncost from '../../../../public/data/tuitioncost.json';
import { promises as fs } from 'fs';
import Nav from '../../components/nav';

export default async function School(collegename) {
// const file = await fs.readFile(process.cwd() + '../../../public/data/collegediversity.json', 'utf8');
// const data = JSON.parse(file);
async function fetchData(collegename) {
const dictionary = new Map();
try {
for (var i = 0; i < arr.length; i++){
//document.write("<br><br>array index: " + i);
var obj = collegediversity[i];
if (obj["name"] === collegename) {
dictionary.set(obj["catagory"],obj["enrollment"]);
}
}

if(response.catagory == "Woman") {
throw new Error("Could not fetch resource");
}
}

catch(error){
console.error(error);
}
}
return (
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden">
<Nav />
<section className="grid grid-cols-1 place-items-center" id="welcome">
<div className=" text- text-6xl font-bold py-64">
<h1 className="text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 ">School</h1>
</div>
</section>

{/* Collge Info */}
<section className="text-center">
<div class="container">
<h1 className="text-4xl font-bold">University of Phoenix-Arizona</h1>
</div >
<div className="" id="">
<h1 className="text-4xl font-bold">State: {collegediversity[0].state}</h1>
</div>
<div className="" id="">
<h1 className="text-4xl font-bold">Total Enrollment: {collegediversity[0].enrollment}</h1>
</div>
</section>
</main>
);
}
/*
async function fetchData() {
try {
const response = await fetch('../../../public/data/tuitioncost.json')
if(response.catagory == "Woman") {
throw new Error("Could not fetch resource");
}
const data = await resoponse.json();
console.log(dat)
}
catch(error){
console.error(error)
}
}*/
38 changes: 38 additions & 0 deletions src/app/college/Stanford/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap");

* {
box-sizing: border-box;
}

body {
background-color: #f9fafb;
font-family: "Open Sans", sans-serif;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
}
.container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
width: 740px;
}
h1 {
text-align: center;
margin: 20px 0;
color: #565656;
}

@media all and (max-width: 780px) {
.container {
width: auto;
}
}

@media all and (max-width: 400px) {
.container {
padding: 0px 20px;
}
}
3 changes: 0 additions & 3 deletions src/app/college/page.jsx

This file was deleted.

10 changes: 5 additions & 5 deletions src/app/components/Testimonial.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
.quotes-img-right {
justify-self: end;
background-image: url(https://raw.githubusercontent.com/novel-code/testimonial-video-4/master/assets/left.png);
margin-right: 20px;
margin-right: 40px;
}

.quotes-img-left {
background-image: url(https://raw.githubusercontent.com/novel-code/testimonial-video-4/master/assets/right.png);
margin-left: 20px;
margin-left: 40px;
}

.section-three-sub-div-one {
Expand All @@ -37,8 +37,8 @@
background-size: cover;
background-repeat: no-repeat;
background-position: center;
width: 25px;
height: 23px;
width: 60px;
height: 57px;
}

/* ------------------ */
Expand All @@ -49,7 +49,7 @@

.subText {
margin-top: 1rem;
font-size: 14px;
font-size: 20px;
color: #999999;
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/components/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Link from "next/link";
export default function Nav() {
return (
<section className="pl-10 pr-10 pt-5">
<div className="nav">
<nav className=" flex justify-between items-center p-4 bg-gray-800 text-white rounded-lg">
<div className="nav drop-shadow-lg">
<nav className=" flex justify-between items-center p-4 bg-nicebrown text-white rounded-lg">
<div>
<Link href="/">
InsightEdu
Expand Down
2 changes: 1 addition & 1 deletion src/app/data/collegediversity.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "University of Phoenix-Arizona",
"total_enrollment": 195059,
"state": "Arizona",
"category": "Women",
"category": "Black",
"enrollment": 134722
},
{
Expand Down
78 changes: 43 additions & 35 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { useRouter } from 'next/navigation';
import {useState} from 'react'
import Image from "next/image";
import Link from "next/link";
import React from 'react';
Expand All @@ -9,47 +10,54 @@ import Testimonial from "./components/Testimonial";
import data from "../../public/data/testimonials/testimonials.json";

export default function Home() {
return (
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden">

<section className="grid bg-no-repeat bg-contain bg-opaque-50 opaque-20" style={{
backgroundImage: `url('https://cdn.collegeraptor.com/wp/wp-content/uploads/2017/07/09204242/revisit-e1579799504642.jpg')`,
height: "972px",

}} >
<Nav/>
<div className="text-8xl font-bold pb-72 pt-24">
<h1 className="mb-20 text-white drop-shadow-lg text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 brightness-100">InsightEdu</h1>
const router = useRouter()
const [route, setRoute] = useState()
const handleSubmit = (e) => {
e.preventDefault()
router.push("college/" + route)
}

<form className="text-center text-4xl text-white">
<label className="text-center text-4xl text-white" >Start your search here:</label>
<input type="text" id="fname" name="fname" className="text-black rounded-lg"></input>
<button className="ml-2 bg-black p-2 rounded-full">Search</button>
</form>
</div>
return (
<main className="overflow-y-hidden m-0 p-0 min-h-screen overflow-hidden">

<section className="grid grid-cols-1 grid-rows-3 bg-no-repeat bg-contain bg-opaque-50 opaque-20 h-3/6" style={{
backgroundImage: `url('https://cdn.collegeraptor.com/wp/wp-content/uploads/2017/07/09204242/revisit-e1579799504642.jpg')`,
height: "972px",

}} >
<Nav/>
<div className="text-8xl font-bold">
<h1 className="mb-20 text-white drop-shadow-lg text-center transition ease-in-out hover:-translate-x-4 hover:cursor-pointer duration-300 brightness-100">InsightEdu</h1>

{/* Search Bar */}
<form className="text-center text-4xl text-white" onSubmit={handleSubmit}>
<label className="text-center text-4xl text-white" >Start your search here: </label>
<input type="text" id="fname" name="collegename" className="text-black rounded-xl" onChange={(e)=>{setRoute(e.target.value)}}></input>
<button className="text-3xl ml-2 bg-nicebrown p-2 rounded-full transition duration-300 hover:scale-105 hover:bg-dnicebrown">Search</button>
</form>
</div>
</section>

{/* About */}
<section className="grid grid-cols-1 place-items-center" id="about">
{/* About */}
<div className="text-center text-4xl font-bold ">
<h1>About Us</h1>
</div>
<div className="text-center text-2xl font-bold ">
<div className="text-center font-normal text-2xl ">
<p>InsightEdu is a college research platform that helps students find the best college for them. We provide students with the tools they need to make informed decisions about their future. Our mission is to help students find the best college for them, and to help colleges find the best students for them.<br /><br />To learn more about InsightEdu and the creators who made it came to life, learn more <Link href='/about'>here</Link>.</p>
</div>
</section>

{/* About */}
<section className="grid grid-cols-1 place-items-center" id="about">
</section>

{/* Reviews */}
<section >
<div className="grid grid-cols-1 place-items-center">
<div className="text-center text-4xl font-bold py-20">
<h1>Reviews</h1>
</section>

{/* Reviews */}
<section >
<div className="grid grid-cols-1 place-items-center">
<div className="text-center text-4xl font-bold py-20">
<h1>Reviews</h1>
<Testimonial testimonialData={data} />
</div>
</div>
<Testimonial testimonialData={data} />
</div>
</section>
</main>
);
</section>
</main>
);
}
Loading

0 comments on commit dd31a44

Please sign in to comment.