)) |'ve added a fullscreen option
via double-click anywhere on the page. )) Now the feather info icon is fading out after 3s, and it appears every time the user hovers it with the mouse. )) I've changed a little bit formatting of the codemerge-requests/2/head
parent
4d0cb5f63c
commit
3bceb5a859
@ -0,0 +1,30 @@
|
||||
function toggleFullScreen() {
|
||||
const doc = window.document;
|
||||
const docEl = doc.documentElement;
|
||||
|
||||
var requestFullScreen =
|
||||
docEl.requestFullscreen ||
|
||||
docEl.mozRequestFullScreen ||
|
||||
docEl.webkitRequestFullScreen ||
|
||||
docEl.msRequestFullscreen;
|
||||
var cancelFullScreen =
|
||||
doc.exitFullscreen ||
|
||||
doc.mozCancelFullScreen ||
|
||||
doc.webkitExitFullscreen ||
|
||||
doc.msExitFullscreen;
|
||||
|
||||
if (
|
||||
!doc.fullscreenElement &&
|
||||
!doc.mozFullScreenElement &&
|
||||
!doc.webkitFullscreenElement &&
|
||||
!doc.msFullscreenElement
|
||||
) {
|
||||
requestFullScreen.call(docEl);
|
||||
} else {
|
||||
cancelFullScreen.call(doc);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("dblclick", () => {
|
||||
toggleFullScreen();
|
||||
});
|
@ -1,15 +1,20 @@
|
||||
var modal = document.querySelector('[data-modal]');
|
||||
const modal = document.querySelector("[data-modal]");
|
||||
|
||||
modal.addEventListener('click', function (event) {
|
||||
modal.addEventListener("click", function (event) {
|
||||
event.preventDefault();
|
||||
var modalId = document.getElementById(modal.dataset.modal);
|
||||
modalId.classList.add('open');
|
||||
const modalId = document.getElementById(modal.dataset.modal);
|
||||
modalId.classList.add("open");
|
||||
|
||||
var exits = modalId.querySelectorAll('.modal-exit');
|
||||
var exits = modalId.querySelectorAll(".modal-exit");
|
||||
exits.forEach(function (exit) {
|
||||
exit.addEventListener('click', function (event) {
|
||||
exit.addEventListener("click", function (event) {
|
||||
event.preventDefault();
|
||||
modalId.classList.remove('open');
|
||||
modalId.classList.remove("open");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
const featherInfo = document.getElementsByClassName("feather-info")[0];
|
||||
featherInfo.classList.toggle("feather-info-hover");
|
||||
}, 3000);
|
||||
|
Loading…
Reference in New Issue