Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed debug button style #103

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions priv/static/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ document.addEventListener("DOMContentLoaded", function () {
padding-left: 5px;
padding-right: 5px;
border-radius: 10px;
background-color: rgba(235, 235, 235, 0.8);
background-color: #4C2B8A;
display: flex;
gap: 5px;
justify-content: center;
Expand All @@ -27,13 +27,7 @@ document.addEventListener("DOMContentLoaded", function () {
right: 20px;
cursor: grab;">
<a href="${URL}/${session_id}" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 25px; height: 25px;">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"
/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/></svg>
</a>
</div>
`;
Expand Down Expand Up @@ -74,16 +68,16 @@ document.addEventListener("DOMContentLoaded", function () {

if (debugButton.offsetTop < 0) {
debugButton.style.top = debugButton.style.bottom;
};
}
if (debugButton.offsetTop + debugButton.clientHeight > window.innerHeight) {
debugButton.style.top = '';
};
debugButton.style.top = "";
}
if (debugButton.offsetLeft < 0) {
debugButton.style.left = debugButton.style.right;
};
}
if (debugButton.offsetLeft + debugButton.clientWidth > window.innerWidth) {
debugButton.style.left = '';
};
debugButton.style.left = "";
}
};

const onClick = (event) => {
Expand All @@ -93,14 +87,24 @@ document.addEventListener("DOMContentLoaded", function () {
}
};

window.addEventListener('resize', () => {
if (debugButton.offsetLeft + debugButton.clientWidth + Number.parseInt(debugButton.style.right) > window.innerWidth) {
debugButton.style.left = '';
window.addEventListener("resize", () => {
if (
debugButton.offsetLeft +
debugButton.clientWidth +
Number.parseInt(debugButton.style.right) >
window.innerWidth
) {
debugButton.style.left = "";
}
if (debugButton.offsetTop + debugButton.clientHeight + Number.parseInt(debugButton.style.bottom) > window.innerHeight) {
debugButton.style.top = '';
if (
debugButton.offsetTop +
debugButton.clientHeight +
Number.parseInt(debugButton.style.bottom) >
window.innerHeight
) {
debugButton.style.top = "";
}
})
});

debugButton.addEventListener("mousedown", onMouseDown);
debugButton.addEventListener("click", onClick);
Expand Down