Skip to content

Commit

Permalink
Merge pull request #45 from enflujo/estilo-celular
Browse files Browse the repository at this point in the history
☎️  Estilo celular
  • Loading branch information
1cgonza authored Nov 13, 2024
2 parents 4e1ff6c + ce33ded commit 78b1706
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 18 deletions.
72 changes: 64 additions & 8 deletions aplicaciones/www/src/Aplicacion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,44 @@ import { RouterLink, RouterView } from 'vue-router';
import Ficha from './componentes/Ficha.vue';
import { usarCerebroGeneral } from './cerebros/general';
import { storeToRefs } from 'pinia';
import { onMounted, Ref, ref } from 'vue';
const cerebroGeneral = usarCerebroGeneral();
const { paginaActual } = storeToRefs(cerebroGeneral);
const menu: Ref<HTMLElement | null> = ref(null);
function abrirCerrarMenu() {
if (!menu.value?.classList.contains('abierto')) {
menu.value?.classList.add('abierto');
} else {
menu.value?.classList.remove('abierto');
}
}
function clicFuera(evento: MouseEvent) {
if (!menu.value) return;
const elemento = evento.target as HTMLElement;
if (!(menu.value === elemento || menu.value.contains(elemento))) {
menu.value?.classList.remove('abierto');
}
}
onMounted(() => {
document.body.addEventListener('click', clicFuera);
});
</script>

<template>
<header>
<nav id="menu">
<RouterLink class="icono" to="/"><img src="/icono_cuenco.webp" /></RouterLink>
<nav id="menu" ref="menu">
<div :onclick="abrirCerrarMenu" class="icono"><img src="/icono_cuenco.webp" /></div>
<RouterLink class="elementoMenu" to="/">Inicio</RouterLink>
<RouterLink class="elementoMenu" :class="paginaActual === 'colectivos' ? 'activo' : ''" to="/colectivos/mapa">
Colectivos y Ámbitos
</RouterLink>
<RouterLink class="elementoMenu" to="/publicaciones">Producción Académica</RouterLink>
<RouterLink class="elementoMenu" to="/encuentros">Encuentros</RouterLink>
<RouterLink class="elementoMenu" to="/creditos">Créditos</RouterLink>
</nav>
</header>

