--bgColorMidDark: #353b43;
--bgColorLightDark: #4f5864;
--bgColorLight: #D2D2D2;
+ --bgColorBlue: #1b6694;
+ --bgColorSalamandra: rgb(236, 162, 143);
--globalScale: 1;
}
a:active {
text-decoration: none;
font-size: 1.5rem;
+ color: var(--bgColorSalamandra);
}
html {
height: 100%;
}
+::-webkit-scrollbar {
+ width: 0.35rem;
+}
+
+::-webkit-scrollbar-thumb {
+ background-color: var(--bgColorBlue);
+}
+
aside {
+ position: fixed;
+ inset: 0 calc(100% - 18rem);
grid-area: aside;
display: none;
flex-flow: column nowrap;
align-items: flex-start;
justify-content: flex-start;
- width: 100%;
- padding: 0 1rem;
+ width: 18rem;
+ height: calc(100% - 5rem);
+ margin-top: 5rem;
+ padding: 2rem 1rem;
background-color: var(--bgColorDark);
+ overflow: auto;
}
aside .item {
+ color: var(--bgColorLight);
display: flex;
- flex-flow: row nowrap;
+ flex-flow: column nowrap;
align-items: center;
justify-content: space-between;
font-size: 1.5rem;
}
nav ul {
- display: flex;
+ display: none;
flex-flow: row nowrap;
align-items: center;
justify-content: flex-end;
text-decoration: none;
}
+nav button {
+ display: flex;
+ position: absolute;
+ width: 4rem;
+ height: 4rem;
+ right: 0.4rem;
+
+ background-image: url('../images/menu.png');
+ background-color: transparent; /* Cuando usamos background-image se pone el background-color en blanco por default por eso le indicamos que sea transparente para que se pueda ver la imagen. */
+ background-position: top left;
+ background-repeat: no-repeat;
+ background-size: cover;
+
+ border: none;
+ cursor: pointer;
+
+ transition: background-image ease 0.2s;
+
+}
+
+nav button[data-visible="true"] {
+ background-image: url('../images/menu-abierto.png');
+}
+
main {
grid-area: main;
padding: 2rem;
}
body {
- grid-template-columns: 11rem 1fr;
+ grid-template-columns: 13rem 1fr;
grid-template-areas: /* Tabletas se muestra el aside */
"navbar navbar"
- "aside main"
+ "main main"
"footer footer";
}
- aside {
+ nav ul {
display: flex;
}
+
+ aside {
+ display: none;
+ }
+
+ nav button, aside li a {
+ display: none;
+ }
+
}
@media screen and (min-width: 1280px) {
// CODE SECTION: greetings
const title = document.querySelector("title");
+const hamButton = document.querySelector("nav button");
+const aside = document.querySelector("aside");
console.log("Gracias por visitar a " + title.innerHTML);
+
+hamButton.addEventListener("click", (e)=>{
+ if(e.target.attributes[0].nodeValue === 'true'){
+ e.target.attributes[0].nodeValue = false;
+ aside.setAttribute("style", "display: none");
+ } else {
+ e.target.attributes[0].nodeValue = true;
+ aside.setAttribute("style", "display: flex");
+ }
+});
<link rel="stylesheet" href="{{ $homeStyles.Permalink }}">
{{ "<!-- Main Script -->" | safeHTML }}
{{ $mainScript := resources.Get "js/main.js" }}
- <script src="{{ $mainScript.Permalink }}"></script>
+ <script src="{{ $mainScript.Permalink }}" defer></script>
{{ "<!-- JS Thirparties -->" | safeHTML }}
{{ range .Site.Params.plugins.js }}
<script src="{{ .link | absURL }}" crossorigin="anonymous"></script>