Start moving to material design components
This commit is contained in:
5 files changed
+946
-1400
No files matched your search
+837
-1352
File diff suppressed because it is too large.
Load diff
+53
-24
@@ -13,6 +13,59 @@
|
|||||||
background: rgb(255 255 255/1);
|
background: rgb(255 255 255/1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login {
|
||||||
|
--mdc-theme--primary: white !important;
|
||||||
|
--mdc-theme--primary-bg: var(--main-bg) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login button {
|
||||||
|
background-color: rgb(255 255 255 / 0.3) !important;
|
||||||
|
border-radius: 100px;
|
||||||
|
border: 2px solid white !important;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.login .mdc-button__ripple > * {
|
||||||
|
background-color: rgb(0 0 0 / 0.3) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled)
|
||||||
|
.mdc-notched-outline__leading,
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled)
|
||||||
|
.mdc-notched-outline__notch,
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled)
|
||||||
|
.mdc-notched-outline__trailing {
|
||||||
|
border-color: rgb(255 255 255 / 0.4) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused
|
||||||
|
.mdc-notched-outline__leading,
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused
|
||||||
|
.mdc-notched-outline__notch,
|
||||||
|
.login
|
||||||
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused
|
||||||
|
.mdc-notched-outline__trailing {
|
||||||
|
border-color: rgb(255, 255, 255) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login .mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label {
|
||||||
|
color: rgb(255 255 255 / 0.6);
|
||||||
|
}
|
||||||
|
.login
|
||||||
|
.mdc-text-field--focused:not(.mdc-text-field--disabled)
|
||||||
|
.mdc-floating-label {
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login .mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input {
|
||||||
|
color: rgb(255 255 255 / 0.87);
|
||||||
|
caret-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
#background {
|
#background {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -120,30 +173,6 @@ button.clicky:active::after {
|
|||||||
transition: 0s;
|
transition: 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"],
|
|
||||||
input[type="url"],
|
|
||||||
input[type="password"] {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 3px solid white;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
--clr: currentColor;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #ffffff4b;
|
|
||||||
border: 2px solid white;
|
|
||||||
color: white;
|
|
||||||
border-radius: 100px;
|
|
||||||
width: 100%;
|
|
||||||
transition: background var(--transition-time-default);
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background: #ffffff6b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input__label {
|
.input__label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|||||||
+32
-10
@@ -22,13 +22,15 @@
|
|||||||
<script type="module">
|
<script type="module">
|
||||||
import { decode } from "https://cdn.jsdelivr.net/npm/blurhash@1.1.5/+esm"
|
import { decode } from "https://cdn.jsdelivr.net/npm/blurhash@1.1.5/+esm"
|
||||||
import { UserApi, Configuration, LibraryApi, ItemsApi, UserLibraryApi } from 'https://cdn.jsdelivr.net/npm/@jellyfin/client-axios/+esm';
|
import { UserApi, Configuration, LibraryApi, ItemsApi, UserLibraryApi } from 'https://cdn.jsdelivr.net/npm/@jellyfin/client-axios/+esm';
|
||||||
window.decode = decode
|
window.decode = decode;
|
||||||
window.UserApi = UserApi;
|
window.UserApi = UserApi;
|
||||||
window.Configuration = Configuration;
|
window.Configuration = Configuration;
|
||||||
window.LibraryApi = LibraryApi;
|
window.LibraryApi = LibraryApi;
|
||||||
window.UserLibraryApi = UserLibraryApi;
|
window.UserLibraryApi = UserLibraryApi;
|
||||||
window.ItemsApi = ItemsApi;
|
window.ItemsApi = ItemsApi;
|
||||||
</script>
|
</script>
|
||||||
|
<link href="https://unpkg.com/material-components-web@13.0.0/dist/material-components-web.min.css" rel="stylesheet">
|
||||||
|
<script src="https://unpkg.com/material-components-web@13.0.0/dist/material-components-web.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
@@ -56,12 +58,20 @@
|
|||||||
<object data="../../assets/logo.svg" type="image/svg+xml"></object>
|
<object data="../../assets/logo.svg" type="image/svg+xml"></object>
|
||||||
</div>
|
</div>
|
||||||
<div class="form__cont">
|
<div class="form__cont">
|
||||||
<div class="input">
|
<div class="mdc-text-field mdc-text-field--outlined">
|
||||||
<input id="serverUrl" type="url" class="input__text server__url" onblur="setLabelPos(this)">
|
<input type="text" class="mdc-text-field__input first-name-input server__url">
|
||||||
<label for="serverUrl" class="input__label">Server Address</label>
|
<span class="mdc-notched-outline">
|
||||||
|
<span class="mdc-notched-outline__leading"></span>
|
||||||
|
<span class="mdc-notched-outline__notch">
|
||||||
|
<span class="mdc-floating-label" id="my-label-id">Server Address</span>
|
||||||
|
</span>
|
||||||
|
<span class="mdc-notched-outline__trailing"></span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="input__btn save__server clicky">
|
<button class="mdc-button mdc-button--raised save__server">
|
||||||
<span class="btn__label">Save</span>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Save</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="mdi mdi-information-outline"></span>
|
<span class="mdi mdi-information-outline"></span>
|
||||||
@@ -76,11 +86,15 @@
|
|||||||
<section class="page users hide">
|
<section class="page users hide">
|
||||||
<h3 class="title__name">Users</h3>
|
<h3 class="title__name">Users</h3>
|
||||||
<section class="user__cont"></section>
|
<section class="user__cont"></section>
|
||||||
<button class="change__server clicky" onclick="createManualLogin(true);document.querySelector('.manual__login').classList.remove('hide');document.querySelector('.manual__login').scrollIntoView({ behavior: 'smooth' });setInterval(() => {document.querySelector('.server').classList.add('hide');}, 1000);">
|
<button class="mdc-button mdc-button--raised" onclick="createManualLogin(true);document.querySelector('.manual__login').classList.remove('hide');document.querySelector('.manual__login').scrollIntoView({ behavior: 'smooth' });setInterval(() => {document.querySelector('.server').classList.add('hide');}, 1000);">
|
||||||
<span>Manual Login</span>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Manual login</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="change__server clicky" onclick="changeServer('.users')">
|
<button class="mdc-button mdc-button--raised" onclick="changeServer('.users')">
|
||||||
<span>Change Server</span>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Change Server</span>
|
||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
<section class="page manual__login hide">
|
<section class="page manual__login hide">
|
||||||
@@ -90,6 +104,14 @@
|
|||||||
<section class="manual__input"></section>
|
<section class="manual__input"></section>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
<script defer>
|
||||||
|
document.querySelectorAll(".mdc-button").forEach(button => {
|
||||||
|
mdc.ripple.MDCRipple.attachTo(button)
|
||||||
|
});
|
||||||
|
document.querySelectorAll(".mdc-text-field").forEach(textField => {
|
||||||
|
mdc.textField.MDCTextField.attachTo(textField);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<script src="qrc:/renderer/js/login.js" defer></script>
|
<script src="qrc:/renderer/js/login.js" defer></script>
|
||||||
<script src="qrc:/renderer/js/main.js" defer></script>
|
<script src="qrc:/renderer/js/main.js" defer></script>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
+19
-14
@@ -5,6 +5,7 @@ const user__cont = document.querySelector('.users');
|
|||||||
let html;
|
let html;
|
||||||
var server;
|
var server;
|
||||||
|
|
||||||
|
|
||||||
function generateUUID() { // Public Domain/MIT
|
function generateUUID() { // Public Domain/MIT
|
||||||
var d = new Date().getTime();//Timestamp
|
var d = new Date().getTime();//Timestamp
|
||||||
var d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now()*1000)) || 0;//Time in microseconds since page-load or 0 if unsupported
|
var d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now()*1000)) || 0;//Time in microseconds since page-load or 0 if unsupported
|
||||||
@@ -65,13 +66,11 @@ window.onload = () => {
|
|||||||
} else if(window.serverOnline == "openHomeTrue") {
|
} else if(window.serverOnline == "openHomeTrue") {
|
||||||
window.getAuthinfo();
|
window.getAuthinfo();
|
||||||
} else if (window.serverOnline == "serverOffline") {
|
} else if (window.serverOnline == "serverOffline") {
|
||||||
console.log("s24oi")
|
|
||||||
emitter.emit("server-url", "offline");
|
emitter.emit("server-url", "offline");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
emitter.on("get-server", async () => {
|
emitter.on("get-server", async () => {
|
||||||
console.log('sw')
|
|
||||||
window.getServer();
|
window.getServer();
|
||||||
});
|
});
|
||||||
document.querySelector(".loader").classList.add("hide");
|
document.querySelector(".loader").classList.add("hide");
|
||||||
@@ -137,7 +136,7 @@ const closeDialog = () => {
|
|||||||
const createAlert = (type, msg, page) => {
|
const createAlert = (type, msg, page) => {
|
||||||
html = `<div class="alert ${type}">
|
html = `<div class="alert ${type}">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="bi bi-exclamation-octagon"></i>
|
<span class="mdi mdi-alert-octagram-outline"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="msg">
|
<div class="msg">
|
||||||
${msg}
|
${msg}
|
||||||
@@ -157,7 +156,7 @@ const createDialog = (title, msg, btn, type, page) => {
|
|||||||
html = `<div class="dialog__cont">
|
html = `<div class="dialog__cont">
|
||||||
<div class="dialog ${type}">
|
<div class="dialog ${type}">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="bi bi-exclamation-octagon"></i>
|
<span class="mdi mdi-alert-octagram-outline"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
${title}
|
${title}
|
||||||
@@ -171,21 +170,29 @@ const createDialog = (title, msg, btn, type, page) => {
|
|||||||
document.querySelector(page).insertAdjacentHTML('beforeend', html);
|
document.querySelector(page).insertAdjacentHTML('beforeend', html);
|
||||||
if (btn == "yes__no") {
|
if (btn == "yes__no") {
|
||||||
html = `<div class="buttons">
|
html = `<div class="buttons">
|
||||||
<button class="clicky yes" onclick="sendClearDataRequest()">
|
<button class="mdc-button mdc-button--raised" onclick="sendClearDataRequest()">
|
||||||
<label>Yes</label>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Yes</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="clicky no" onclick="closeDialog()">
|
<button class="mdc-button mdc-button--raised" onclick="closeDialog()">
|
||||||
<label>No</label>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">No</span>
|
||||||
</button>
|
</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
||||||
} else if (btn == "remove__server") {
|
} else if (btn == "remove__server") {
|
||||||
html = `<div class="buttons">
|
html = `<div class="buttons">
|
||||||
<button class="clicky rem__serv" onclick="sendClearDataRequest()">
|
<button class="mdc-button mdc-button--raised" onclick="sendClearDataRequest()">
|
||||||
<label>Remove Server</label>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Remove Server</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="clicky reload" onclick="window.backend.restart()">
|
<button class="mdc-button mdc-button--raised" onclick="window.backend.restart()">
|
||||||
<label>Restart JellyPlayer</label>
|
<span class="mdc-button__ripple"></span>
|
||||||
|
<span class="mdc-button__focus-ring"></span>
|
||||||
|
<span class="mdc-button__label">Restart JellyPlayer</span>
|
||||||
</button>
|
</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
||||||
@@ -289,7 +296,6 @@ const sendAuthInfo = (userName, password, checkbox) => {
|
|||||||
Pw: password
|
Pw: password
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(authUser)
|
|
||||||
emitter.emit("logged-in", [window.server, userName, password ,authUser.data.AccessToken, `${base_token}, Token=${authUser.data.AccessToken}`, authUser.data.User.Id, authUser.data.User.Name, authUser.data]);
|
emitter.emit("logged-in", [window.server, userName, password ,authUser.data.AccessToken, `${base_token}, Token=${authUser.data.AccessToken}`, authUser.data.User.Id, authUser.data.User.Name, authUser.data]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
document.querySelector(".loader").classList.add("hide");
|
document.querySelector(".loader").classList.add("hide");
|
||||||
@@ -335,7 +341,6 @@ emitter.on("serverGo-true", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
emitter.on("server-url", (server) => {
|
emitter.on("server-url", (server) => {
|
||||||
console.log(server)
|
|
||||||
if (server == "offline") {
|
if (server == "offline") {
|
||||||
createDialog("Error", "Can't connect to Jellyfin server", "remove__server", "error", ".server");
|
createDialog("Error", "Can't connect to Jellyfin server", "remove__server", "error", ".server");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ const createCardGrid = (type, data, usrId, api) => {
|
|||||||
}
|
}
|
||||||
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"] .card__text__cont`).insertAdjacentHTML("beforeend", `<div class="card__text secondary">${item.ProductionYear}</div>`);
|
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"] .card__text__cont`).insertAdjacentHTML("beforeend", `<div class="card__text secondary">${item.ProductionYear}</div>`);
|
||||||
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"]`).classList.add("primary");
|
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"]`).classList.add("primary");
|
||||||
|
itmInfo = await api.getItem({
|
||||||
|
userId: usrId,
|
||||||
|
itemId: item.Id
|
||||||
|
});
|
||||||
|
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"]`).insertAdjacentHTML("beforeend", `<div class="card__info__cont"><div class="card__info__title">${itmInfo.data.Name}</div><div class="card__info__overview">${itmInfo.data.Overview}</div></div>`);
|
||||||
switch (item.Type) {
|
switch (item.Type) {
|
||||||
case "books":
|
case "books":
|
||||||
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"] .mdi`).classList.add("mdi-book-multiple-outline");
|
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"] .mdi`).classList.add("mdi-book-multiple-outline");
|
||||||
|
|||||||
Reference in new issue
Block a user