mirror of
https://git.feneas.org/feneas/fediverse.git
synced 2024-12-24 04:01:44 +01:00
26 lines
640 B
JavaScript
26 lines
640 B
JavaScript
|
|
||
|
'use strict';
|
||
|
|
||
|
document.addEventListener('DOMContentLoaded', function() {
|
||
|
|
||
|
/**** Open intro on click ****/
|
||
|
const intro = document.getElementById('introduction');
|
||
|
intro.addEventListener('click', toggleContent);
|
||
|
|
||
|
function toggleContent(e) {
|
||
|
const content = e.currentTarget.firstChild;
|
||
|
content.classList.toggle('open');
|
||
|
}
|
||
|
|
||
|
/**** Reveal share buttons ****/
|
||
|
const share = document.getElementById('share');
|
||
|
|
||
|
share.addEventListener('click', toggleInfo);
|
||
|
|
||
|
function toggleInfo(e) { // to separate func-helpers file
|
||
|
const content = e.currentTarget.previousElementSibling;
|
||
|
content.classList.toggle('open');
|
||
|
}
|
||
|
|
||
|
});
|