diff --git a/javascript/modules/ActionVerify.js b/javascript/modules/ActionVerify.js new file mode 100644 index 0000000..3ca89a1 --- /dev/null +++ b/javascript/modules/ActionVerify.js @@ -0,0 +1,124 @@ +import { WindowManagement } from "./Windows.js"; + +const WindowVerify = { + init: function () { + + }, + anim: { + hided: () => { + $(`.window-verify-action`).remove(); + + } + }, + show: () => { + $('body').css('overflow', 'hidden'); + }, + hide: () => { + $('body').css('overflow', ''); + }, + verif: () => { return true; } +} + + + +export function CreateVerify() { + return new Promise((resolve) => { + const id = Math.random().toString(19).slice(2); + $('body').append(GenVerify(id)); + const wm = new WindowManagement(WindowVerify, '.window-verify-action'); + + const pin = $(`#pin-${id}`); + const swipeText = $(`#swipeText-${id}`); + let isDragging = false; + let callbackCalled = false; + + pin.on('mousedown touchstart', function (event) { + isDragging = true; + callbackCalled = false; + }); + + $(document).on('mousemove touchmove', function (event) { + if (isDragging && !callbackCalled) { + const pinWidth = pin.width(); + const swipeWidth = pin.parent().width() - pinWidth; + let touchX = event.clientX; + if (event.originalEvent.touches) + touchX = event.originalEvent.touches[0].clientX; + const containerLeft = pin.parent().offset().left; + + if (touchX - containerLeft >= swipeWidth) { + pin.css('transform', `translateX(${swipeWidth}px)`); + swipeText.text('Подтверждено!'); + callbackCalled = true; + } else { + const translateX = touchX - containerLeft - pinWidth / 2; + pin.css('transform', `translateX(${translateX}px)`); + swipeText.text('Проведите вправо'); + callbackCalled = false; + } + } + }); + + $(document).on('mouseup touchend', function () { + if (isDragging) { + isDragging = false; + pin.css('transform', ''); + + // Проверяем, было ли подтверждение действия + if (callbackCalled) { + wm.hide(); + WindowVerify.hide(); + resolve(true); + } + + swipeText.text('Проведите вправо'); + } + }); + + $(`#cancel-${id}`).on('click', function () { + wm.hide(); + WindowVerify.hide(); + throw new Error(`Отмена действия`); + }); + + wm.click(); + }); +} + +function GenVerify(id, warning = 'Внимание! Проподут выборы озвучек, история просмотра, история поиска, параметры и т.д.') { + return ` + + + + +
+ + + +
+ +
+
+
`; +} + +$('head').append(``); \ No newline at end of file diff --git a/javascript/modules/TunimeApi.js b/javascript/modules/TunimeApi.js index 56c16c1..b518653 100644 --- a/javascript/modules/TunimeApi.js +++ b/javascript/modules/TunimeApi.js @@ -38,7 +38,7 @@ class Server { } this.#id = id; this.#url = url; - sessionStorage.setItem(this.#key, JSON.stringify({id: this.#id, url: this.#url})); + sessionStorage.setItem(this.#key, JSON.stringify({ id: this.#id, url: this.#url })); } } @@ -261,22 +261,24 @@ export const Tunime = { }, SET: (tid) => { - let responseCode = 503; - const body = { key: access.key, id: access.id, tid }; - Fetch(`/voices/${aid}`, { method: 'POST', headers, body }).then((response) => { - responseCode = response.status; - response.json().then((value) => { - return resolve(value); + return new Promise((resolve) => { + let responseCode = 503; + const body = { key: access.key, id: access.id, tid }; + Fetch(`/voices/${aid}`, { method: 'POST', headers, body }).then((response) => { + responseCode = response.status; + response.json().then((value) => { + return resolve(value); + }); + }).catch(async (reason) => { + console.log(`[api] - Error: ${Tunime.server.url} Code: ${responseCode}\n${reason}`); + if (responseCode == 503) { + return; + // URL = `onrender.com`; + // return resolve(this.Voices(aid, access).SET(tid)); + } + await Sleep(1000); + return resolve(this.Voices(aid, access).SET(tid)); }); - }).catch(async (reason) => { - console.log(`[api] - Error: ${Tunime.server.url} Code: ${responseCode}\n${reason}`); - if (responseCode == 503) { - return; - // URL = `onrender.com`; - // return resolve(this.Voices(aid, access).SET(tid)); - } - await Sleep(1000); - return resolve(this.Voices(aid, access).SET(tid)); }); } } diff --git a/javascript/modules/Windows.js b/javascript/modules/Windows.js index 1354a0f..eb29562 100644 --- a/javascript/modules/Windows.js +++ b/javascript/modules/Windows.js @@ -27,9 +27,9 @@ export class WindowManagement { this.authorized = authorized; } - click() { + click(title = "Вы должны авторизоваться!") { if (!this.target.verif()) { - ShowInfo("Вы должны авторизоваться!", "auth"); + ShowInfo(title, "auth"); return; } this.show(); diff --git a/javascript/pages/settings.js b/javascript/pages/settings.js index 3565dcf..b131543 100644 --- a/javascript/pages/settings.js +++ b/javascript/pages/settings.js @@ -2,6 +2,7 @@ import { InitMenu, Menu } from "../menu.js"; import { Users } from "../modules/ShikiAPI.js"; import { Main, User } from "../modules/ShikiUSR.js"; import { ShowMoreSelect, ShowSelect } from "./settings/mod_select.js"; +import { ShowStorage, Storage } from "./settings/mod_storage.js"; const Parameters = [ { @@ -18,6 +19,10 @@ const Parameters = [ param: 'autologin', name: 'Автоматический вход', description: 'Моментальная авторизация пользователей.' + }, + { + type: 'app-size', + name: 'Хранилище' } ] }, @@ -296,6 +301,7 @@ function _ShowParametrs() { eventBoolean(); eventSelectOne(); eventSelectMore(); + eventAppStorage(); function __loadParametrs(parametrs) { let html = ""; @@ -325,6 +331,17 @@ function _ShowParametrs() {
${element.variation.length}
` break; + case "app-size": + let s = Storage.size(), d = 'KB'; + if (s > 1000) { + d = 'MB'; + s = (s / 1000).toFixed(2); + } + html += `` + break; default: break; } @@ -374,6 +391,12 @@ function eventSelectMore() { }); } +function eventAppStorage() { + $('label[data-type="app-size"]').click(function () { + ShowStorage(); + }); +} + /** * Рекурсивно выводит в консоль все ключи и значения объекта, кроме вложенных объектов. * diff --git a/javascript/pages/settings/mod_storage.js b/javascript/pages/settings/mod_storage.js new file mode 100644 index 0000000..0058191 --- /dev/null +++ b/javascript/pages/settings/mod_storage.js @@ -0,0 +1,146 @@ +import { CreateVerify } from "../../modules/ActionVerify.js"; +import { WindowManagement } from "../../modules/Windows.js"; + +const exception = ['tunime-id', 'application_installed']; + +const WindowStorage = { + init: function () { + $('.window-bar > .window-close').on('click', () => { + _windowStorage.hide(); + }); + $('.button-clear-app').on('click', () => { + CreateVerify().then((val) => { + for (const key in localStorage) { + if (exception.includes(key)) { + continue; + } + localStorage.removeItem(key); + } + for (const key in sessionStorage) { + if (exception.includes(key)) { + continue; + } + sessionStorage.removeItem(key); + } + if (localStorage.getItem('application_installed')) { + const data = JSON.parse(localStorage.getItem('application_installed')); + if (data.installed) { + document.location.replace('/?mode=standalone'); + } + } + document.location.replace('/'); + }).catch((reason) => { + + }); + }); + }, + show: () => { + }, + anim: { + showed: () => { + + }, + hided: () => { + $('.list-local-storage').empty(); + $('.list-session-storage').empty(); + } + }, + hide: () => { }, + verif: () => { return true; } +} + +const _windowStorage = new WindowManagement(WindowStorage, '.window-app-size'); + +export function ShowStorage(title = "Хранилище") { + $('.select-bar > .window-title').text(title); + let d = 'KB', s = Storage.Local.size(); + if (s > 1000) { + d = 'MB'; + s = (s / 1000).toFixed(2); + } + $("#locdata > span").text(`${s} ${d}`); + d = 'KB', s = Storage.Session.size(); + if (s > 1000) { + d = 'MB'; + s = (s / 1000).toFixed(2); + } + $("#sesdata > span").text(`${Storage.Session.size()} KB`); + + let _xLen, _x; + for (_x in localStorage) { + if (!localStorage.hasOwnProperty(_x)) { + continue; + } + let d = 'KB'; + _xLen = (((localStorage[_x].length + _x.length) * 2) / 1024).toFixed(2); + if (_xLen > 1000) { + d = 'MB'; + _xLen = (_xLen / 1000).toFixed(2); + } + $('.list-local-storage').append(`
${_x}
${_xLen} ${d}
`); + } + for (_x in sessionStorage) { + if (!sessionStorage.hasOwnProperty(_x)) { + continue; + } + let d = 'KB'; + _xLen = (((sessionStorage[_x].length + _x.length) * 2) / 1024).toFixed(2); + if (_xLen > 1000) { + d = 'MB'; + _xLen = (_xLen / 1000).toFixed(2); + } + $('.list-session-storage').append(`
${_x}
${_xLen} ${d}
`); + } + _windowStorage.click(); +} + +export const Storage = { + Local: { + size: function () { + var _lsTotal = 0, + _xLen, _x; + for (_x in localStorage) { + if (!localStorage.hasOwnProperty(_x)) { + continue; + } + _xLen = ((localStorage[_x].length + _x.length) * 2); + _lsTotal += _xLen; + }; + return (_lsTotal / 1024).toFixed(2); + } + }, + Session: { + size: function () { + var _lsTotal = 0, + _xLen, _x; + for (_x in sessionStorage) { + if (!sessionStorage.hasOwnProperty(_x)) { + continue; + } + _xLen = ((sessionStorage[_x].length + _x.length) * 2); + _lsTotal += _xLen; + }; + return (_lsTotal / 1024).toFixed(2); + } + }, + + size: function () { + var _lsTotal = 0, + _xLen, _x; + for (_x in localStorage) { + if (!localStorage.hasOwnProperty(_x)) { + continue; + } + _xLen = ((localStorage[_x].length + _x.length) * 2); + _lsTotal += _xLen; + }; + for (_x in sessionStorage) { + if (!sessionStorage.hasOwnProperty(_x)) { + continue; + } + _xLen = ((sessionStorage[_x].length + _x.length) * 2); + _lsTotal += _xLen; + }; + return (_lsTotal / 1024).toFixed(2); + } +} \ No newline at end of file diff --git a/javascript/pages/watch.js b/javascript/pages/watch.js index 52aab7b..9ed34d6 100644 --- a/javascript/pages/watch.js +++ b/javascript/pages/watch.js @@ -22,7 +22,7 @@ Main(async (e) => { //Проверка на существование такого ID const check = await CheckID($ID); - if (check.length == 0) { + if (!check) { //Аниме с такий ID не существует, перекидываем на страницу 404 return document.location.replace('404a.html'); } diff --git a/javascript/pages/watch/mod_download.js b/javascript/pages/watch/mod_download.js index db094a5..00a6244 100644 --- a/javascript/pages/watch/mod_download.js +++ b/javascript/pages/watch/mod_download.js @@ -372,4 +372,4 @@ const WindowDownload = { const _windowDownload = new WindowManagement(WindowDownload, '.window-download'); -export const ShowDwonloadWindow = () => { _windowDownload.click(); } \ No newline at end of file +export const ShowDwonloadWindow = () => { _windowDownload.click("Не доступно!"); } \ No newline at end of file diff --git a/javascript/pages/watch/mod_player.js b/javascript/pages/watch/mod_player.js index 7236a97..863343c 100644 --- a/javascript/pages/watch/mod_player.js +++ b/javascript/pages/watch/mod_player.js @@ -119,7 +119,13 @@ const player = { this.name = data.translation.title;//Название озвучки $(".current-translation > span").text(data.translation.title); //Title translation - $(".count-current-translation").text(data.last_episode); //Last episode translation + if (data.last_episode) { + $(".count-current-translation").text(data.last_episode); //Last episode translation + } else if (data) { + $(".count-current-translation").text('1'); + $("#episodes").addClass('hide'); + } + $(element).addClass("select"); //Проверяем что выбранная озвучка в избранном diff --git a/javascript/pages/watch/mod_resource.js b/javascript/pages/watch/mod_resource.js index 9192ab0..c1307fc 100644 --- a/javascript/pages/watch/mod_resource.js +++ b/javascript/pages/watch/mod_resource.js @@ -5,81 +5,71 @@ import { Sleep } from "../../modules/funcitons.js"; import { $ID } from "../watch.js"; import { UserRate } from "./mod_urate.js"; import { LoadScreen } from "./mod_load.js"; +import { History } from "./mod_history.js"; export let Screenshots = undefined; -export function LoadImageById(id) { - if (Screenshots.length - 1 < id) { - return; - } - $(`.galery-slider > .slide[data-id="${id}"]`).append( - `` - ); -} - -/** - * Проверка на существование ID в бд Shikimori - * @param {string} id - * @returns - */ -export function CheckID(id) { - return new Promise((resolve) => { - GraphQl.animes({ ids: `"${id}"`, limit: 1 }, async (response) => { - if (response.failed) { - if (response.status == 429) { - await Sleep(1000); - return resolve(CheckID(id)); - } - } - if (response.errors) { - console.log(`[GraphQl] Error`); - console.log(response.errors); - } - return resolve(response.data.animes); - }).POST(["id"]); - }); -} - /** * Загружает аниме на сайт * @param {Function} e Событие после загрузки аниме * @param {boolean} isLogged Авотризован ли пользователь */ export async function LoadAnime(e = () => { }, isLogged = false) { - const start = Date.now(); - const progress = new LoadScreen(9); + const start = Date.now(), + progress = new LoadScreen(9), + process = []; + let posterLink = undefined, + jikanLoaded = false; + try { progress.Step(); - const anime = await FetchAnime($ID); - UserRate().init(anime.user_rate, isLogged); + process.push(new Promise(async (resolve) => { + const anime = await FetchAnime($ID); + progress.Step(); + UserRate().init(anime.user_rate, isLogged); + if (posterLink === undefined) { + posterLink = `${SHIKIURL.url}/${anime.image.original}`; + if (jikanLoaded) { + process.push(LoadPoster(posterLink)); + } + } - let poster = await ImageJikan($ID); - progress.Step(); - poster = await LoadImage(poster); - progress.Step(); - SetPosterTR(poster, anime); - Genres(anime); - Duration(anime); - Status(anime); - NextEpisode(anime); - Description(anime); - Studio(anime); - - PageTitle(anime); - PageMetaTags(anime); - progress.Step(); + SetTitle(anime); + Genres(anime); + Duration(anime); + Status(anime); + NextEpisode(anime); + Description(anime); + Studio(anime); + PageTitle(anime); + PageMetaTags(anime); + + resolve(true); + })); + + process.push(new Promise(async (resolve) => { + const poster = await ImageJikan($ID); + if (poster) { + process.push(LoadPoster(poster)); + } + jikanLoaded = true; + progress.Step(); - await Gallery($ID); - progress.Step(); + resolve(true); + })); + + process.push(Gallery($ID)); if (!$PARAMETERS.anime.hidehero) - await Heroes($ID); - progress.Step(); + process.push(Heroes($ID)); - await Franchise($ID); - progress.Step(); - await Similiar($ID); - progress.Step(); + process.push(Franchise($ID)); + process.push(Similiar($ID)); + + for (let i = 0; i < process.length; i++) { + await process[i]; + progress.Step(); + } e(anime); } catch (error) { @@ -87,10 +77,31 @@ export async function LoadAnime(e = () => { }, isLogged = false) { } console.log(`Loaded: ${Date.now() - start}ms`); + /** + * Загрузка изобюражения + */ + function LoadPoster(url) { + return new Promise((resolve) => { + const mainImg = $(".preview-wrapper > .main"); + const bgImg = $(".bg-wrapper > .bg"); + mainImg.on('load', function () { + bgImg.attr("src", url); + resolve(true); + }); + mainImg.attr("src", url); + }); + } + /** * Загрузка похожих аниме */ function Similiar(id) { + let response = Cache.Get({ id, type: 'similiar' }); + + if (response) { + return Complete(response); + } + return new Promise((resolve) => { Animes.similar(id, async (response) => { if (response.failed && response.status == 429) { @@ -104,20 +115,31 @@ export async function LoadAnime(e = () => { }, isLogged = false) { return; } - $(".similiar-count").text(response.length); - if (response.length > 0) { - $(".similiar-title , .similiar-anime").css("display", ""); - } - for (let i = 0; i < response.length; i++) { - const element = response[i]; - $(".similiar-anime").append(ACard.Gen({ link: true, id: element.id, response: element })); - } - return resolve(true); + Cache.Set({ id, type: 'similiar', value: response }); + return resolve(Complete(response)); }).GET(); }); + + function Complete(response) { + $(".similiar-count").text(response.length); + if (response.length > 0) { + $(".similiar-title , .similiar-anime").css("display", ""); + } + for (let i = 0; i < response.length; i++) { + const element = response[i]; + $(".similiar-anime").append(ACard.Gen({ link: true, id: element.id, response: element })); + } + return true; + } } async function Franchise(id) { + let response = Cache.Get({ id, type: 'franchise' }); + + if (response) { + return Complete(response); + } + return new Promise((resolve) => { Animes.franchise(id, async (response) => { if (response.failed && response.status == 429) { @@ -131,66 +153,78 @@ export async function LoadAnime(e = () => { }, isLogged = false) { return; } - //Проверяем если есть у нас фрашиза - if (response.nodes) { - //Отоброжаем блок с франшизой - for (let i = 0; i < response.nodes.length; i++) { - const element = response.nodes[i]; // Обьект с франшизой - - //Изначально франшизы скрыты, но после добавления отображаются - - //Отбираем франшизы по правилам пользователя - if ($PARAMETERS.watch.typefrc.indexOf(element.kind) == -1) { - continue; - } - - //Создаем елемент - const html = `
${element.name - }
${element.kind - }
${element.year}
`; - - //Добавляем елемент - $(".franchisa-anime").append(html); - //Отображаем франщизы - $(".franchise-title, .franchisa-anime").css("display", ""); + Cache.Set({ id, type: 'franchise', value: response }); + + return resolve(Complete(response)); + }).GET(); + }); + + function Complete(response) { + //Проверяем если есть у нас фрашиза + if (response.nodes) { + //Отоброжаем блок с франшизой + for (let i = 0; i < response.nodes.length; i++) { + const element = response.nodes[i]; // Обьект с франшизой + + //Изначально франшизы скрыты, но после добавления отображаются + + //Отбираем франшизы по правилам пользователя + if ($PARAMETERS.watch.typefrc.indexOf(element.kind) == -1) { + continue; } - //Событие нажатие - $(".franchisa-anime > a").click((e) => { - //Перенаправляем пользователя без истории - window.location.replace( - "watch.html?id=" + $(e.currentTarget).data("id") - ); - }); - } + //Создаем елемент + const html = `
${element.name + }
${element.kind + }
${element.year}
`; - if ( - $PARAMETERS.watch.dubanime && - response.nodes && - response.nodes.length > 0 - ) { - response.nodes.forEach((element) => { - let data = JSON.parse( - localStorage.getItem("save-translations-" + element.id) - ); - if (data && element.id != $ID) { - data.forEach((element) => { - $(`.translations--list--element--count-save--save[data-id="${element}"] > svg`).css("fill", "yellow"); - }); - } - }); + //Добавляем елемент + $(".franchisa-anime").append(html); + //Отображаем франщизы + $(".franchise-title, .franchisa-anime").css("display", ""); } - return resolve(true); - }).GET(); - }); + //Событие нажатие + $(".franchisa-anime > a").click((e) => { + //Перенаправляем пользователя без истории + window.location.replace( + "watch.html?id=" + $(e.currentTarget).data("id") + ); + }); + } + + if ( + $PARAMETERS.watch.dubanime && + response.nodes && + response.nodes.length > 0 + ) { + response.nodes.forEach((element) => { + let data = JSON.parse( + localStorage.getItem("save-translations-" + element.id) + ); + if (data && element.id != $ID) { + data.forEach((element) => { + $(`.translations--list--element--count-save--save[data-id="${element}"] > svg`).css("fill", "yellow"); + }); + } + }); + } + + return true; + } } /** * Устанавливает главных героев аниме */ function Heroes(id) { + let response = Cache.Get({ id, type: 'heroes' }); + + if (response) { + return Complete(response); + } + return new Promise((resolve) => { Animes.roles(id, async (response) => { if (response.failed && response.status == 429) { @@ -204,22 +238,33 @@ export async function LoadAnime(e = () => { }, isLogged = false) { return; } - for (let i = 0; i < response.length; i++) { - const element = response[i]; - if (element.roles.includes('Main')) { - $('.hero-anime, .hero-anime-title').css('display', ''); - $('.hero-anime > .val').append(`
${element.character.russian}
`); - } - } - return resolve(true); + Cache.Set({ id, type: 'heroes', value: response }); + return resolve(Complete(response)); }).GET(); }); + + function Complete(response) { + for (let i = 0; i < response.length; i++) { + const element = response[i]; + if (element.roles.includes('Main')) { + $('.hero-anime, .hero-anime-title').css('display', ''); + $('.hero-anime > .val').append(`
${element.character.russian}
`); + } + } + return true; + } } /** * Устанавливает галерею */ function Gallery(id) { + let response = Cache.Get({ id, type: 'gallery' }); + + if (response) { + return Complete(response); + } + return new Promise((resolve) => { Animes.screenshots(id, async (response) => { if (response.failed && response.status == 429) { @@ -232,29 +277,35 @@ export async function LoadAnime(e = () => { }, isLogged = false) { console.log(response); return resolve(false); } - if (response.length == 0) { - $(".title-gallery").css("display", "none"); - } - /**@type {[{original:string, preview:string}]} */ - Screenshots = response; - - for (let i = 0; i < response.length; i++) { - const img = response[i]; - if (i < 3) { - $(".galery-slider").append( - `
` - ); - } else { - $(".galery-slider").append( - `
` - ); - } - } - - return resolve(true); + Cache.Set({ id, type: 'gallery', value: response }); + return resolve(Complete(response)); }).GET(); }); + + function Complete(response) { + if (response.length == 0) { + $(".title-gallery").css("display", "none"); + } + + /**@type {[{original:string, preview:string}]} */ + Screenshots = response; + + for (let i = 0; i < response.length; i++) { + const img = response[i]; + if (i < 3) { + $(".galery-slider").append( + `
` + ); + } else { + $(".galery-slider").append( + `
` + ); + } + } + History().custom.init(); + return true; + } } /** @@ -382,9 +433,7 @@ export async function LoadAnime(e = () => { }, isLogged = false) { } - function SetPosterTR(url, data) { - $(".bg-wrapper > .bg").attr("src", url); - $(".preview-wrapper > .main").attr("src", url); + function SetTitle(data) { $(".title-with-raiting > .title > .russian").text(data.russian); $(".title-with-raiting > .title > .name").text(data.name); $(".title-with-raiting > .raiting > span").text(data.score); @@ -393,29 +442,18 @@ export async function LoadAnime(e = () => { }, isLogged = false) { function ImageJikan(id) { return new Promise((resolve) => { fetch(`https://api.jikan.moe/v4/anime/${id}/full`).then(async (response) => { - if (response.status != 200) { - return resolve(shikiData.poster.originalUrl); - } + if (response.status != 200) + return resolve(posterLink); + let data = await response.json(); - resolve(data.data.images.webp.large_image_url); + posterLink = data.data.images.webp.large_image_url; + return resolve(posterLink); + }).catch(async (reason) => { + return resolve(posterLink) }); }); } - function LoadImage(url) { - return new Promise((resolve) => { - const img = new Image(); - img.onload = () => { - return resolve(url); - } - img.onerror = (e) => { - console.log(e); - return resolve(shikiData.poster.originalUrl); - } - img.src = url; - }); - } - /** * Загружает данные аниме * @param {string} id индентификатор аниме @@ -436,6 +474,45 @@ export async function LoadAnime(e = () => { }, isLogged = false) { } } +export function LoadImageById(id) { + if (Screenshots.length - 1 < id) { + return; + } + $(`.galery-slider > .slide[data-id="${id}"]`).append( + `` + ); +} + +/** + * Проверка на существование ID в бд Shikimori + * @param {string} id + * @returns {boolean} + */ +export function CheckID(id) { + if (Cache.Get({ id, type: 'isset' })) { + return true; + } + return new Promise((resolve) => { + GraphQl.animes({ ids: `"${id}"`, limit: 1 }, async (response) => { + if (response.failed) { + if (response.status == 429) { + await Sleep(1000); + return resolve(CheckID(id)); + } + } + if (response.errors) { + console.log(`[GraphQl] Error`); + console.log(response.errors); + } + if (response.data.animes.length !== 0) { + Cache.Set({ id: id, type: 'isset', value: true }); + return resolve(true); + } + return resolve(false); + }).POST(["id"]); + }); +} + function StatusToString(status) { switch (status) { case "anons": @@ -466,4 +543,70 @@ function RatingToString(rating) { default: return "UNDF"; } +} + +class Cache { + static #loaded = false; + static #sessionData = null; + static #length = 10; + static #key = 'cache-ae'; + + /** + * Получает определнный кэш страницы + * @param {{id: string, type: 'isset' | 'similiar' | 'franchise' | 'heroes' | 'gallery'}} param0 + * @returns {null | object} + */ + static Get({ id, type } = {}) { + if (this.#sessionData === null && this.#loaded) + return null; + + if (!this.#loaded) { + /** + * @type {null | [{id: string}]} + */ + let data = JSON.parse(sessionStorage.getItem(this.#key)) || []; + const index = data.findIndex(x => x.id === id); + this.#loaded = true; + + if (data.length === 0 || index === -1) { + return null; + } + + this.#sessionData = data[index]; + } + + if (!this.#sessionData[type]) + return null; + return this.#sessionData[type]; + } + + /** + * Устанавливает кэш страницы + * @param {{id: string, type: 'isset' | 'similiar' | 'franchise' | 'heroes' | 'gallery', value: object}} param0 + */ + static Set({ id, type, value } = {}) { + /** + * @type {null | [{id: string}]} + */ + let list = JSON.parse(sessionStorage.getItem(this.#key)) || []; + const index = list.findIndex(x => x.id === id); + if (index === -1 && list.length >= this.#length) { + list.splice(list.length - 1, 1); + } + + let data = { + id: id + }; + + if (index !== -1) { + data = list[index]; + list.splice(index, 1); + } + + data[type] = value; + list.unshift(data); + + sessionStorage.setItem(this.#key, JSON.stringify(list)); + } + } \ No newline at end of file diff --git a/javascript/pages/watch/mod_sdata.js b/javascript/pages/watch/mod_sdata.js index a338e05..07558fc 100644 --- a/javascript/pages/watch/mod_sdata.js +++ b/javascript/pages/watch/mod_sdata.js @@ -137,10 +137,10 @@ export function SaveLData(e, d) { user_rate.text = user_rate.text.replace(match[0], ''); } - // user_rate.text = ""; - if (user_rate.text) { user_rate.text = user_rate.text.trim(); + } else { + user_rate.text = ""; } user_rate.text += `\r\n[tunime-sync:${data.kodik_episode}:${data.kodik_dub}:${JSON.stringify(data.date_update)}]`; diff --git a/javascript/parametrs.js b/javascript/parametrs.js index 5020e64..8df805d 100644 --- a/javascript/parametrs.js +++ b/javascript/parametrs.js @@ -25,7 +25,7 @@ const $PARAMETERS = { player: { quality: '720', standart: false, - full: true, + full: false, alternative_full: false, standart_controls: false, autonekst: false, diff --git a/settings.html b/settings.html index bbaab97..770547f 100644 --- a/settings.html +++ b/settings.html @@ -108,6 +108,37 @@ + + + + + +
+
Хранилище
+
+ + + + +
+
+ +
+
Локальное хранилище 0 B
+
+
+
Cессионное хранилище 0 B
+
+
+
+ + +
+
+
diff --git a/simons.js b/simons.js deleted file mode 100644 index 2cce033..0000000 --- a/simons.js +++ /dev/null @@ -1,296 +0,0 @@ -async function simonmain() { - simonglitch(); -} - -async function simonglitch() { - const s = sessionStorage.getItem('simons'); - if (window.location.pathname == '/' && !s || window.location.pathname == '/index.html' && !s) { - document.addEventListener("DOMContentLoaded", async function () { - // Create a new div element - const div = document.createElement("div"); - - // Set the id attribute of the div to "simons" - div.id = "simons"; - - // Set the CSS styles for the div - div.style.position = "fixed"; - div.style.top = "0"; - div.style.left = "0"; - div.style.right = "0"; - div.style.bottom = "0"; - div.style.zIndex = "999"; - div.style.pointerEvents = "all"; - - // Append the div to the body of the HTML document - document.body.appendChild(div); - document.body.style.overflowX = "hidden"; - - await simonsleep(5000); - - const bg = document.getElementById('simons'); - const count = 20; - for (let i = 0; i < count; i++) { - let glitchBox = document.createElement("div"); - glitchBox.className = 'simons-box'; - glitchBox.style.position = "absolute"; - bg.appendChild(glitchBox); - } - - const glitch = document.getElementsByClassName('simons-box'); - const colors = ["#FF0000", "#00FF00", "#0000FF"]; - const colorProbability = 0.6; - - let completed = 0; - - const interval = setInterval(function () { - // Select all img elements on the page - var imgElements = document.getElementsByTagName('img'); - - // Create an array to store the src attributes of all img elements - var imgSrcs = []; - - // Loop through all img elements and store their src attributes in the array - for (let i = 0; i < imgElements.length; i++) { - imgSrcs.push(imgElements[i].src); - } - for (let i = 0; i < glitch.length; i++) { - glitch[i].style.left = Math.floor(Math.random() * 100) + 'vw'; - glitch[i].style.top = Math.floor(Math.random() * 100) + 'vh'; - glitch[i].style.width = Math.floor(Math.random() * 400) + 'px'; - glitch[i].style.height = Math.floor(Math.random() * 100) + 'px'; - var isColor = Math.random() < colorProbability; - - if (isColor) { - // Select a random color from the colors array - var randomColorIndex = Math.floor(Math.random() * colors.length); - - // Set the background color of the glitch element to the randomly selected color - glitch[i].style.backgroundColor = colors[randomColorIndex]; - glitch[i].style.backgroundImage = ''; // Clear background image - } else { - if (imgSrcs.length > 0) { - // Select a random index from the imgSrcs array - var randomIndex = Math.floor(Math.random() * imgSrcs.length); - - // Set the background image of the glitch element to the randomly selected src - glitch[i].style.backgroundImage = `url(${imgSrcs[randomIndex]})`; - glitch[i].style.backgroundSize = 'cover'; // Set background size to cover - glitch[i].style.width = '100%'; // Set width to 100% - } else { - // If no images are available, set a background color instead - var randomColorIndex = Math.floor(Math.random() * colors.length); - glitch[i].style.backgroundColor = colors[randomColorIndex]; - glitch[i].style.backgroundImage = ''; // Clear background image - } - } - } - const h = document.getElementsByTagName('header'); - h[0].style.transform = `translate(${Math.floor(Math.random() * -50)}px, ${Math.floor(Math.random() * 50)}px)`; - const j = document.getElementsByClassName('swiper-horizontal'); - const k = document.getElementsByClassName('section-title'); - const l = document.getElementsByClassName('genres'); - const a = document.getElementsByClassName('card-anime'); - const s = document.getElementsByClassName('btn-menu'); - const d = document.getElementsByClassName('application-menu'); - const f = document.getElementsByTagName('input'); - const g = document.getElementsByTagName('span'); - for (let i = 0; i < j.length; i++) { - j[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < k.length; i++) { - k[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < l.length; i++) { - l[i].style.transform = `translate(${Math.floor(Math.random() * 20) - 10}px, ${Math.floor(Math.random() * 20) - 10}px)`; - } - for (let i = 0; i < a.length; i++) { - a[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < s.length; i++) { - s[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < d.length; i++) { - d[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < f.length; i++) { - f[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - for (let i = 0; i < g.length; i++) { - g[i].style.transform = `translate(${Math.floor(Math.random() * 100) - 50}px, ${Math.floor(Math.random() * 100) - 50}px)`; - } - - completed++; - - if (completed > 8) { - clearInterval(interval); - div.parentNode.removeChild(div); - h[0].style.transform = ``; - for (let i = 0; i < j.length; i++) { - j[i].style.transform = ``; - } - for (let i = 0; i < k.length; i++) { - k[i].style.transform = ``; - } - for (let i = 0; i < l.length; i++) { - l[i].style.transform = ``; - } - for (let i = 0; i < a.length; i++) { - a[i].style.transform = ``; - } - for (let i = 0; i < s.length; i++) { - s[i].style.transform = ``; - } - for (let i = 0; i < d.length; i++) { - d[i].style.transform = ``; - } - for (let i = 0; i < f.length; i++) { - f[i].style.transform = ``; - } - for (let i = 0; i < g.length; i++) { - g[i].style.transform = ``; - } - } - - sessionStorage.setItem('simons', true); - }, 50); - }); - } -} - -function simonscat_py() { - if (window.location.pathname == '/watch.html') { - document.addEventListener("DOMContentLoaded", function () { - const inner = document.getElementsByClassName('loader'); - for (let i = 0; i < inner.length; i++) { - const element = inner[i]; - element.parentNode.removeChild(element); - } - const img = document.createElement("img"); - img.src = "https://github.com/AN0NCER/resources/blob/main/simons/wartet.gif?raw=true"; - img.style.position = 'absolute'; - img.width = '250'; - img.style.left = 'calc(50% - 250px / 2)'; - img.style.top = 'calc(50% - 250px / 2)' - document.getElementsByClassName('page-loading')[0].appendChild(img); - - // Создаем элемент - var link = document.createElement("a"); - link.href = "https://www.youtube.com/@SimonsCat"; - link.style.display = "flex"; - link.style.justifyContent = "center"; - link.style.alignItems = "center"; - link.style.background = "#e5e8ef"; - - // Создаем элемент - var image = document.createElement("img"); - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/hero.gif?raw=true"; - image.style.position = "initial"; - - // Создаем элемент
для класса "hero" - var heroDiv = document.createElement("div"); - heroDiv.className = "hero"; - - // Создаем элемент
для класса "name" - var nameDiv = document.createElement("div"); - nameDiv.className = "name"; - nameDiv.innerText = "Кот Саймона"; - - // Добавляем элементы в нужном порядке - heroDiv.appendChild(nameDiv); - link.appendChild(image); - link.appendChild(heroDiv); - document.querySelector('.hero-anime > .val').appendChild(link); - - image = document.createElement("img"); - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/schlafe.gif?raw=true"; - image.style.position = "absolute"; - image.style.width = "140px"; - image.style.right = "10%"; - image.style.zIndex = "2"; - - image.style.top = "calc(140px / 2 * -1 + -7px)"; - heroDiv = document.createElement("div"); - heroDiv.style.position = "relative" - heroDiv.appendChild(image); - document.querySelector('.player').appendChild(heroDiv); - - var parent = document.querySelector('.franchisa-anime > a:first-child'); - if (parent != null) { - image = document.createElement("img"); - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/schlafe.gif?raw=true"; - image.style.zIndex = "2"; - parent.append(image); - } - - waitForElm('.franchisa-anime > a').then((elm) => { - var parent = document.querySelector('.franchisa-anime > a:first-child'); - if (parent != null) { - image = document.createElement("img"); - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/cooc.gif?raw=true"; - image.style.position = "absolute"; - image.style.width = "105px"; - image.style.right = "10px"; - image.style.top = "7px"; - parent.append(image); - parent = document.querySelector('.franchisa-anime'); - if (parent != null) { - parent.style.overflowY = "hidden"; - } - } - }); - image = document.createElement("img"); - image.style.position = "absolute"; - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/interesant.gif?raw=true"; - - image.style.width = "106px"; - image.style.right = "calc(50% - 106px / 2)"; - image.style.top = "auto"; - image.style.left = "auto"; - image.style.bottom = "0"; - image.style.zIndex = "9"; - heroDiv = document.createElement("div"); - heroDiv.appendChild(image); - document.querySelector('.preview').appendChild(heroDiv); - image = document.createElement("img"); - image.src = "https://github.com/AN0NCER/resources/blob/main/simons/hide.gif?raw=true"; - heroDiv = document.createElement("div"); - heroDiv.className = "slide"; - heroDiv.style.display = "grid"; - heroDiv.style.placeItems = "center"; - heroDiv.style.background = "#e5e8ef"; - heroDiv.style.borderRadius = "3px"; - heroDiv.style.paddingLeft = "20px"; - heroDiv.style.paddingRight = "40px"; - heroDiv.style.maxHeight = "150px"; - heroDiv.appendChild(image); - document.querySelector('.galery-slider').appendChild(heroDiv); - }); - } -} - -function simonsleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} -simonmain(); -simonscat_py(); - -function waitForElm(selector) { - return new Promise(resolve => { - if (document.querySelector(selector)) { - return resolve(document.querySelector(selector)); - } - - const observer = new MutationObserver(mutations => { - if (document.querySelector(selector)) { - observer.disconnect(); - resolve(document.querySelector(selector)); - } - }); - - // If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336 - observer.observe(document.body, { - childList: true, - subtree: true - }); - }); -} \ No newline at end of file diff --git a/style/css/settings.css b/style/css/settings.css index c07851d..79e3266 100644 --- a/style/css/settings.css +++ b/style/css/settings.css @@ -693,7 +693,7 @@ body.menuver[data-orientation="90"] .interactive-menu .user-interactive .triangl } } .window-select .window-content, .window-select-mehr .window-content { - max-height: calc(100vh - env(safe-area-inset-top)); + max-height: calc(100dvh - env(safe-area-inset-top)); overflow-y: hidden; } .window-select .window-content .content-wraper, .window-select-mehr .window-content .content-wraper { @@ -809,6 +809,74 @@ body.menuver[data-orientation="90"] .interactive-menu .user-interactive .triangl cursor: pointer; } +.window-app-size .window-content { + max-height: calc(100dvh - env(safe-area-inset-top)); + overflow-y: hidden; +} +.window-app-size .window-content .content-wraper { + display: grid; + grid-template-columns: auto; + grid-template-rows: auto auto auto; + overflow-y: hidden; +} +.window-app-size .window-content .content-wraper .window-bar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} +.window-app-size .window-content .content-wraper .window-bar .window-title { + font-size: 14px; +} +.window-app-size .window-content .content-wraper .window-bar .window-close { + width: 40px; + height: 40px; + display: grid; + place-items: center; + cursor: pointer; +} +.window-app-size .window-content .content-wraper .window-bar .window-close svg { + fill: #fff; + width: 10px; +} +.window-app-size .window-content .content-wraper .block-title { + font-size: 14px; + background: #1f2329; + padding: 5px 10px; + display: flex; + justify-content: space-between; +} +.window-app-size .window-content .content-wraper .wrapper-storage { + overflow-y: auto; + display: flex; + flex-direction: column; + border-radius: 5px; +} +.window-app-size .window-content .content-wraper .list-local-storage, +.window-app-size .window-content .content-wraper .list-session-storage { + background: #203544; +} +.window-app-size .window-content .content-wraper .list-local-storage .storage-element, +.window-app-size .window-content .content-wraper .list-session-storage .storage-element { + padding: 5px 10px; + display: grid; + grid-template-columns: 1fr auto; +} +.window-app-size .window-content .content-wraper .list-local-storage .storage-element div, +.window-app-size .window-content .content-wraper .list-session-storage .storage-element div { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + padding-right: 20px; +} +.window-app-size .window-content .content-wraper .window-footer { + color: rgba(255, 255, 255, 0.6); + display: grid; + place-items: center; + padding: 8px 10px; + cursor: pointer; +} + @media screen and (min-width: 900px) { .select-wraper .select-control, .select-checkbox-wraper .select-control { diff --git a/style/css/verifyaction.css b/style/css/verifyaction.css new file mode 100644 index 0000000..2112f2e --- /dev/null +++ b/style/css/verifyaction.css @@ -0,0 +1,198 @@ +.windowed { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 300; + color: #FFF; + font-family: "Manrope"; + display: block; + transition: 0.3s ease-in-out; +} + +.windowed-right { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + font-family: "Manrope"; + display: block; + transition: 0.3s ease-in-out; + z-index: 300; + color: #FFF; +} + +.windowed.hide, +.windowed-right.hide { + display: none; +} +.windowed.hide .hide-window, +.windowed-right.hide .hide-window { + opacity: 0; +} +.windowed .hide-window, +.windowed-right .hide-window { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + opacity: 1; + transition: 0.3s ease-in-out; + background: rgba(255, 255, 255, 0.2); + -webkit-backdrop-filter: blur(5px); + backdrop-filter: blur(5px); + cursor: pointer; +} + +.windowed-right .window-content { + background: #101318; + border-radius: 0; + position: fixed; + top: 0; + right: 0; + left: 0; + bottom: 0; + flex-direction: column; + overscroll-behavior: contain; + overflow-y: auto; + transition: 0.3s ease-in-out; + transform: translateX(100%); +} +.windowed-right .window-content .content-wraper { + padding-top: 20px; + padding-left: calc(env(safe-area-inset-left) + 20px); + padding-right: calc(env(safe-area-inset-right) + 20px); + padding-bottom: max(20px, env(safe-area-inset-bottom)); + display: grid; +} +.windowed-right .window-content.hide { + display: none; +} + +.windowed .window-content { + background: #101318; + border-radius: 5px 5px 0px 0px; + position: fixed; + bottom: 0; + left: 0; + display: flex; + right: 0; + flex-direction: column; + overflow-y: auto; + transition: 0.3s ease-in-out; + transform: translateY(100%); +} +.windowed .window-content .content-wraper { + padding-left: calc(env(safe-area-inset-left) + 20px); + padding-right: calc(env(safe-area-inset-right) + 20px); + padding-top: 20px; + padding-bottom: max(20px, env(safe-area-inset-bottom)); + display: flex; + flex-direction: column; + gap: 10px; +} +.windowed .window-content.hide { + display: none; +} + +@media screen and (min-width: 900px) { + .windowed .window-content .content-wraper { + max-width: 900px; + margin: 0 auto; + width: 100%; + } + .windowed-right .window-content { + left: auto; + max-width: 400px; + width: 100%; + } +} +.window-verify-action .window-content { + max-height: calc(100dvh - env(safe-area-inset-top)); + overflow-y: hidden; + height: 100dvh; + border-radius: 0px; +} +.window-verify-action .window-content .content-wraper { + display: grid; + grid-template-columns: auto; + grid-template-rows: 1fr auto; + overflow-y: hidden; + height: 100%; +} +.window-verify-action .window-content .content-wraper .window-access-icon { + display: flex; + align-items: center; + justify-content: center; +} +.window-verify-action .window-content .content-wraper .window-access-icon svg { + fill: #fff; + opacity: 0.4; +} +.window-verify-action .window-content .content-wraper .window-access-footer { + display: flex; + flex-direction: column; + gap: 10px; +} +.window-verify-action .window-content .content-wraper .window-access-footer .detail-access { + text-align: center; + color: rgba(255, 255, 255, 0.4); + margin-bottom: 10px; +} +.window-verify-action .window-content .content-wraper .window-access-footer .access-swiper, +.window-verify-action .window-content .content-wraper .window-access-footer .button-access-cancel { + background: #203544; + height: 50px; + overflow: hidden; + border-radius: 5px; + text-transform: uppercase; + font-weight: bold; + font-size: 11px; +} +.window-verify-action .window-content .content-wraper .window-access-footer .access-swiper { + display: flex; + padding-left: 5px; + padding-right: 5px; + align-items: center; + position: relative; +} +.window-verify-action .window-content .content-wraper .window-access-footer .access-swiper .pin { + position: relative; + display: flex; + height: 44px; + width: 65px; + background: #3587E6; + justify-content: center; + align-items: center; + border-radius: 6px; + cursor: pointer; + z-index: 9; +} +.window-verify-action .window-content .content-wraper .window-access-footer .access-swiper span { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: grid; + place-items: center; + opacity: 0.4; +} +.window-verify-action .window-content .content-wraper .window-access-footer .button-access-cancel { + display: grid; + place-items: center; + cursor: pointer; +} + +@media screen and (max-height: 400px) { + .window-verify-action .window-content .content-wraper { + grid-template-rows: 1fr; + align-items: end; + } + .window-verify-action .window-content .content-wraper .window-access-icon { + display: none; + } +} \ No newline at end of file diff --git a/style/css/watch.css b/style/css/watch.css index 3a362f8..7e4ff65 100644 --- a/style/css/watch.css +++ b/style/css/watch.css @@ -1529,6 +1529,45 @@ footer .studio span { opacity: 0.3; } +:root { + --sab: env(safe-area-inset-bottom); +} + +.popup { + position: fixed; + left: 0; + right: 0; + display: flex; + justify-content: center; + align-items: center; + z-index: 11; +} +.popup .popup-content { + background: #2393F1; + color: #fff; + font-family: Manrope; + font-weight: bold; + padding: 10px 30px; + font-size: 11px; + border-radius: 10px; + max-width: 300px; + box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); + border: 1px solid rgba(255, 255, 255, 0.368627451); + position: relative; +} +.popup .popup-content img { + position: absolute; + top: -23px; + width: 30px; + right: 20px; +} +.popup.popup-menu-none { + bottom: -40px; +} +.popup.popup-menu-visible { + bottom: calc(env(safe-area-inset-bottom) - 40px); +} + .card-anime { min-width: 195px; margin-right: 10px; diff --git a/style/settings.scss b/style/settings.scss index f53eef1..28e43cc 100644 --- a/style/settings.scss +++ b/style/settings.scss @@ -360,6 +360,7 @@ footer { @import './phone_menu'; @import './windowed'; @import './settings/slectwindow'; +@import './settings/storagewindow'; @media screen and (min-width: 900px) { diff --git a/style/settings/_slectwindow.scss b/style/settings/_slectwindow.scss index 8259118..d6bf2bb 100644 --- a/style/settings/_slectwindow.scss +++ b/style/settings/_slectwindow.scss @@ -1,6 +1,6 @@ .window-select, .window-select-mehr { .window-content { - max-height: calc(100vh - env(safe-area-inset-top)); + max-height: calc(100dvh - env(safe-area-inset-top)); overflow-y: hidden; .content-wraper { diff --git a/style/settings/_storagewindow.scss b/style/settings/_storagewindow.scss new file mode 100644 index 0000000..639915e --- /dev/null +++ b/style/settings/_storagewindow.scss @@ -0,0 +1,78 @@ +.window-app-size { + .window-content { + max-height: calc(100dvh - env(safe-area-inset-top)); + overflow-y: hidden; + + .content-wraper { + display: grid; + grid-template-columns: auto; + grid-template-rows: auto auto auto; + overflow-y: hidden; + + .window-bar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + + .window-title { + font-size: 14px; + } + + .window-close { + width: 40px; + height: 40px; + display: grid; + place-items: center; + cursor: pointer; + + svg { + fill: #fff; + width: 10px; + } + } + } + + .block-title { + font-size: 14px; + background: #1f2329; + padding: 5px 10px; + display: flex; + justify-content: space-between; + } + + .wrapper-storage { + overflow-y: auto; + display: flex; + flex-direction: column; + border-radius: 5px; + } + + .list-local-storage, + .list-session-storage { + background: #203544; + + .storage-element { + padding: 5px 10px; + display: grid; + grid-template-columns: 1fr auto; + + div { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + padding-right: 20px; + } + } + } + + .window-footer { + color: rgba(255, 255, 255, 0.60); + display: grid; + place-items: center; + padding: 8px 10px; + cursor: pointer; + } + } + } +} \ No newline at end of file diff --git a/style/verifyaction.scss b/style/verifyaction.scss new file mode 100644 index 0000000..6b66934 --- /dev/null +++ b/style/verifyaction.scss @@ -0,0 +1,107 @@ +@import './windowed'; + +.window-verify-action { + .window-content { + max-height: calc(100dvh - env(safe-area-inset-top)); + overflow-y: hidden; + height: 100dvh; + border-radius: 0px; + + .content-wraper { + display: grid; + grid-template-columns: auto; + grid-template-rows: 1fr auto; + overflow-y: hidden; + height: 100%; + + .window-access-icon { + display: flex; + align-items: center; + justify-content: center; + + svg { + fill: #fff; + opacity: .4; + } + } + + .window-access-footer { + display: flex; + flex-direction: column; + gap: 10px; + + .detail-access { + text-align: center; + color: rgba($color: #fff, $alpha: 0.4); + margin-bottom: 10px; + } + + .access-swiper, + .button-access-cancel { + background: #203544; + height: 50px; + overflow: hidden; + border-radius: 5px; + text-transform: uppercase; + font-weight: bold; + font-size: 11px; + + } + + .access-swiper { + display: flex; + padding-left: 5px; + padding-right: 5px; + align-items: center; + position: relative; + + .pin { + position: relative; + display: flex; + height: 44px; + width: 65px; + background: #3587E6; + justify-content: center; + align-items: center; + border-radius: 6px; + cursor: pointer; + z-index: 9; + } + + span { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: grid; + place-items: center; + opacity: .4; + } + } + + .button-access-cancel { + display: grid; + place-items: center; + cursor: pointer; + } + } + } + } +} + +@media screen and (max-height: 400px) { + .window-verify-action { + .window-content { + + .content-wraper { + grid-template-rows: 1fr; + align-items: end; + + .window-access-icon { + display: none; + } + } + } + } +} \ No newline at end of file diff --git a/style/watch.scss b/style/watch.scss index 89b37c8..094db92 100644 --- a/style/watch.scss +++ b/style/watch.scss @@ -1032,6 +1032,7 @@ footer { @import './window/translation'; @import './window/score'; @import './watch/download'; +@import './popup'; .card-anime { min-width: 195px; diff --git a/sw.js b/sw.js index 9c44621..1f36f5c 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -var version = '166'; +var version = '167'; var cacheName = 'pwa-tunime-v' + version; var appShellFilesToCache = [ // Директория: /images/icons @@ -35,6 +35,7 @@ var appShellFilesToCache = [ "/javascript/library/swiper-bundle.min.js", "/javascript/library/swiper-bundle.min.js.map", // Директория: /javascript/modules + "/javascript/modules/ActionVerify.js", "/javascript/modules/AnimeCard.js", "/javascript/modules/funcitons.js", "/javascript/modules/header.js", @@ -74,6 +75,7 @@ var appShellFilesToCache = [ "/javascript/pages/search/mod_searchState.js", // Директория: /javascript/pages/settings "/javascript/pages/settings/mod_select.js", + "/javascript/pages/settings/mod_storage.js", // Директория: /javascript/pages/user "/javascript/pages/user/mod_history.js", // Директория: /javascript/pages/watch @@ -116,6 +118,7 @@ var appShellFilesToCache = [ "/style/css/search.css", "/style/css/settings.css", "/style/css/user.css", + "/style/css/verifyaction.css", "/style/css/watch.css", // Директория: /style/fonts "/style/fonts/Inter.ttf", diff --git a/watch.html b/watch.html index 7afae7b..e645053 100644 --- a/watch.html +++ b/watch.html @@ -385,11 +385,11 @@
- + -
+