Skip to content

Commit

Permalink
Landing Page Component
Browse files Browse the repository at this point in the history
  • Loading branch information
sheninthjr committed Nov 5, 2023
1 parent 9b21cb9 commit feed720
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 30 deletions.
14 changes: 13 additions & 1 deletion apps/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<style>
:root {
--background-gradient: linear-gradient(315deg, #2b4162 0%, #12100e 74%);
}

body {
background: var(--background-gradient), #2b4162;
background-size: 100%;
background-attachment: fixed;
background-color: #2b4162;
}
</style>
</head>
<body class="h-screen bg-gray-700">
<body class="h-screen">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions apps/client/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:root {
--background-gradient: linear-gradient(315deg, #2b4162 0%, #12100e 74%);
}
2 changes: 2 additions & 0 deletions apps/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { BrowserRouter as Router, Routes, Route } from "react-router-dom";import
import PostingQuestion from "./components/Posting";
import Landing from "./components/Landing";
import GetQuestion from "./components/GetQuestion";
import NavBar from "./components/NavBar";

function App() {
return (
<>
<Router>
<NavBar/>
<Routes>
<Route path="/" element={<Landing/>}></Route>
<Route path="/post" element={<PostingQuestion />}></Route>
Expand Down
Binary file added apps/client/src/assets/GitHub_logo.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 apps/client/src/assets/github-mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions apps/client/src/components/GetQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export default function GetQuestion() {
};

return (
<div className="flex flex-col justify-center items-center p-40 bg-gray-700">
<div className="flex flex-col justify-between space-y-5 p-4 border-4 h-[30vh] bg-blue-300 border-blue-300">
<div className="flex flex-col justify-center items-center p-40">
<div className="flex flex-col justify-between rounded-lg space-y-5 p-4 border-4 h-[30vh] bg-white border-white w-80 sm:w-50 md:h-[50vh] w-100 lg:h-[50vh]">
<input
className="rounded-lg w-1/25 h-15 p-4"
className="rounded-lg w-1/25 h-15 p-4 border-2 border-gray-700"
type="text"
value={pdfName}
placeholder="Pdf Name"
Expand All @@ -42,7 +42,7 @@ export default function GetQuestion() {
<div className="flex justify-between">
{showPdf && (
<a
className="text-white"
className="text-blue-600"
href={pdfUrl}
target="_blank"
rel="noopener noreferrer"
Expand All @@ -52,7 +52,7 @@ export default function GetQuestion() {
</a>
)}
<a
className="text-white"
className="text-red-700"
href={pdfUrl}
download={`${pdfName}.pdf`}
onClick={refreshData}
Expand Down
66 changes: 66 additions & 0 deletions apps/client/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import GithHub_logo from "../assets/GitHub_logo.png";
import GitHub_mark from "../assets/github-mark.png";
import { Link } from "react-router-dom";

export default function NavBar() {
return (
<>
<nav className="bg-gray-900 p-4 z-10 fixed top-0 w-full">
<div className="flex justify-between items-center">
<Link
to="/"
className="flex-start text-lg font-bold text-white sm:hidden italic"
>
Jr
</Link>
<a
href="/"
className="text-lg font-bold text-white hidden sm:inline italic"
>
Jr Generator
</a>
<ul className="flex space-x-4">
<li>
<a href="#" className="text-white hover:text-blue-500">
Home
</a>
</li>
<li>
<a href="#" className="text-white hover:text-blue-500">
About
</a>
</li>
<li>
<a href="#" className="text-white hover:text-blue-500">
Services
</a>
</li>
<li>
<a href="#" className="text-white hover:text-blue-500">
Contact
</a>
</li>
<li>
<div className="flex items-center space-x-2">
<Link
to="https://github.com/sheninthjr/Automatic-Question-Generator"
target="_blank"
rel="noopener noreferrer"
>
<img src={GitHub_mark} alt="GitHub" width="25" height="30" />
</Link>
<Link
to="https://github.com/sheninthjr/Automatic-Question-Generator"
target="_blank"
rel="noopener noreferrer"
>
<img src={GithHub_logo} alt="GitHub" width="50" height="30" />
</Link>
</div>
</li>
</ul>
</div>
</nav>
</>
);
}
9 changes: 8 additions & 1 deletion apps/client/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ export default {
'./src/**/*.{html,ts}',
],
theme: {
extend: {},
extend: {
colors:{
"box":"#2b4162"
},
spacing: {
'35': '5.6rem',
},
},
},
plugins: [],
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"start:express": "cd packages/prisma && sudo docker-compose up -d && node dist/index.js",
"start:express": "cd packages/prisma && yarn prisma migrate dev && yarn yarn prisma generate && sudo docker-compose up -d && node dist/index.js",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/prisma/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ app.get("/get/:testtype", async (req, res) => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
if (testType === "IA1") {
const skipNo = 3;
const skipNo = 4;
const partA11Questions = await prisma.unit1.findMany({
skip: Math.floor(Math.random() * skipNo),
select: {
Expand Down
53 changes: 48 additions & 5 deletions packages/ui/src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@
import { Link } from "react-router-dom";

export function LandingPage() {
return (
<div className="mt-40 text-white relative z-10 flex">
<div className="w-2/3 p-4">
<div className="flex flex-col space-y-4">
<div className="text-5xl italic">
<h1>Automatic Question Paper Generator</h1>
</div>
<div className="text-xl italic space-y-4">
<p>Upload the Question</p>
<p>Whenever needed, it will be automatically generated</p>
</div>
</div>
</div>

export function LandingPage(){
return(<>
hi
</>)
}
<div className="w-1/3 bg-gray-700 p-4 rounded-xl mr-10">
<h2 className="text-2xl text-white font-bold mb-4 italic">Info</h2>
<form className="flex flex-col space-y-5">
<div className="flex flex-col space-y-4">
<p>Do you want to post Question?</p>
<Link to="/post">
<button className="bg-white border2 border rounded-lg w-20 h-10 text-black">
POST
</button>
</Link>
</div>
<div className="flex flex-col space-y-4">
<p>Do you want to Get Question Paper?</p>
<Link to="/get">
<button className="bg-white border2 border rounded-lg w-20 h-10 text-black">
GET
</button>
</Link>
</div>
<div className="flex flex-col space-y-4">
<p>Do you have any Queries?</p>
<Link to="/query">
<button className="bg-white border2 border rounded-lg w-20 h-10 text-black">
Query
</button>
</Link>
</div>
<div></div>
</form>
</div>
</div>
);
}
30 changes: 15 additions & 15 deletions packages/ui/src/components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export function Post(props: {
const [partc2co, setPartc2co] = useState("CO1");

return (
<div className="space-y-4 p-5">
<div className="space-y-4 pt-35 m-10">
<div className="flex justify-between items-center space-x-2">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART A 1"
value={parta1}
onChange={(e) => setParta1(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -89,13 +89,13 @@ export function Post(props: {

<div className="flex justify-between">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART A 2"
value={parta2}
onChange={(e) => setParta2(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -132,13 +132,13 @@ export function Post(props: {
</div>
<div className="flex justify-between">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART B 1"
value={partb1}
onChange={(e) => setPartb1(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -175,13 +175,13 @@ export function Post(props: {
</div>
<div className="flex justify-between">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART B 2"
value={partb2}
onChange={(e) => setPartb2(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -218,13 +218,13 @@ export function Post(props: {
</div>
<div className="flex justify-between">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART C 1"
value={partc1}
onChange={(e) => setPartc1(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -261,13 +261,13 @@ export function Post(props: {
</div>
<div className="flex justify-between">
<input
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className="w-3/4 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
type="text"
placeholder="PART C 2"
value={partc2}
onChange={(e) => setPartc2(e.target.value)}
/>
<div className="flex justify-around space-x-2">
<div className="flex justify-around space-x-2 items-center">
<div className="flex justify-between space-x-2">
<label className="text-lg text-white">Type:</label>
<select
Expand Down Expand Up @@ -302,10 +302,10 @@ export function Post(props: {
</div>
</div>
</div>
<div className="flex justify-center">
<div className="flex justify-end ">
<button
type="submit"
className=" flex justify-end items-center align w-15 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-red-200 hover:border-blue-500 focus:outline-none focus:shadow-outline"
className=" flex justify-end items-center align w-15 h-10 text-lg bg-gray-50 rounded-lg p-6 border-2 border-box hover:border-blue-500 focus:outline-none focus:shadow-outline"
onClick={async () => {
props.onClick(
parta1,
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default {
'./src/**/*.{html,ts}',
],
theme: {
extend: {},
extend: {spacing: {
'35': '5.6rem',
},},
},
plugins: [],
}
Expand Down

0 comments on commit feed720

Please sign in to comment.