-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16e06be
commit dc0878a
Showing
25 changed files
with
730 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "vueauthfire" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"hosting": { | ||
"public": "dist", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* ./src/index.css */ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
body { | ||
background-color: #22272e; | ||
color: white; | ||
font-family: Ubuntu, sans-serif; | ||
} | ||
|
||
.main-set { | ||
@apply lg:container lg:mx-auto md:px-20 2xl:px-40; | ||
} | ||
|
||
@layer base { | ||
h1 { | ||
@apply text-xl font-heading font-bold md:text-3xl; | ||
} | ||
h2 { | ||
@apply font-heading text-xl md:text-2xl; | ||
} | ||
h3 { | ||
@apply font-text text-base md:text-lg; | ||
} | ||
h4 { | ||
@apply font-heading text-xs md:text-lg; | ||
} | ||
h5 { | ||
@apply font-text text-xs md:text-base; | ||
} | ||
} | ||
|
||
hr { | ||
@apply border-primary mt-1 my-4; | ||
} | ||
|
||
/* AUTH */ | ||
.section { | ||
@apply my-4 md:my-20 w-11/12 md:w-2/3 lg:w-3/5 mx-auto; | ||
} | ||
.auth-form { | ||
@apply bg-secondary shadow-md rounded p-6; | ||
} | ||
/* AUTH */ | ||
|
||
/* Pages */ | ||
.page-pos { | ||
@apply my-4 md:my-20; | ||
} | ||
/* Pages */ | ||
|
||
.router-link-active { | ||
@apply bg-primary; | ||
} | ||
|
||
.t-input { | ||
@apply shadow | ||
appearance-none | ||
border | ||
rounded | ||
w-full | ||
p-3 | ||
text-black | ||
leading-tight | ||
focus:outline-none; | ||
} | ||
|
||
.t-btn { | ||
@apply font-bold py-2 px-4 rounded focus:outline-none ease-linear | ||
transition-all | ||
duration-150; | ||
} | ||
|
||
.transition-effect { | ||
@apply transition duration-500 ease-in-out; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<template> | ||
<!-- Profile dropdown --> | ||
<div class="ml-3 relative"> | ||
<div> | ||
<button | ||
type="button" | ||
class="text-lg h-8 w-8 rounded-full hover:bg-primary" | ||
aria-expanded="false" | ||
aria-haspopup="true" | ||
@click="toggle" | ||
> | ||
<font-awesome-icon :icon="['fas', 'bars']" class="" /> | ||
</button> | ||
</div> | ||
<transition name="fade"> | ||
<div | ||
v-if="show" | ||
class=" | ||
origin-top-right | ||
absolute | ||
right-0 | ||
mt-2 | ||
w-32 | ||
rounded-md | ||
shadow-lg | ||
py-1 | ||
bg-gray-800 | ||
text-white | ||
font-heading | ||
" | ||
role="menu" | ||
aria-orientation="vertical" | ||
aria-labelledby="user-menu-button" | ||
tabindex="-1" | ||
> | ||
<router-link | ||
v-for="(item, n) in user ? menuAuth : menuNoAuth" | ||
:key="n" | ||
:to="item.link" | ||
class="block px-4 py-2 text-sm" | ||
@click="toggle" | ||
> | ||
{{ item.name }} | ||
</router-link> | ||
<p | ||
v-if="user" | ||
class="px-4 py-2 text-sm cursor-pointer text-red-500" | ||
@click="signOutUser" | ||
> | ||
Logout | ||
</p> | ||
</div> | ||
</transition> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { useAuthState, useSignOut } from "@/firebase"; | ||
import { defineComponent, ref } from "vue"; | ||
import { useRouter } from "vue-router"; | ||
export default defineComponent({ | ||
name: "Menu", | ||
setup() { | ||
const { user } = useAuthState(); | ||
const menuAuth = [ | ||
{ name: "Home", link: { name: "Home" } }, | ||
{ name: "Profile", link: { name: "Profile" } }, | ||
{ name: "Database", link: { name: "Database" } }, | ||
]; | ||
const menuNoAuth = [ | ||
{ name: "Home", link: { name: "Home" } }, | ||
{ name: "Login", link: { name: "Login" } }, | ||
{ name: "Signup", link: { name: "SignUp" } }, | ||
]; | ||
const show = ref(false); | ||
const toggle = () => { | ||
show.value = !show.value; | ||
}; | ||
const router = useRouter(); | ||
const signOutUser = async () => { | ||
toggle(); | ||
await useSignOut(); | ||
await router.replace({ name: "Login" }); | ||
}; | ||
return { show, toggle, user, signOutUser, menuAuth, menuNoAuth }; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.menu-button { | ||
@apply py-2 px-4 ml-2 font-heading rounded bg-primary | ||
hover:bg-opacity-75; | ||
} | ||
.fade-enter-active, | ||
.fade-leave-active { | ||
transition: opacity 0.5s; | ||
} | ||
.fade-enter, | ||
.fade-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
Oops, something went wrong.