Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login auth #8

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 52 additions & 37 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
*{
margin: 0;
}
.loginpage{
display: flex;
height: 100vh;
width: 100vw;
background-repeat: no-repeat;
background-size: cover;
background-image: url('https://ucarecdn.com/5015c61e-0b04-4b81-9661-3c0d7c3d82e8/');

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
.form-login{
position: absolute;
top: 50%;
left: 20%;
transform: translate(-50%, -50%);
}
.login-item input{
height: 40px;
width: 300px;
border: 1px solid darkgoldenrod;
padding: 4px;
}
.login-heading{
position: absolute;
font-size: 90px;
top: 100px;
left: 50px;
}
.iitj-login{
position: relative;
left: 20px;
font-size: 70px;
}
.signup-login{
position: absolute;
left: 105px;
height: 40px;
width: 300px;
border-radius: 4px;
background-color: white;
border: 1px solid darkgoldenrod;
top: 330px;
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
.signup-login:hover{
background-color: #c4fccf;
cursor: pointer;
}
.goole-login{
position: relative;
top: 4px;
right: 4px;
height: 20px;
}
29 changes: 9 additions & 20 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,24 @@ import reactLogo from './assets/react.svg'
import './App.css'
import axios from 'axios'
import { useEffect } from 'react'

import Login from './pages/Login'
function App() {
const [count, setCount] = useState("")

let info;
let url = 'http://127.0.0.1:8000/user/api/'
// info = fetch(url)
// let info;
// let url = 'http://127.0.0.1:8000/user/api/'

// fetch(url, {
// method : "GET",
// mode: 'cors',
// headers: {}
// })
// .then(response => console.log(response))
// .then(data => console.log(data));
// useEffect(()=>axios.get(url).then((response) =>{
// setCount(((response.data)))
// }))

useEffect(()=>{
axios.get(url).then((r)=>{
setCount(r.data)
})
},[])
// useEffect(()=>{
// axios.get(url).then((r)=>{
// setCount(r.data)
// })
// },[])


return (
<div className="App">
{count.resp}
<Login/>
</div>
)
}
Expand Down
Binary file added frontend/src/assets/images/googlesignin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:root {
/* :root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
Expand Down Expand Up @@ -67,4 +67,4 @@ button:focus-visible {
button {
background-color: #f9f9f9;
}
}
} */
20 changes: 20 additions & 0 deletions frontend/src/pages/Login.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import google from '../assets/images/googlesignin.png'
export default function Login() {
return (
<div className='loginpage'>
<div className='login-heading'>
<div>Welcome to mulgo,</div>
<div className='iitj-login'>IITJ</div>
<button className='signup-login'><img src={google} alt="" className='goole-login'/> Sign Up With Google</button>
</div>

<div className='form-login'>
<form action="">
<div className='email-login login-item'><input type="email" name="" id="" placeholder='Enter Your email'/></div>
<div className='email-password login-item'><input type="password" name="" id="" placeholder='password'/></div>
</form>
</div>
</div>
)
}