toggle fullscreen
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 32s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 32s
This commit is contained in:
@ -8,6 +8,7 @@ const Cookie = {
|
||||
opts['max-age'] = opts.days * 60 * 60 * 24;
|
||||
delete opts.days;
|
||||
}
|
||||
opts.SameSite = 'Strict';
|
||||
opts = Object.entries(opts).reduce((accumulatedStr, [k, v]) => `${accumulatedStr}; ${k}=${v}`, '');
|
||||
document.cookie = name + '=' + encodeURIComponent(value) + opts
|
||||
}
|
||||
@ -44,4 +45,21 @@ const Cookie = {
|
||||
Cookie.set("theme", themes[i], { path: "/", days: 360 });
|
||||
}
|
||||
});
|
||||
|
||||
if(tbuttonfull = document.querySelector('svg#a_tfull')) {
|
||||
tbuttonfull.addEventListener('click', e => {
|
||||
let f = Cookie.get('fullscreen');
|
||||
if(f == 1) {
|
||||
Cookie.set('fullscreen', 0);
|
||||
document.querySelector('html').setAttribute('res', '');
|
||||
tbuttonfull.innerHTML = `<use href="/s/img/iconset.svg#window-maximize"></use>`;
|
||||
}
|
||||
else {
|
||||
Cookie.set('fullscreen', 1);
|
||||
document.querySelector('html').setAttribute('res', 'fullscreen');
|
||||
tbuttonfull.innerHTML = `<use href="/s/img/iconset.svg#window-minimize"></use>`;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user