2021-01-14 23:24:55 +00:00
|
|
|
import { estilosGlobales } from "./Estilos";
|
|
|
|
import { StyleSheet, css } from "aphrodite";
|
|
|
|
import { numWallpaper, setNumWallpaper } from "./Store";
|
|
|
|
|
2021-01-15 00:01:30 +00:00
|
|
|
const totalWallpapers = 21;
|
2021-01-14 23:24:55 +00:00
|
|
|
|
|
|
|
function CambiadorImg() {
|
|
|
|
const e = StyleSheet.create({
|
|
|
|
contCambiador: {
|
|
|
|
userSelect: "none"
|
|
|
|
},
|
|
|
|
boton: {
|
|
|
|
cursor: "pointer",
|
|
|
|
textDecoration: "underline",
|
|
|
|
"::before": {
|
|
|
|
fontSize: "1rem",
|
|
|
|
transform: "translateY(0.2rem)"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
botonDesactivado: {
|
|
|
|
cursor: "not-allowed",
|
|
|
|
textDecoration: "none"
|
|
|
|
},
|
|
|
|
botonLeft: {
|
|
|
|
paddingRight: "0.5rem",
|
|
|
|
marginRight: "0.25rem"
|
|
|
|
},
|
|
|
|
botonRight: {
|
|
|
|
paddingLeft: "0.5rem",
|
|
|
|
marginRight: "0.25rem"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const retrocederWallpaper = () => {
|
|
|
|
const num = numWallpaper();
|
|
|
|
if (num > 0) {
|
|
|
|
setNumWallpaper(num - 1);
|
|
|
|
localStorage.setItem("num-img", (num - 1).toString());
|
2021-01-15 00:01:30 +00:00
|
|
|
} else {
|
|
|
|
setNumWallpaper(totalWallpapers);
|
|
|
|
localStorage.setItem("num-img", (totalWallpapers).toString());
|
2021-01-14 23:24:55 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const avanzarWallpaper = () => {
|
|
|
|
const num = numWallpaper();
|
|
|
|
if (num < totalWallpapers) {
|
|
|
|
setNumWallpaper(num + 1);
|
|
|
|
localStorage.setItem("num-img", (num + 1).toString());
|
2021-01-15 00:01:30 +00:00
|
|
|
} else {
|
|
|
|
setNumWallpaper(0);
|
|
|
|
localStorage.setItem("num-img", (0).toString());
|
2021-01-14 23:24:55 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return <div className={css(estilosGlobales.inlineBlock, e.contCambiador)}>
|
|
|
|
<span className={css(estilosGlobales.contenedor, estilosGlobales.inlineBlock)}>
|
|
|
|
<i
|
2021-01-15 00:01:30 +00:00
|
|
|
className={"ph-arrow-left " + css(e.boton, e.botonLeft)}
|
2021-01-14 23:24:55 +00:00
|
|
|
onClick={retrocederWallpaper}
|
|
|
|
/>
|
|
|
|
Img. {numWallpaper() + 1}
|
|
|
|
<i
|
2021-01-15 00:01:30 +00:00
|
|
|
className={"ph-arrow-right " + css(e.boton, e.botonRight)}
|
2021-01-14 23:24:55 +00:00
|
|
|
onClick={avanzarWallpaper}
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</div>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function BarraSuperior() {
|
|
|
|
const estilos = StyleSheet.create({
|
|
|
|
tituloPrincipal: {
|
|
|
|
fontWeight: "bold",
|
|
|
|
fontFamily: "'SF Pro Display', sans-serif"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return <header>
|
|
|
|
<a href="/" className={css(
|
|
|
|
estilosGlobales.contenedor,
|
|
|
|
estilosGlobales.inlineBlock,
|
|
|
|
estilosGlobales.contenedorCursor,
|
|
|
|
estilos.tituloPrincipal
|
|
|
|
)}>
|
|
|
|
Horarios Unsa
|
|
|
|
</a>
|
|
|
|
<a href="https://github.com" target="_blank" className={css(
|
|
|
|
estilosGlobales.contenedor,
|
|
|
|
estilosGlobales.inlineBlock,
|
|
|
|
estilosGlobales.contenedorCursor
|
|
|
|
)}>
|
|
|
|
GitHub
|
|
|
|
<i class="ph-arrow-up-right"/>
|
|
|
|
</a>
|
2021-01-15 00:01:30 +00:00
|
|
|
<CambiadorImg/>
|
2021-01-14 23:24:55 +00:00
|
|
|
<span className={css(estilosGlobales.contenedor, estilosGlobales.inlineBlock)}>2021-A</span>
|
|
|
|
<span className={css(estilosGlobales.contenedor, estilosGlobales.inlineBlock)}>Ingeniería de Sistemas</span>
|
|
|
|
</header>;
|
|
|
|
}
|