Expand All @@ -31,22 +55,28 @@ const { paginaActual } = storeToRefs(cerebroGeneral);
#menu {
width: 100vw;
height: $altoMenu;
height: $altoMenuCelular;
display: flex;
justify-content: space-evenly;
padding: 1em 20em;
padding: 1em 1em;
z-index: 9;
line-height: 1.5;
line-height: 1.2;
position: fixed;
top: 0;
z-index: 9;
background-color: rgba(255, 255, 255, 0.8);
background-color: rgba(255, 255, 255, 0.9);
flex-direction: column;
overflow: hidden;
&.abierto {
height: 100vh;
width: 40vw;
}
.elementoMenu {
padding: 0.5em 0.7em;
color: var(--magentaCuenco);
display: inline-block;
padding: 0 1rem;
padding: 0.5rem 1rem;
&.router-link-exact-active,
&.activo {
Expand All @@ -59,4 +89,30 @@ const { paginaActual } = storeToRefs(cerebroGeneral);
}
}
}
@media screen and (min-width: $minTablet) {
#menu {
max-width: 30vw;
}
}
@media screen and (min-width: $minPantalla) {
#menu {
width: 100vw;
max-width: 100vw;
height: $altoMenuPantalla;
justify-content: space-evenly;
align-items: flex-start;
padding: 1em 1em;
flex-direction: row;
line-height: 1.5;
justify-content: space-around;
align-items: center;
&.abierto {
height: $altoMenuPantalla;
width: 100vw;
}
}
}
</style>
5 changes: 5 additions & 0 deletions aplicaciones/www/src/aplicacion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const rutas = createRouter({
name: 'encuentros',
component: () => import('@/paginas/Encuentros.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'creditos',
component: import('@/paginas/Creditos.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'perdido',
Expand Down
4 changes: 2 additions & 2 deletions aplicaciones/www/src/componentes/Ficha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ $margenY: 10px;
#contenedorFicha {
z-index: 99;
width: 80vw;
height: calc(100vh - $altoMenu - $altoLinea);
height: calc(100vh - $altoMenuPantalla - $altoLinea);
@include gradienteAzulCircular;
position: fixed;
left: 50%;
transform: translateX(-50%);
top: $altoMenu;
top: $altoMenuPantalla;
border-radius: 20px;
padding: 1em;
overflow: hidden;
Expand Down
19 changes: 18 additions & 1 deletion aplicaciones/www/src/componentes/Mapa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function crearTextoSede(datos: PropiedadesGeoColectivos) {

<style lang="scss">
@use '@/scss/constantes' as *;
#infoMapa {
@include gradienteAzulCircular;
color: var(--blanco);
Expand Down Expand Up @@ -189,8 +190,24 @@ function crearTextoSede(datos: PropiedadesGeoColectivos) {
</style>

<style lang="scss" scoped>
@use '@/scss/constantes' as *;
#contenedorMapa {
width: 55vw;
width: 80vw;
height: 60vh;
margin: 1em auto;
}
@media screen and (min-width: $minTablet) {
#contenedorMapa {
width: 45vw;
margin: 7em 0;
}
}
@media screen and (min-width: $minPantalla) {
#contenedorMapa {
width: 55vw;
margin: 7em 0;
}
}
</style>
2 changes: 1 addition & 1 deletion aplicaciones/www/src/paginas/404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
.pagina-404 {
text-align: center;
margin-top: $altoMenu;
margin-top: $altoMenuPantalla;
width: 100vw;
display: block;
min-height: 100vh;
Expand Down
17 changes: 17 additions & 0 deletions aplicaciones/www/src/paginas/Creditos.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup lang="ts"></script>

<template>
<main>
<div id="contenedorCreditos">
<h1>Créditos</h1>
</div>
</main>
</template>

<style lang="scss" scoped>
#contenedorCreditos {
width: 70vw;
margin-left: 10vw;
margin-top: 5vw;
}
</style>
23 changes: 21 additions & 2 deletions aplicaciones/www/src/paginas/Inicio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,29 @@ onMounted(async () => {
</template>

<style lang="scss" scoped>
@use '@/scss/constantes' as *;
#presentacion {
overflow: auto;
margin-left: 4em;
margin: 0 10vw;
padding-right: 1em;
width: 25vw;
width: 80vw;
}
@media screen and (min-width: $minTablet) {
#presentacion {
margin: 0 2em;
padding-right: 1em;
width: 40vw;
}
}
@media screen and (min-width: $minPantalla) {
#presentacion {
overflow: auto;
margin-left: 4em;
padding-right: 1em;
width: 30vw;
}
}
</style>
2 changes: 1 addition & 1 deletion aplicaciones/www/src/paginas/Publicaciones.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ onUnmounted(() => {
@use '@/scss/constantes' as *;
.columna {
height: calc(100vh - $altoMenu - $altoLinea);
height: calc(100vh - $altoMenuPantalla - $altoLinea);
}
.botonesVista {
Expand Down
3 changes: 2 additions & 1 deletion aplicaciones/www/src/scss/_constantes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
--enlacesFondoOscuro: #f7e9b7;
}

$altoMenu: 60px;
$altoMenuPantalla: 60px;
$altoMenuCelular: 35px;
$altoLinea: 80px;

// Tamaños Pantallas 🖥️ 📺 📱
Expand Down
12 changes: 10 additions & 2 deletions aplicaciones/www/src/scss/estilos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ a:link {
}

main {
margin-top: $altoMenu;
margin-top: $altoMenuCelular;
display: flex;
flex-direction: column;
}

ul {
Expand All @@ -77,7 +78,7 @@ ul {
}

.columna {
height: calc(100vh - $altoMenu);
height: calc(100vh - $altoMenuPantalla);
overflow: auto;
}

Expand Down Expand Up @@ -122,3 +123,10 @@ ul {
}
}
}

@media screen and (min-width: $minTablet) {
main {
margin-top: $altoMenuPantalla;
flex-direction: row;
}
}

0 comments on commit 78b1706

Please sign in to comment.