From ac8badc60e91b0c615d2e3c0d18526b3be63216c Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Mon, 4 Mar 2024 11:20:10 +0100 Subject: [PATCH] clippy move --- playlist/static/style.css | 29 +++++++++++++++++------------ playlist/templates/Base.html | 6 +++++- playlist/templates/Clippy.html | 2 +- playlist/templates/head.html | 2 ++ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/playlist/static/style.css b/playlist/static/style.css index eea6bdf..3b92681 100644 --- a/playlist/static/style.css +++ b/playlist/static/style.css @@ -251,18 +251,18 @@ iframe { } /* Clippy */ -.clippy { +#clippy { position: fixed; z-index:99; - right: 5px; - bottom: 0px; display: flex; flex-flow: column nowrap; align-items: flex-end; width: 256px; + left: 550px; + top: 340px; } -.clippy .body { +#clippy .body { background: #ffffe0; color: black; padding: 10px; @@ -271,16 +271,21 @@ iframe { position: relative; } -.clippy .body .content { +#clippy .body .content { max-height:calc(100vh - 197px); overflow-y: scroll; } @media (max-width: 500px) { - .clippy { + #clippy { width: calc(100vw - 10px); + top: unset; + left: unset; + transform: none !important; + bottom: 0; + right: 0; } - .clippy .body.hide { + #clippy .body.hide { display: none; } .body.hide ~ img { @@ -288,11 +293,11 @@ iframe { } } -.clippy .body.hide { +#clippy .body.hide { display: none; } -.clippy .body::after { +#clippy .body::after { content: ""; position: absolute; bottom: -13px; @@ -304,7 +309,7 @@ iframe { width: 0; } -.clippy .body::before { +#clippy .body::before { content: ""; position: absolute; bottom: -14px; @@ -316,7 +321,7 @@ iframe { width: 0; } -.clippy .body button { +#clippy .body button { background: lightyellow; border: 1px #999 solid; border-radius: 2px; @@ -324,7 +329,7 @@ iframe { margin-top: 5px; } -.clippy img { +#clippy img { width: 128px; } diff --git a/playlist/templates/Base.html b/playlist/templates/Base.html index dce31a4..0ef654b 100644 --- a/playlist/templates/Base.html +++ b/playlist/templates/Base.html @@ -10,7 +10,8 @@ {% block window-title %}{% endblock %}
- + +
{% csrf_token %} @@ -51,6 +52,8 @@ position.y += event.dy event.target.parentElement.style.transform = `translate(${position.x}px, ${position.y}px)` + document.getElementById("clippy").style.transform = + `translate(${position.x}px, ${position.y}px)` }, } }) @@ -64,6 +67,7 @@ function resetWindow() { position.reset() document.getElementById("main-window").style.transform = ''; + document.getElementById("clippy").style.transform = ''; } diff --git a/playlist/templates/Clippy.html b/playlist/templates/Clippy.html index 2979d48..a820189 100644 --- a/playlist/templates/Clippy.html +++ b/playlist/templates/Clippy.html @@ -6,7 +6,7 @@ e.parentElement.classList.add("hide") } -
+
{{ body }}

diff --git a/playlist/templates/head.html b/playlist/templates/head.html index 13c378d..d19c32f 100644 --- a/playlist/templates/head.html +++ b/playlist/templates/head.html @@ -34,6 +34,8 @@ position.y = stored_position.y document.getElementById("main-window").style.transform = `translate(${position.x}px, ${position.y}px)` + document.getElementById("clippy").style.transform = + `translate(${position.x}px, ${position.y}px)` } else { localStorage.removeItem("position") }