disable image drag

main
alexanderroese 2024-06-22 14:42:28 +02:00
parent 8bac6a387d
commit 97855f789a
2 changed files with 16 additions and 9 deletions

View File

@ -408,7 +408,7 @@
</head> </head>
<body class="gradient{% if settings.animations_hover_elements != 'none' %} animate--hover-{{ settings.animations_hover_elements }}{% endif %}"> <body class="gradient{% if settings.animations_hover_elements != 'none' %} animate--hover-{{ settings.animations_hover_elements }}{% endif %} shx-loading-screen-overflow-scroll">
{% render 'shx-loading-screen' {% render 'shx-loading-screen'
, content_type: 'body' %} , content_type: 'body' %}

View File

@ -1,6 +1,6 @@
{% assign content_type = content_type | default: 'body' %} {% assign content_type = content_type | default: "body" %}
{% if content_type == 'body' %} {% if content_type == "body" %}
<div id="shx-loading-screen"> <div id="shx-loading-screen">
<div id="shx-loading-screen-text"> <div id="shx-loading-screen-text">
<svg width="1257" height="189" viewBox="0 0 1257 189" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="1257" height="189" viewBox="0 0 1257 189" fill="none" xmlns="http://www.w3.org/2000/svg">
@ -8,8 +8,12 @@
</svg> </svg>
</div> </div>
</div> </div>
{% elsif content_type == 'head' %} {% elsif content_type == "head" %}
<style> <style>
.shx-loading-screen-overflow-scroll {
overflow-y: scroll;
}
#shx-loading-screen { #shx-loading-screen {
position: fixed; position: fixed;
top: 0; top: 0;
@ -51,21 +55,24 @@
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
const loadingScreen = document.getElementById('shx-loading-screen'); const loadingScreen = document.getElementById("shx-loading-screen");
const body = document.querySelector("body")
function showLoadingScreen() { function showLoadingScreen() {
loadingScreen.classList.remove('shx-loading-screen-hidden'); loadingScreen.classList.remove("shx-loading-screen-hidden");
body.classList.remove("shx-loading-screen-overflow-scroll")
} }
function hideLoadingScreen() { function hideLoadingScreen() {
loadingScreen.classList.add('shx-loading-screen-hidden'); loadingScreen.classList.add("shx-loading-screen-hidden");
body.classList.add("shx-loading-screen-overflow-scroll")
} }
window.addEventListener('beforeunload', function() { window.addEventListener("beforeunload", function() {
showLoadingScreen(); showLoadingScreen();
}); });
window.addEventListener('load', function() { window.addEventListener("load", function() {
hideLoadingScreen(); hideLoadingScreen();
}); });
}); });