Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lenincompres committed Nov 23, 2024
1 parent e1a90f5 commit aec2263
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 189 deletions.
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">

<html>
<head>
<script src="DOM.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
Expand All @@ -14,10 +13,8 @@
gtag('js', new Date());
gtag('config', 'G-9S3H2NXER5');
</script>
<script src="index.js" type="module" defer></script>
<script src="main.js" type="module" defer></script>
</head>

<body>
</body>

</html>
54 changes: 46 additions & 8 deletions index.js → main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import * as STYLE from "./src/style.js";
import Pager from "./src/Pager.js";
import Copy from "./src/Copy.js";
import "./src/pages.js";
import SOCIAL_LINKS from "./src/social.js";
import CardScroll from "./src/CardScroll.js";
import news from "./src/news.js";
import bioPage from "./src/pages/bio.js";
import projectsPage from "./src/pages/projects.js";
import contactPage from "./src/pages/contact.js";

const _hoverPage = new Binder();
const _isMobile = new Binder();
const _isWide = new Binder();
binderSet({
hoverPage: false,
isMobile: false,
isWide: false,
})

function resized(e) {
_isMobile.value = window.innerWidth < 780;
_isWide.value = window.innerWidth > 1050;
isMobile = window.innerWidth < 780;
isWide = window.innerWidth > 1050;
};


Expand All @@ -23,6 +29,38 @@ Copy.add({
en: "educator",
es: "educador",
},
bio: {
en: "bio",
es: "biografía"
},
home: {
es: "home",
en: "inicio",
},
projects: {
es: "proyectos",
en: "projects",
},
contact: {
es: "contacto",
en: "contact",
}
});

let newsScroll = new CardScroll(news);
newsScroll.start();
window.addEventListener('hashchange', () => {
newsScroll.clear();
newsScroll.start();
});

Pager.add({
[Copy.KEY.home]: {
section: newsScroll,
},
[Copy.KEY.bio]: bioPage,
[Copy.KEY.projects]: projectsPage,
[Copy.KEY.contact]: contactPage,
});

DOM.set({
Expand Down Expand Up @@ -175,8 +213,8 @@ DOM.set({
},
text: Copy.get(name),
onclick: e => Pager.key = name,
mouseover: e => _hoverPage.value = name,
mouseout: e => _hoverPage.value = false,
mouseover: e => hoverPage = name,
mouseout: e => hoverPage = false,
},
})),
},
Expand Down
175 changes: 0 additions & 175 deletions src/pages.js

This file was deleted.

18 changes: 18 additions & 0 deletions src/pages/bio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Copy from "../Copy.js";
import * as STYLE from "../style.js";

const bioPage = {
section: {
style: STYLE.PAGE,
model: STYLE.SLIDE("left", 2),
lineHeight: "1.5em",
content: {
p: Copy.text({
es: `Lenin Comprés (también conocido como Prof. Lenino) es un profesional en medios interactivos, ciencias de la educación y artes escénicas. Se desempeña como profesor y tecnólogo creativo en la <a href="https://itp.nyu.edu/itp/people/?tab=staff"> Escuela de Artes TISCH de la Universidad de Nueva York</a> y es graduado de Teachers College de la Universidad de Columbia. Lenin es coautor del guion galardonado de <a href="https://www.imdb.com/title/tt7552938/">Mis 500 locos</a>, que representó a la República Dominicana en los Óscares de 2021. También es el creador de <a href="http://jackrabbits.lenino.net">Lenino’s JACK RABBITS</a>, el primer juego de mesa original escrito por un dominicano, que cuenta con un manual de instrucciones completamente en verso y rima. Como artista, se presenta bajo su seudónimo Lenino como un cuentacuentos musicómico.`,
en: `Lenin Comprés (also known as Prof. Lenino) is a professional in interactive media, educational sciences, and performing arts. He serves as a professor and creative technologist at <a href="https://itp.nyu.edu/itp/people/?tab=staff">New York University's TISCH School of the Arts</a> and holds a degree from Columbia University's Teachers College. Lenin is the co-writer of the award-winning script for <a href="https://www.imdb.com/title/tt7552938/">A State of Madness</a>, which represented the Dominican Republic at the 2021 Oscars. He is also the creator of <a href="http://jackrabbits.lenino.net">Lenino’s JACK RABBITS</a>, the first original Dominican-authored board game featuring an instructional booklet written entirely in verse and rhyme. As an artist, he performs as a quirky musical storyteller under his Lenino moniker.`
}),
},
}
};

export default bioPage;
21 changes: 21 additions & 0 deletions src/pages/contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import SOCIAL_LINKS from "../social.js";
import * as STYLE from "../style.js";

const contactPage = {
menu: {
fontSize: "3.43em",
marginTop: "1em",
ul: {
style: STYLE.FLEX,
justifyContent: "center",
li: SOCIAL_LINKS.map((a, i) => ({
a: {
model: [a, STYLE.SLIDE(i)],
margin: "0.25em",
}
}))
}
}
};

export default contactPage;
Loading

0 comments on commit aec2263

Please sign in to comment.