This commit is contained in:
Aashishad
2024-05-17 17:20:09 +05:45
parent 3b9ffcf7e6
commit a6775671d0
15 changed files with 710 additions and 74 deletions

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,25 +1,11 @@
import logo from './logo.svg';
import './App.css';
function App() {
import React from 'react'
import Home from './components/Home'
const App = () => {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
<>
<Home/>
</>
)
}
export default App;
export default App

View File

@ -0,0 +1,43 @@
import React from 'react'
import image from '../img/img1.jpg'
import image1 from '../img/img2.jpg'
import image2 from '../img/img3.jpg'
const CardDisplay = () => {
return (
<>
<div class="container mx-auto py-2 w-full max-w-sm">
<div class="flex flex-row items-center bg-white rounded-lg shadow ">
<img class="object-cover w-24 p-2 rounded-t-lg md:rounded-none md:rounded-s-lg" src={image} alt=""/>
<div class="justify-between p-4 leading-normal">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-700">Noteworthy technology acquisitions 2021</h5>
</div>
</div>
</div>
<div class="container mx-auto py-2 w-full max-w-sm">
<div class="flex flex-row items-center bg-white rounded-lg shadow ">
<img class="object-cover w-24 p-2 rounded-t-lg md:rounded-none md:rounded-s-lg" src={image1} alt=""/>
<div class="justify-between p-4 leading-normal">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-700">Noteworthy technology acquisitions 2021</h5>
</div>
</div>
</div>
<div class="container mx-auto py-2 w-full max-w-sm">
<div class="flex flex-row items-center bg-white rounded-lg shadow ">
<img class="object-cover w-24 p-2 rounded-t-lg md:rounded-none md:rounded-s-lg" src={image2} alt=""/>
<div class="justify-between p-4 leading-normal">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-700">Noteworthy technology acquisitions 2021</h5>
</div>
</div>
</div>
</>
)
}
export default CardDisplay

15
src/components/Footer.js Normal file
View File

@ -0,0 +1,15 @@
import React from 'react'
const Footer = () => {
return (
<div className='relative '>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#000000" fill-opacity="1" d="M0,192L1440,128L1440,320L0,320Z"></path></svg>
<div className='absolute bottom-0 text-white inset-x-0 top-[50%] flex justify-center flex-col items-center'>
<h1>@copyright 2024.ALl rights Reserved</h1>
</div>
</div>
)
}
export default Footer

29
src/components/Home.js Normal file
View File

@ -0,0 +1,29 @@
import React from 'react'
import Register from './Register'
import CardDisplay from './CardDisplay'
import banner from '../img/banner.jpg'
import Footer from './Footer'
const Home = () => {
return (
<>
<div class ="w-full max-w-sm mx-auto bg-white p-1 rounded-md shadow-md mt-5 text-gray-800 text-center h-auto mb-10" >
<img class="object-cover w-auto " src={banner} alt=""/>
</div>
<h2 class="text-center p-2 ">SCROLL BELOW</h2>
<div class="flex items-center h-32">
<dotlottie-player src="https://lottie.host/356f6f42-0fc4-4311-bb3a-7ce70846dd11/7dmxEi24BX.json" background="transparent" speed="1" loop autoplay ></dotlottie-player>
</div>
<Register />
<CardDisplay />
{/* <div class ="w-full max-w-sm mx-auto bg-white p-8 rounded-md shadow-md py-8 mt-5 text-gray-800 text-center h-auto mb-10" >
<img class="object-cover w-auto " src={banner} alt=""/>
</div> */}
<Footer/>
</>
)
}
export default Home

162
src/components/Register.js Normal file
View File

@ -0,0 +1,162 @@
'use client';
import React, { useState } from 'react';
import { useForm } from 'react-hook-form';
import axios from "axios";
const qualification = [
{ text: 'Under Graduate', value: 'UG' },
{ text: 'Graduate', value: 'GE' },
{ text: 'Post Graduate', value: 'PG' },
];
const test = [
{ text: 'IELTS', value: 'ielts' },
{ text: 'PTE', value: 'pte' },
{ text: 'TOEFL', value: 'toefl' },
{ text: 'Duolingo', value: 'duo' },
];
const Register = () => {
const { register, handleSubmit, formState: {errors} } = useForm();
const onSubmit = values => console.log(values);
// const [reg, setReg] = useState('')
// onSubmit = async (e) => {
// e.preventDefault()
// try {
// await axios.post("http://localhost:8000/", {
// reg
// })
// } catch (e) {
// console.log(e);
// }
// }
return (
<>
<div class="container mx-auto pt-8">
<form onSubmit={handleSubmit(onSubmit)}
action='POST'
class="w-full max-w-sm mx-auto bg-white p-8 rounded-md shadow-md">
<div class="mb-4">
<h1 class="text-2xl font-bold mb-6 text-center">Register Now</h1>
<label class="block text-gray-700 text-sm font-bold mb-2" for="name">Name</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="text" id="name" name="name"
placeholder="Input Name"
{...register("name", {
required: true,
})}
/>
{errors.name && (
<span class="text-red-600">This field is required</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="email">Email</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="email" id="email"
name="email" placeholder="Name@example.com"
{...register("email", {
required:true,
})}
/>
{errors.email && (
<span class="text-red-600">Please input Your email address</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="Phone">Phone Number</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="number" id="number"
name="number" placeholder="Input Number"
{...register("phone", {
required:true,
})}
/>
{errors.phone && (
<span class="text-red-600">This field is required</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="Qualification">Highest Qualification</label>
<select id="Qualification" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" placeholder="Highest Qualification" {...register("qualification",{
required:true,
})}
>
<option value="">Choose Your Qualification</option>
{qualification.map((option, i) => {
return <option key={i}
value={option.value}>{option.text}</option>
})}
</select>
{errors.qualification && (
<span class="text-red-600">This field is required.</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="year">Passed Year</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="number" id="number" name="number" placeholder="Passed Year"
{...register("year", {
required:true,
})} />
{errors.year && (
<span class="text-red-600">This field is required</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="grade">Grade</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="text" id="grade" name="grade" placeholder="Input Grade"
{...register("grade", {
required:true,
})} />
{errors.grade && (
<span class="text-red-600">This field is required</span>
)}
</div>
<div class="flex col-span-2 space-x-3">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="Test">Test</label>
<select id="test" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
{...register("test", {
required:true,
})}>
<option value="">Test</option>
{test.map((t, i) => {
return <option key={i}
value={t.value}>{t.text}</option>
})}
</select>
{errors.test && (
<span class="text-red-600">This field is required</span>
)}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="scorer">Score</label>
<input class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500"
type="text" id="score"
name="score" placeholder="Input Score"
{...register("score", {
required:true,
})} />
{errors.score && (
<span class="text-red-600">This field is required</span>
)}
</div>
</div>
<button
class="w-full bg-indigo-500 text-white text-sm font-bold py-2 px-4 rounded-md hover:bg-indigo-600 transition duration-300"
type="submit" value="Submit">Register</button>
</form>
</div>
</>
)
}
export default Register

BIN
src/img/banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

BIN
src/img/img1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
src/img/img2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

BIN
src/img/img3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -1,13 +1,10 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:opsz,wght@6..12,400;6..12,500;6..12,600;6..12,700;6..12,800&display=swap');
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
body{
font-family: 'Nunito Sans', sans-serif;
}