QoL
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s

This commit is contained in:
schrumpel 2023-11-29 04:46:21 +01:00
parent 5e39c67147
commit 7a42e6ffce
5 changed files with 74 additions and 6 deletions

View File

@ -2912,3 +2912,24 @@ div.favs div.posts {
padding: 5px; padding: 5px;
background: var(--dropdown-bg); background: var(--dropdown-bg);
} }
#bg {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
-webkit-filter: blur(100px);
filter: blur(100px);
transform: translate3d(0, 0, 0);
z-index: 0;
transition: 2s ease;
}
button#togglebg {
border: 0;
background: transparent;
cursor: pointer;
}

View File

@ -1,3 +1,11 @@
window.requestAnimFrame = (function(){
return window.requestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.mozRequestAnimationFrame
|| function(callback) { window.setTimeout(callback, 1000 / 60);};
})();
(() => { (() => {
let video; let video;
if(elem = document.querySelector("#my-video")) { if(elem = document.querySelector("#my-video")) {
@ -8,6 +16,42 @@
document.querySelector('.v0ck_overlay').classList[video.paused ? 'remove' : 'add']('v0ck_hidden'); document.querySelector('.v0ck_overlay').classList[video.paused ? 'remove' : 'add']('v0ck_hidden');
} }
}); });
document.getElementById('togglebg').addEventListener('click', function (e) {
e.preventDefault();
background = !background;
localStorage.setItem('background', background.toString());
var canvas = document.getElementById('bg');
if (background) {
canvas.classList.add('fader-in');
canvas.classList.remove('fader-out');
} else {
canvas.classList.add('fader-out');
canvas.classList.remove('fader-in');
}
animationLoop();
});
if(elem !== null) {
if(localStorage.getItem('background') == undefined) {
localStorage.setItem('background', 'true');
}
var background = localStorage.getItem('background') === 'true';
var canvas = document.getElementById('bg');
var context = canvas.getContext('2d');
var cw = canvas.width = canvas.clientWidth | 0;
var ch = canvas.height = canvas.clientHeight | 0;
function animationLoop() {
if(video.paused || video.ended || !background)
return;
context.drawImage(video, 0, 0, cw, ch);
window.requestAnimFrame(animationLoop);
}
elem.addEventListener('play', animationLoop);
}
} }
let tt = false; let tt = false;

View File

@ -1,7 +1,4 @@
@include(snippets/header) @include(snippets/header)
<div class="links">
</div>
<div class="pagewrapper"> <div class="pagewrapper">
<div id="main"> <div id="main">
<div class="index-container"> <div class="index-container">

View File

@ -1,4 +1,5 @@
@include(snippets/header) @include(snippets/header)
<canvas class="hidden-xs" id="bg"></canvas>
<div class="wrapper"> <div class="wrapper">
<div id="main"> <div id="main">
<div class="container"> <div class="container">
@ -11,10 +12,15 @@
</div> </div>
@if(session) @if(session)
<div class="gapRight"> <div class="gapRight">
<button id="togglebg">&#128161;</button>
<svg class="iconset" id="a_favo"><use href="/s/img/iconset.svg#heart_{{ Object.values(item.favorites).filter(u => u.user == session.user)[0] ? 'solid' : 'regular' }}"></use></svg> <svg class="iconset" id="a_favo"><use href="/s/img/iconset.svg#heart_{{ Object.values(item.favorites).filter(u => u.user == session.user)[0] ? 'solid' : 'regular' }}"></use></svg>
<svg class="iconset" id="a_tfull"><use href="/s/img/iconset.svg#window-{{ fullscreen == 1 ? 'minimize' : 'maximize' }}"></use></svg> <svg class="iconset" id="a_tfull"><use href="/s/img/iconset.svg#window-{{ fullscreen == 1 ? 'minimize' : 'maximize' }}"></use></svg>
<svg class="iconset" id="a_delete"><use href="/s/img/iconset.svg#cross"></use></svg> <svg class="iconset" id="a_delete"><use href="/s/img/iconset.svg#cross"></use></svg>
</div> </div>
@else
<div class="gapRight">
<button id="togglebg">&#128161;</button>
</div>
@endif @endif
</div> </div>
<div class="content"> <div class="content">

View File

@ -18,7 +18,7 @@
<div class="user_content_wrapper"> <div class="user_content_wrapper">
<div class="f0cks"> <div class="f0cks">
<div class="f0cks-header"> <div class="f0cks-header">
f0ck{{ count.f0cks == 1 ? '' : 's' }}: {{ count.f0cks }} <a href="{{ f0cks.link.main }}">view</a> f0ck{{ count.f0cks == 1 ? '' : 's' }}: {{ count.f0cks }} <a href="{{ f0cks.link.main }}">view all</a>
</div> </div>
@if('items' in f0cks) @if('items' in f0cks)
<div class="posts"> <div class="posts">
@ -32,7 +32,7 @@
</div> </div>
<div class="favs"> <div class="favs">
<div class="favs-header"> <div class="favs-header">
fav{{ count.favs == 1 ? '' : 's' }}: {{ count.favs }} <a href="{{ favs.link.main }}">view</a> fav{{ count.favs == 1 ? '' : 's' }}: {{ count.favs }} <a href="{{ favs.link.main }}">view all</a>
</div> </div>
@if('items' in favs) @if('items' in favs)
<div class="posts"> <div class="posts">