feat: remove modal
This commit is contained in:
parent
1402b33e4f
commit
f47db584d1
12
index.html
12
index.html
|
@ -54,20 +54,10 @@
|
||||||
<li><a href="https://git.anna.lgbt/ascclemens">gitea</a></li>
|
<li><a href="https://git.anna.lgbt/ascclemens">gitea</a></li>
|
||||||
<li><a href="https://git.sr.ht/~jkcclemens">sourcehut</a></li>
|
<li><a href="https://git.sr.ht/~jkcclemens">sourcehut</a></li>
|
||||||
<li><a href="https://github.com/ascclemens">github</a></li>
|
<li><a href="https://github.com/ascclemens">github</a></li>
|
||||||
<li><a href="javascript:void(0)" id="email-button">click to see email</a></li>
|
<li><a href="javascript:void(0)" id="email">click to see email</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<dialog id="modal">
|
|
||||||
<article>
|
|
||||||
<a id="email-close" aria-label="close" class="close"></a>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
My email is <span id="email-text"></span>.
|
|
||||||
</p>
|
|
||||||
</article>
|
|
||||||
</dialog>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
10
js/index.js
10
js/index.js
|
@ -3,16 +3,14 @@
|
||||||
return s.replace(/[a-zA-Z]/g,(c)=>String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26));
|
return s.replace(/[a-zA-Z]/g,(c)=>String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26));
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('email-button').addEventListener('click', () => {
|
let reveal = document.getElementById('email');
|
||||||
|
reveal.addEventListener('click', () => {
|
||||||
let email = 'si' + atob('dGVAYW4=') + 'na' + atob(y('L2kyoJIhpl5c')) + 'o';
|
let email = 'si' + atob('dGVAYW4=') + 'na' + atob(y('L2kyoJIhpl5c')) + 'o';
|
||||||
|
|
||||||
let emailLink = document.createElement('a');
|
let emailLink = document.createElement('a');
|
||||||
emailLink.setAttribute('href', `mailto:${email}`);
|
emailLink.setAttribute('href', `mailto:${email}`);
|
||||||
emailLink.innerText = email;
|
emailLink.innerText = email;
|
||||||
document.getElementById('email-text').replaceWith(emailLink);
|
|
||||||
document.getElementById('modal').setAttribute('open', '');
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('email-close').addEventListener('click', () => {
|
reveal.replaceWith(emailLink);
|
||||||
document.getElementById('modal').removeAttribute('open');
|
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue