Start moving to material design components
This commit is contained in:
5 files changed
+946
-1400
No files matched your search
+53
-24
@@ -13,6 +13,59 @@
|
||||
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: transparent;
|
||||
position: fixed;
|
||||
@@ -120,30 +173,6 @@ button.clicky:active::after {
|
||||
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 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
||||
+32
-10
@@ -22,13 +22,15 @@
|
||||
<script type="module">
|
||||
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';
|
||||
window.decode = decode
|
||||
window.decode = decode;
|
||||
window.UserApi = UserApi;
|
||||
window.Configuration = Configuration;
|
||||
window.LibraryApi = LibraryApi;
|
||||
window.UserLibraryApi = UserLibraryApi;
|
||||
window.ItemsApi = ItemsApi;
|
||||
</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>
|
||||
<body>
|
||||
<main>
|
||||
@@ -56,12 +58,20 @@
|
||||
<object data="../../assets/logo.svg" type="image/svg+xml"></object>
|
||||
</div>
|
||||
<div class="form__cont">
|
||||
<div class="input">
|
||||
<input id="serverUrl" type="url" class="input__text server__url" onblur="setLabelPos(this)">
|
||||
<label for="serverUrl" class="input__label">Server Address</label>
|
||||
<div class="mdc-text-field mdc-text-field--outlined">
|
||||
<input type="text" class="mdc-text-field__input first-name-input server__url">
|
||||
<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>
|
||||
<button class="input__btn save__server clicky">
|
||||
<span class="btn__label">Save</span>
|
||||
<button class="mdc-button mdc-button--raised save__server">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Save</span>
|
||||
</button>
|
||||
<div class="info">
|
||||
<span class="mdi mdi-information-outline"></span>
|
||||
@@ -76,11 +86,15 @@
|
||||
<section class="page users hide">
|
||||
<h3 class="title__name">Users</h3>
|
||||
<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);">
|
||||
<span>Manual Login</span>
|
||||
<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 class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Manual login</span>
|
||||
</button>
|
||||
<button class="change__server clicky" onclick="changeServer('.users')">
|
||||
<span>Change Server</span>
|
||||
<button class="mdc-button mdc-button--raised" onclick="changeServer('.users')">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Change Server</span>
|
||||
</button>
|
||||
</section>
|
||||
<section class="page manual__login hide">
|
||||
@@ -90,6 +104,14 @@
|
||||
<section class="manual__input"></section>
|
||||
</section>
|
||||
</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/main.js" defer></script>
|
||||
</main>
|
||||
|
||||
+19
-14
@@ -5,6 +5,7 @@ const user__cont = document.querySelector('.users');
|
||||
let html;
|
||||
var server;
|
||||
|
||||
|
||||
function generateUUID() { // Public Domain/MIT
|
||||
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
|
||||
@@ -65,13 +66,11 @@ window.onload = () => {
|
||||
} else if(window.serverOnline == "openHomeTrue") {
|
||||
window.getAuthinfo();
|
||||
} else if (window.serverOnline == "serverOffline") {
|
||||
console.log("s24oi")
|
||||
emitter.emit("server-url", "offline");
|
||||
}
|
||||
|
||||
});
|
||||
emitter.on("get-server", async () => {
|
||||
console.log('sw')
|
||||
window.getServer();
|
||||
});
|
||||
document.querySelector(".loader").classList.add("hide");
|
||||
@@ -137,7 +136,7 @@ const closeDialog = () => {
|
||||
const createAlert = (type, msg, page) => {
|
||||
html = `<div class="alert ${type}">
|
||||
<div class="icon">
|
||||
<i class="bi bi-exclamation-octagon"></i>
|
||||
<span class="mdi mdi-alert-octagram-outline"></span>
|
||||
</div>
|
||||
<div class="msg">
|
||||
${msg}
|
||||
@@ -157,7 +156,7 @@ const createDialog = (title, msg, btn, type, page) => {
|
||||
html = `<div class="dialog__cont">
|
||||
<div class="dialog ${type}">
|
||||
<div class="icon">
|
||||
<i class="bi bi-exclamation-octagon"></i>
|
||||
<span class="mdi mdi-alert-octagram-outline"></span>
|
||||
</div>
|
||||
<div class="title">
|
||||
${title}
|
||||
@@ -171,21 +170,29 @@ const createDialog = (title, msg, btn, type, page) => {
|
||||
document.querySelector(page).insertAdjacentHTML('beforeend', html);
|
||||
if (btn == "yes__no") {
|
||||
html = `<div class="buttons">
|
||||
<button class="clicky yes" onclick="sendClearDataRequest()">
|
||||
<label>Yes</label>
|
||||
<button class="mdc-button mdc-button--raised" onclick="sendClearDataRequest()">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Yes</span>
|
||||
</button>
|
||||
<button class="clicky no" onclick="closeDialog()">
|
||||
<label>No</label>
|
||||
<button class="mdc-button mdc-button--raised" onclick="closeDialog()">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">No</span>
|
||||
</button>
|
||||
</div>`;
|
||||
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
||||
} else if (btn == "remove__server") {
|
||||
html = `<div class="buttons">
|
||||
<button class="clicky rem__serv" onclick="sendClearDataRequest()">
|
||||
<label>Remove Server</label>
|
||||
<button class="mdc-button mdc-button--raised" onclick="sendClearDataRequest()">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Remove Server</span>
|
||||
</button>
|
||||
<button class="clicky reload" onclick="window.backend.restart()">
|
||||
<label>Restart JellyPlayer</label>
|
||||
<button class="mdc-button mdc-button--raised" onclick="window.backend.restart()">
|
||||
<span class="mdc-button__ripple"></span>
|
||||
<span class="mdc-button__focus-ring"></span>
|
||||
<span class="mdc-button__label">Restart JellyPlayer</span>
|
||||
</button>
|
||||
</div>`;
|
||||
document.querySelector('.dialog').insertAdjacentHTML('beforeend', html);
|
||||
@@ -289,7 +296,6 @@ const sendAuthInfo = (userName, password, checkbox) => {
|
||||
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]);
|
||||
} catch (error) {
|
||||
document.querySelector(".loader").classList.add("hide");
|
||||
@@ -335,7 +341,6 @@ emitter.on("serverGo-true", () => {
|
||||
});
|
||||
});
|
||||
emitter.on("server-url", (server) => {
|
||||
console.log(server)
|
||||
if (server == "offline") {
|
||||
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)}"]`).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) {
|
||||
case "books":
|
||||
document.querySelector(`.${type.toLowerCase()} .card[data-index="${data.indexOf(item)}"] .mdi`).classList.add("mdi-book-multiple-outline");
|
||||
|
||||
Reference in new issue
Block a user