Merge pull request #30 from 0hAodha/loginSignup

Add login and signup pages with routing
This commit is contained in:
Conor McNamara
2023-03-06 19:49:41 +00:00
committed by GitHub
5 changed files with 247 additions and 3 deletions

View File

@ -1,12 +1,14 @@
<template> <template>
<nav class="navbar navbar-light bg-light"> <nav class="navbar navbar-light bg-light">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="#"> <router-link to ="/" class="navbar-brand">
<img src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png" alt="mascot" width="55" height="40" class="d-inline-block align-text-middle"> <img src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png" alt="mascot" width="55" height="40" class="d-inline-block align-text-middle">
<b>Irish Rail Tracker</b> <b>Irish Rail Tracker</b>
</a> </router-link>
<a class = "navbarLink"><router-link to="/">Home</router-link></a> <a class = "navbarLink"><router-link to="/">Home</router-link></a>
<a class = "navbarLink"><router-link to="/insights">Insights</router-link></a> <a class = "navbarLink"><router-link to="/insights">Insights</router-link></a>
<a class = "navbarLink"><router-link to="/login">Login</router-link></a>
</div> </div>
</nav> </nav>
</template> </template>

View File

@ -322,6 +322,8 @@ export default {
#hoverButton{ #hoverButton{
z-index: 3; z-index: 3;
position: absolute; position: absolute;
bottom:0px;
width:100%;
} }

119
src/pages/loginpage.vue Normal file
View File

@ -0,0 +1,119 @@
<template>
<div id = "background">
<div class = "loginbox">
<img src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png" class="avatar">
<h1>Login Here</h1>
<form>
<p>Username</p>
<input type="text" name="" placeholder="Enter Username">
<p>Password</p>
<input type="password" name="" placeholder="Password">
<input type="submit" name="" value="Login" @click.stop.prevent="submit()">
<a href="#">Lost your password?</a><br>
<a><router-link to="/signup">Don't have an account?</router-link></a>
</form>
</div>
</div>
</template>
<script>
export default {
name: "loginpage",
methods: {
submit(){
//if you want to send any data into server before redirection then you can do it here
this.$router.push("/");
}
}
}
</script>
<style scoped>
#background{
margin: 0;
padding: 0;
width:100%;
height: 100%;
position: absolute;
background-color: #e0e0e0;
font-family: sans-serif;
}
.loginbox{
height: 420px;
width: 320px;
background: #000;
color: #fff;
top: 50%;
left:50%;
position: absolute;
transform: translate(-50%,-50%);
box-sizing: border-box;
padding: 70px 30px;
}
h1{
margin: 0;
padding: 0 0 20px;
font-size: 22px;
text-align:center;
}
.loginbox p{
margin: 0;
padding:0;
font-weight: bold;
}
.loginbox input{
width:100%;
margin-bottom: 20px;
}
.loginbox input[type="text"], input[type="password"]{
border: none;
border-bottom: 1px solid #fff;
background: transparent;
outline: none;
height: 40px;
color: #fff;
font-size: 16px;
}
.loginbox input[type="submit"]:hover{
cursor: pointer;
background: #66a3ff;
color: #000;
}
.loginbox a{
text-decoration: none;
font-size: 12px;
line-height: 20px;
color: darkgray;
}
.loginbox a:hover{
color: #ffc107;
}
.loginbox input[type="submit"]
{
border: none;
outline: none;
height:40px;
background: #0052cc;
font-size: 18px;
border-radius:20px;
}
.avatar{
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
top:-50px;
left: calc(50% - 50px);
}
</style>

119
src/pages/signup.vue Normal file
View File

@ -0,0 +1,119 @@
<template>
<div id = "background">
<div class = "loginbox">
<img src="https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png" class="avatar">
<h1>Sign Up Here</h1>
<form>
<p>Username</p>
<input type="text" name="" placeholder="Enter Username">
<p>Password</p>
<input type="password" name="" placeholder="Password">
<input type="submit" name="" value="Sign Up" @click.stop.prevent="submit()">
<a href="#">Lost your password?</a><br>
<a><router-link to="/login">Already have an account?</router-link></a>
</form>
</div>
</div>
</template>
<script>
export default {
name: "signuppage",
methods: {
submit(){
//if you want to send any data into server before redirection then you can do it here
this.$router.push("/");
}
}
}
</script>
<style scoped>
#background{
margin: 0;
padding: 0;
width:100%;
height: 100%;
position: absolute;
background-color: #e0e0e0;
font-family: sans-serif;
}
.loginbox{
height: 420px;
width: 320px;
background: #000;
color: #fff;
top: 50%;
left:50%;
position: absolute;
transform: translate(-50%,-50%);
box-sizing: border-box;
padding: 70px 30px;
}
h1{
margin: 0;
padding: 0 0 20px;
font-size: 22px;
text-align:center;
}
.loginbox p{
margin: 0;
padding:0;
font-weight: bold;
}
.loginbox input{
width:100%;
margin-bottom: 20px;
}
.loginbox input[type="text"], input[type="password"]{
border: none;
border-bottom: 1px solid #fff;
background: transparent;
outline: none;
height: 40px;
color: #fff;
font-size: 16px;
}
.loginbox input[type="submit"]:hover{
cursor: pointer;
background: #00df00;
color: #000;
}
.loginbox a{
text-decoration: none;
font-size: 12px;
line-height: 20px;
color: darkgray;
}
.loginbox a:hover{
color: #ffc107;
}
.loginbox input[type="submit"]
{
border: none;
outline: none;
height:40px;
background: #00a800;;
font-size: 18px;
border-radius:20px;
}
.avatar{
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
top:-50px;
left: calc(50% - 50px);
}
</style>

View File

@ -3,5 +3,7 @@ function loadPage(component) {
} }
export default [ export default [
{path: "/", component:loadPage("MapPage")}, {path: "/", component:loadPage("MapPage")},
{path: "/insights", component:loadPage("InsightsPage")} {path: "/insights", component:loadPage("InsightsPage")},
{path: "/signup", component:loadPage("signup")},
{path: "/login", component:loadPage("loginpage")}
] ]