feat: improved swipe paging #64
This commit is contained in:
+28
-6
@@ -3,8 +3,20 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline'" />
|
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline'" />
|
||||||
<style>
|
<style>
|
||||||
|
[data-theme="dark"] {
|
||||||
|
--background-color: rgba(225, 225, 225, 0.15);
|
||||||
|
--previous-cursor: w-resize;
|
||||||
|
--next-cursor: e-resize;
|
||||||
|
}
|
||||||
|
[data-theme="light"] {
|
||||||
|
--background-color: rgba(33, 33, 33, 0.15);
|
||||||
|
--previous-cursor: w-resize;
|
||||||
|
--next-cursor: e-resize;
|
||||||
|
}
|
||||||
[data-theme="hidden"] {
|
[data-theme="hidden"] {
|
||||||
--background-color: rgba(0, 0, 0, 0);
|
--background-color: rgba(0, 0, 0, 0);
|
||||||
|
--previous-cursor: none;
|
||||||
|
--next-cursor: none;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -27,24 +39,31 @@
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
background: var(--background-color);
|
|
||||||
}
|
}
|
||||||
li {
|
li {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
li:not(.disabled) #previous {
|
||||||
|
cursor: var(--previous-cursor);
|
||||||
|
}
|
||||||
|
li:not(.disabled) #next {
|
||||||
|
cursor: var(--next-cursor);
|
||||||
|
}
|
||||||
button {
|
button {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 50vh;
|
height: 50vh;
|
||||||
border: none;
|
border: none;
|
||||||
|
cursor: not-allowed;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
#previous {
|
button:not(:active) {
|
||||||
cursor: w-resize;
|
transition: background-color 500ms step-end;
|
||||||
}
|
}
|
||||||
#next {
|
menu:has(button:active) button {
|
||||||
cursor: e-resize;
|
background-color: var(--background-color);
|
||||||
|
transition-duration: 0ms;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@@ -62,13 +81,16 @@
|
|||||||
|
|
||||||
const registerSendEvents = () => {
|
const registerSendEvents = () => {
|
||||||
document.querySelectorAll("button").forEach((button) => {
|
document.querySelectorAll("button").forEach((button) => {
|
||||||
button.addEventListener("click", (e) => {
|
button.addEventListener("pointerdown", (e) => {
|
||||||
ipcRenderer.send("button-click", { id: e.target.id });
|
ipcRenderer.send("button-click", { id: e.target.id });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerReceiveEvents = () => {
|
const registerReceiveEvents = () => {
|
||||||
|
ipcRenderer.on("button-disabled", (e, button) => {
|
||||||
|
document.getElementById(button.id).parentNode.classList.toggle("disabled", button.disabled);
|
||||||
|
});
|
||||||
ipcRenderer.on("data-theme", (e, data) => {
|
ipcRenderer.on("data-theme", (e, data) => {
|
||||||
document.documentElement.setAttribute("data-theme", data.theme);
|
document.documentElement.setAttribute("data-theme", data.theme);
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1 id="title"></h1>
|
<h1 id="title">TouchKio</h1>
|
||||||
</header>
|
</header>
|
||||||
<menu>
|
<menu>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
Reference in New Issue
Block a user