Skip to content

Commit

Permalink
cambios
Browse files Browse the repository at this point in the history
  • Loading branch information
deletidev committed Nov 27, 2023
1 parent 649994a commit c28882a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 60 deletions.
6 changes: 5 additions & 1 deletion export-samples/html/cv-monochrome-force.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
min-width: 428px;
display: flex;
flex-direction: column;
min-height: 100dvh;
min-height: 100svh;
position: relative;
}

Expand Down Expand Up @@ -672,6 +672,10 @@
.column {
display: none;
}
.main {
flex-grow: 1;
}

@media screen and (min-width: 834px) {
.main {
display: grid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%_ if (profile && profile !== 'undefined' ) { -%>
<%_ if (profile.description && profile.description !== 'undefined' ) { -%>
<section class="section about">
<h2 class="title"><%- labels.ABOUT_ME_HEADING %></h2>
<p><%= profile?.description %></p>
<p><%= profile.description %></p>
</section>
<%_ } -%>
Original file line number Diff line number Diff line change
@@ -1,69 +1,74 @@
<script>
// Selecciona un elemento del DOM
const elementInDOM = selector => document.querySelector(selector);
<script>
// Selecciona un elemento del DOM
const elementInDOM = selector => document.querySelector(selector);
// Selecciona un elemento del DOM y comprueba que exista
const elementReady = selector => {
const element = elementInDOM(selector);
if (element && element instanceof HTMLElement) {
return element;
}
console.log(new Error(`Element with id ${selector} not found in DOM`));
return null;
};
// Selecciona un elemento del DOM y comprueba que exista
const elementReady = selector => {
const element = elementInDOM(selector);
if (element && element instanceof HTMLElement) {
return element;
}
console.log(new Error(`Element with id ${selector} not found in DOM`));
return null;
};
// media query event handler (mobile)
function handleResize() {
// Selecciona los elementos y comprueba que existan
const main = elementInDOM('.main');
const aboutMe = elementInDOM('.about');
const experience = elementInDOM('.experiencies');
const myLinks = elementInDOM('.links');
const languages = elementInDOM('.languages');
const hardSkills = elementInDOM('.hard-skills');
const softSkills = elementInDOM('.soft-skills');
const education = elementInDOM('.educations');
const avatar = elementInDOM('.header__avatar');
const background = elementInDOM('.background');
const footer = elementInDOM('.footer');
// media query event handler (mobile)
function handleResize() {
// Selecciona los elementos y comprueba que existan
const main = elementInDOM('.main');
const aboutMe = elementInDOM('.about');
const experience = elementInDOM('.experiencies');
const myLinks = elementInDOM('.links');
const languages = elementInDOM('.languages');
const hardSkills = elementInDOM('.hard-skills');
const softSkills = elementInDOM('.soft-skills');
const education = elementInDOM('.educations');
const avatar = elementInDOM('.header__avatar');
const background = elementInDOM('.background');
const footer = elementInDOM('.footer');
// Selecciona las columnas y comprueba que existan
const columnLeft = elementInDOM('.column-left');
const columnRight = elementInDOM('.column-right');
// Selecciona las columnas y comprueba que existan
const columnLeft = elementInDOM('.column-left');
const columnRight = elementInDOM('.column-right');
if (window.innerWidth > 834) {
// Mueve los elementos a las columnas correspondientes
columnLeft.appendChild(aboutMe);
columnLeft.appendChild(experience);
columnRight.appendChild(myLinks);
columnRight.appendChild(languages);
columnRight.appendChild(hardSkills);
columnRight.appendChild(softSkills);
columnRight.appendChild(education);
if (window.innerWidth > 834) {
// Mueve los elementos a las columnas correspondientes
aboutMe && columnLeft.appendChild(aboutMe);
experience && columnLeft.appendChild(experience);
myLinks && columnRight.appendChild(myLinks);
languages && columnRight.appendChild(languages);
hardSkills && columnRight.appendChild(hardSkills);
softSkills && columnRight.appendChild(softSkills);
education && columnRight.appendChild(education);
// Comprueba que haya contenido en la colummna izquierda por el grid
if (!columnLeft.children.length > 0) {
columnLeft.style.display = 'none';
}
if (avatar) {
background.classList.add('background--image');
footer.classList.add('footer--image');
} else {
background.classList.remove('background--image');
}
if (avatar) {
background.classList.add('background--image');
footer.classList.add('footer--image');
} else {
// Mueve los elementos al contenedor
main.appendChild(myLinks);
main.appendChild(aboutMe);
main.appendChild(languages);
main.appendChild(hardSkills);
main.appendChild(softSkills);
main.appendChild(experience);
main.appendChild(education);
background.classList.remove('background--image');
}
} else {
// Mueve los elementos al contenedor
myLinks && main.appendChild(myLinks);
aboutMe && main.appendChild(aboutMe);
languages && main.appendChild(languages);
hardSkills && main.appendChild(hardSkills);
softSkills && main.appendChild(softSkills);
experience && main.appendChild(experience);
education && main.appendChild(education);
}
}
// Se ejecuta cuando la página cambia de tamaño
window.addEventListener('resize', handleResize);
// Se ejecuta cuando la página cambia de tamaño
window.addEventListener('resize', handleResize);
// Se ejecuta cuando la página está cargada
document.addEventListener('DOMContentLoaded', handleResize);
</script>
// Se ejecuta cuando la página está cargada
document.addEventListener('DOMContentLoaded', handleResize);
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
/* utility */
.container {
padding: var(--space-16);
width: 100%;
max-width: 1024px;
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -671,6 +672,9 @@
.column {
display: none;
}
.main {
flex-grow: 1;
}
@media screen and (min-width: 834px) {
.main {
display: grid;
Expand Down

0 comments on commit c28882a

Please sign in to comment.