Agregada responsividad basica.

add-license-1
Araozu 2020-02-08 09:28:28 -05:00
parent 927435f123
commit ae492f6476
6 changed files with 104 additions and 24 deletions

View File

@ -1,8 +1,19 @@
<template lang="pug"> <template lang="pug">
div.contenedor div.contenedor
template(v-if="ancho > 500")
barra-lateral barra-lateral
div.der(:style="'max-height: ' + alto + 'px;'") div.der(:style="'max-height: ' + alto + 'px;'")
router-view router-view
template(v-else)
br
div
h1 Horarios UNSA
p Parece que estás usando un celular.
p Rota tu celular para poder usar el sistema de horarios.
p.
Recomendamos un computador o laptop para obtener
el funcionamiento completo.
// //
</template> </template>
@ -13,8 +24,9 @@
export default export default
name: "App" name: "App"
components: { barraLateral } components: { barraLateral }
data: -> computed:
alto: window.innerHeight alto: -> @$store.state.altoPantalla
ancho: -> @$store.state.anchoPantalla
# #
</script> </script>
@ -33,5 +45,15 @@
overflow-x: hidden overflow-x: hidden
@media only screen and (max-width: 1370px)
.contenedor
grid-template-columns: 200px auto
@media only screen and (max-width: 1000px)
.contenedor
grid-template-columns: 1.75rem auto
// //
</style> </style>

View File

@ -1,5 +1,8 @@
<template lang="pug"> <template lang="pug">
div.lateral(:style="'min-height: ' + alto + 'px;'") div.lateral(:style="'height: ' + alto + 'px;'")
div.mostrar-bajo-1000.boton-lateral(:style="'height: ' + alto + 'px;'")
div »
div.barra
h1 Horarios UNSA h1 Horarios UNSA
br br
br br
@ -22,19 +25,39 @@
export default export default
name: "barra-lateral" name: "barra-lateral"
components: { modoColor } components: { modoColor }
data: -> computed:
alto: window.innerHeight alto: -> @$store.state.altoPantalla
# #
</script> </script>
<style scoped lang="sass"> <style scoped lang="sass">
.boton-lateral
position: absolute
left: 0
top: 0
display: table
font-size: 2.5rem
width: 1.75rem
div
display: table-cell
vertical-align: middle
.barra
position: absolute
right: 2rem
.lateral .lateral
display: block display: block
position: relative position: relative
top: 0 top: 0
box-shadow: 2px 0 10px 0 lightgray box-shadow: 2px 0 10px 0 lightgray
overflow-y: scroll
h1 h1
text-align: center text-align: center

View File

@ -6,7 +6,9 @@
td(v-for="dia in dias") {{ dia }} td(v-for="dia in dias") {{ dia }}
tbody tbody
tr(v-for="hora in horas") tr(v-for="hora in horas")
td {{ hora }} td
span {{ hora.substring(0, 5) }}
span.ocultar-en-movil {{ hora.substr(5) }}
celda(v-for="(dia, i) in dias" :key="i" celda(v-for="(dia, i) in dias" :key="i"
:dia="dia" :dia="dia"
:hora="hora" :hora="hora"
@ -69,5 +71,12 @@
width: 8rem width: 8rem
@media only screen and (max-width: 700px)
.ocultar-en-movil
display: none
// //
</style> </style>

View File

@ -56,7 +56,6 @@
quitarResaltadoGrupo: -> quitarResaltadoGrupo: ->
removerResaltadoGrupo @nombreAño, @cursoAbreviado, @nombreGrupo, @esLab removerResaltadoGrupo @nombreAño, @cursoAbreviado, @nombreGrupo, @esLab
toggleActivo: -> toggleActivo: ->
console.log "Toggling... ´#{@claseCursoGeneral}´"
activarGrupoCursoStr @claseCursoGeneral activarGrupoCursoStr @claseCursoGeneral
@ -65,6 +64,11 @@
<style lang="sass"> <style lang="sass">
.celda
display: inline-block
.elementoOpaco .elementoOpaco
opacity: 0.3 opacity: 0.3

View File

@ -49,3 +49,13 @@ $duracionTransicion: 100ms
background-color: var(--colorLab) background-color: var(--colorLab)
color: white color: white
@media only screen and (min-width: 777px)
.mostrar-en-tablet
display: none !important
@media only screen and (min-width: 1001px)
.mostrar-bajo-1000
display: none !important

View File

@ -3,10 +3,12 @@ import Vuex from 'vuex';
Vue.use(Vuex); Vue.use(Vuex);
export default new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
celdas: {}, celdas: {},
horarioUsuario: {} horarioUsuario: {},
anchoPantalla: window.innerWidth,
altoPantalla: window.innerHeight
}, },
mutations: { mutations: {
registrarCelda(state, idCelda) { registrarCelda(state, idCelda) {
@ -28,9 +30,19 @@ export default new Vuex.Store({
removerCursoMiHorario(state, nombre) { removerCursoMiHorario(state, nombre) {
delete state.horarioUsuario[nombre]; delete state.horarioUsuario[nombre];
state.horarioUsuario = Object.assign({}, state.horarioUsuario); state.horarioUsuario = Object.assign({}, state.horarioUsuario);
},
registrarListenerTamanoPantalla(state) {
window.addEventListener("resize", (ev) => {
state.anchoPantalla = window.innerWidth;
state.altoPantalla = window.innerHeight
});
} }
}, },
actions: { actions: {
} }
}); });
store.commit("registrarListenerTamanoPantalla");
export default store;