Skip to content

Commit

Permalink
Update frontend styles and routes, add Pinia dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciobellon committed Apr 15, 2024
1 parent b068108 commit 77bf623
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 97 deletions.
90 changes: 10 additions & 80 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,85 +1,15 @@
<script setup>
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />

<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
<header class="container md:mx-auto flex items-center bg-gray-500">
<img alt="Logo" class="flex-none" src="@/assets/logo.svg" width="60" height="60" />
<nav class="grow gap-x-6 flex justify-end">
<RouterLink class="" to="/">Inicio</RouterLink>
<RouterLink class="" to="/login">Login</RouterLink>
</nav>
</header>

<RouterView />
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
<main class="container md:mx-auto">
<RouterView />
</main>
</template>
11 changes: 8 additions & 3 deletions frontend/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
@import './base.css';
/* @import './base.css'; */
@tailwind base;
@tailwind components;
@tailwind utilities;

html {
@apply bg-gray-500;
}

/*
#app {
max-width: 1280px;
max-width: 900px;
margin: 0 auto;
padding: 2rem;
font-weight: normal;
Expand Down Expand Up @@ -35,4 +40,4 @@ a,
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}
} */
3 changes: 0 additions & 3 deletions frontend/src/inde.css

This file was deleted.

14 changes: 4 additions & 10 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ const router = createRouter({
routes: [
{
path: '/',
name: 'home',
component: () => import('../views/HomeView.vue')
},
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import('../views/AboutView.vue')
name: 'Inicio',
component: () => import('../views/InicioView.vue')
},
{
path: '/login',
Expand All @@ -28,4 +20,6 @@ const router = createRouter({
]
})



export default router
9 changes: 9 additions & 0 deletions frontend/src/views/InicioView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup>
</script>

<template>
<h1>Inicio</h1>
</template>

<style scoped>
</style>
21 changes: 21 additions & 0 deletions frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@
</script>

<template>

<div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-lg justify-center space-x-4">
<div class="content-center">
<img class="h-12 w-12" src="@/assets/logo.svg" alt="ChitChat Logo">
<div class="text-xl font-medium text-black">ChitChat</div>
<p class="text-slate-500">You have a new message!</p>
<br>

<form>
<label class="block">
<span class="after:content-['*'] after:ml-0.5 after:text-red-500 block text-sm font-medium text-slate-700">
Email
</span>
<input type="email" name="email" class="mt-1 px-3 py-2 bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md sm:text-sm focus:ring-1" placeholder="[email protected]" />
</label>
</form>

</div>
</div>


</template>
2 changes: 1 addition & 1 deletion frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{html,js}"],
content: ["./src/**/*.{html,js,vue}"],
theme: {
extend: {},
},
Expand Down

0 comments on commit 77bf623

Please sign in to comment.