Skip to content

Commit

Permalink
🐛 Fixes for CV changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cookiengineer committed Jan 24, 2025
1 parent c0b2705 commit ed9e270
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 50 deletions.
117 changes: 68 additions & 49 deletions cv/design/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@

(function(global) {

const dispatch_profile = () => {

let profile = global.document.querySelector('#profile');
if (profile !== null) {

profile.addEventListener('click', (event) => {

let avatar = profile.querySelector('#avatar img');

if (event.target === avatar) {

[
profile.querySelector('img'),
profile.querySelector('figcaption b'),
profile.querySelector('aside a[href^="mailto:"]')
].filter((element) => {
return element !== null;
}).forEach((element) => {

if (element.getAttribute('data-src') !== null) {

let tmp = element.src;

element.setAttribute('src', element.getAttribute('data-src'));
element.setAttribute('data-src', tmp);

}

if (element.getAttribute('data-html') !== null) {

let tmp = element.innerHTML;

element.innerHTML = element.getAttribute('data-html');
element.setAttribute('data-html', tmp);

}

if (element.getAttribute('data-href') !== null) {

let tmp = element.href;

element.href = element.getAttribute('data-href');
element.setAttribute('data-href', tmp);

}

});

event.preventDefault();
event.stopPropagation();

}

});

}

};

const replace = (section, data) => {

let str0 = data.indexOf('<section id="' + section + '"');
Expand Down Expand Up @@ -78,57 +137,11 @@
wrapper.parentNode.removeChild(wrapper);
}

}, 1000);
}, 0);

setTimeout(() => {

let profile = global.document.querySelector('#profile');
if (profile !== null) {

let avatar = profile.querySelector('#avatar');

avatar.addEventListener('click', () => {

[
profile.querySelector('img'),
profile.querySelector('figcaption b'),
profile.querySelector('aside a[href^="mailto:"]')
].forEach((element) => {

if (element.getAttribute('data-src') !== null) {

let tmp = element.src;

element.setAttribute('src', element.getAttribute('data-src'));
element.setAttribute('data-src', tmp);

}

if (element.getAttribute('data-html') !== null) {

let tmp = element.innerHTML;

element.innerHTML = element.getAttribute('data-html');
element.setAttribute('data-html', tmp);

}

if (element.getAttribute('data-href') !== null) {

let tmp = element.href;

element.href = element.getAttribute('data-href');
element.setAttribute('data-href', tmp);

}

});

});

}

}, 1000);
dispatch_profile();
}, 100);

}

Expand All @@ -140,6 +153,12 @@

});

} else {

setTimeout(() => {
dispatch_profile();
}, 100)

}

})(typeof window !== 'undefined' ? window : this);
Expand Down
2 changes: 1 addition & 1 deletion cv/design/open-source.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

section#open-source aside {
top: 16px;
top: 0px;
padding: calc(64px + 16px) 0px 0px 0px;
}

0 comments on commit ed9e270

Please sign in to comment.