2
0

Compare commits

..

No commits in common. "201773af5071627ecc19e9239f6dc7593de07e72" and "73d98b9c0fbf48707597715443b6059bf087fb7c" have entirely different histories.

3 changed files with 34 additions and 161 deletions

View File

@ -35,10 +35,10 @@
<publication-name>Tensei Pandemic</publication-name> <publication-name>Tensei Pandemic</publication-name>
</publication-information> </publication-information>
</publication> </publication>
</content> </content>
<popup> <addtask-popup>
<blur-background></blur-background> <addtask-background></addtask-background>
<addtask-window> <addtask-window>
<window-titlebar> <window-titlebar>
<p>Add Task</p> <p>Add Task</p>
@ -58,21 +58,7 @@
<div id="taskSelectOutput"></div> <div id="taskSelectOutput"></div>
</window-content> </window-content>
</addtask-window> </addtask-window>
<publication-viewer> </addtask-popup>
<img id="pubviewcover" src="media/cover.jpg" alt="cover">
<publication-information>
<publication-name id="publicationViewerName">Tensei Pandemic</publication-name>
<publication-author id="publicationViewerAuthor">Imamura Hinata</publication-author>
<publication-description id="publicationViewerDescription">Imamura Hinata is a high school boy with a cute appearance.
Since his trauma with the first love, he wanted to be more manly than anybody else. But one day he woke up to something different…
The total opposite of his ideal male body!
Pandemic love comedy!
</publication-description>
<publication-delete>Delete Task ❌</publication-delete>
</publication-information>
</publication-viewer>
</popup>
</viewport> </viewport>
<settingstab id="settingstab"> <settingstab id="settingstab">

View File

@ -18,9 +18,6 @@ const slideOutRightTiming = {
easing: "ease-in" easing: "ease-in"
} }
let publications = [];
let tasks = [];
const taskTypesSelect = document.querySelector("#taskTypes") const taskTypesSelect = document.querySelector("#taskTypes")
const searchPublicationQuery = document.querySelector("#searchPublicationQuery"); const searchPublicationQuery = document.querySelector("#searchPublicationQuery");
const selectPublication = document.querySelector("#taskSelectOutput"); const selectPublication = document.querySelector("#taskSelectOutput");
@ -29,19 +26,12 @@ const settingsTab = document.querySelector("#settingstab");
const settingsCog = document.querySelector("#settingscog"); const settingsCog = document.querySelector("#settingscog");
const selectRecurrence = document.querySelector("#selectReccurrence"); const selectRecurrence = document.querySelector("#selectReccurrence");
const tasksContent = document.querySelector("content"); const tasksContent = document.querySelector("content");
const generalPopup = document.querySelector("popup"); const addtaskpopup = document.querySelector("addtask-popup");
const addTaskWindow = document.querySelector("addtask-window");
const publicationViewer = document.querySelector("publication-viewer");
const publicationViewerDescription = document.querySelector("#publicationViewerDescription");
const publicationViewerName = document.querySelector("#publicationViewerName");
const publicationViewerAuthor = document.querySelector("#publicationViewerAuthor");
const pubviewcover = document.querySelector("#pubviewcover");
const publicationDelete = document.querySelector("publication-delete");
const closetaskpopup = document.querySelector("#closePopupImg"); const closetaskpopup = document.querySelector("#closePopupImg");
settingsCog.addEventListener("click", () => slide()); settingsCog.addEventListener("click", () => slide());
closetaskpopup.addEventListener("click", () => HidePopup()) closetaskpopup.addEventListener("click", () => HideNewTaskWindow())
document.querySelector("blur-background").addEventListener("click", () => HidePopup()); document.querySelector("addtask-background").addEventListener("click", () => HideNewTaskWindow());
let availableTaskTypes; let availableTaskTypes;
GetTaskTypes() GetTaskTypes()
@ -69,15 +59,17 @@ GetAvailableControllers()
searchPublicationQuery.addEventListener("keypress", (event) => { searchPublicationQuery.addEventListener("keypress", (event) => {
if(event.key === "Enter"){ if(event.key === "Enter"){
selectPublication.replaceChildren();
GetPublication(connectorSelect.value, searchPublicationQuery.value) GetPublication(connectorSelect.value, searchPublicationQuery.value)
//.then(json => console.log(json)); //.then(json => console.log(json));
.then(json => .then(json =>
json.forEach(publication => { json.forEach(publication => {
var option = CreatePublication(publication, connectorSelect.value); var option = CreatePublication(publication, connectorSelect.value);
option.addEventListener("click", () => { option.addEventListener("click", () => {
CreateTask(taskTypesSelect.value, selectRecurrence.value, connectorSelect.value, publication.internalId, "en"); CreateNewMangaDownloadTask(
selectPublication.replaceChildren(); taskTypesSelect.value,
connectorSelect.value,
publication.internalId
);
}); });
selectPublication.appendChild(option); selectPublication.appendChild(option);
} }
@ -86,11 +78,11 @@ searchPublicationQuery.addEventListener("keypress", (event) => {
}); });
function CreatePublication(publication, connector){ function CreatePublication(publication, connector){
var publicationElement = document.createElement('publication'); var option = document.createElement('publication');
publicationElement.setAttribute("id", publication.internalId); option.setAttribute("id", publication.internalId);
var img = document.createElement('img'); var img = document.createElement('img');
img.src = publication.posterUrl; img.src = publication.posterUrl;
publicationElement.appendChild(img); option.appendChild(img);
var info = document.createElement('publication-information'); var info = document.createElement('publication-information');
var connectorName = document.createElement('connector-name'); var connectorName = document.createElement('connector-name');
connectorName.innerText = connector; connectorName.innerText = connector;
@ -99,19 +91,18 @@ function CreatePublication(publication, connector){
var publicationName = document.createElement('publication-name'); var publicationName = document.createElement('publication-name');
publicationName.innerText = publication.sortName; publicationName.innerText = publication.sortName;
info.appendChild(publicationName); info.appendChild(publicationName);
publicationElement.appendChild(info); option.appendChild(info);
if(publications.filter(pub => pub.internalId === publication.internalId) < 1) return option;
publications.push(publication);
return publicationElement;
} }
function DeleteTask(taskType, connectorName, publicationId){ function CreateNewMangaDownloadTask(taskType, connectorName, publicationId){
CreateTask(taskType, selectRecurrence.value, connectorName, publicationId, "en");
selectPublication.innerHTML = "";
} }
var slideIn = true; var slideIn = true;
function slide() { function slide(){
if (slideIn) if(slideIn)
settingsTab.animate(slideInRight, slideInRightTiming); settingsTab.animate(slideInRight, slideInRightTiming);
else else
settingsTab.animate(slideInRight, slideOutRightTiming); settingsTab.animate(slideInRight, slideOutRightTiming);
@ -129,36 +120,12 @@ function ResetContent(){
tasksContent.appendChild(add); tasksContent.appendChild(add);
} }
function ShowPopup(){
generalPopup.style.display = "block";
generalPopup.animate(fadeIn, fadeInTiming);
}
let toRemoveId;
function ShowPublicationViewerWindow(publicationId, event){
publicationViewer.style.top = `${event.clientY - 60}px`;
publicationViewer.style.left = `${event.clientX}px`;
var publication = publications.filter(pub => pub.internalId === publicationId)[0];
publicationViewerName.innerText = publication.sortName;
publicationViewerDescription.innerText = publication.description;
publicationViewerAuthor.innerText = publication.author;
pubviewcover.src = publication.posterUrl;
toRemoveId = publicationId;
publicationViewer.style.display = "block";
ShowPopup();
}
function ShowNewTaskWindow(){ function ShowNewTaskWindow(){
selectPublication.replaceChildren(); addtaskpopup.style.display = "block";
addTaskWindow.style.display = "flex"; addtaskpopup.animate(fadeIn, fadeInTiming);
ShowPopup();
} }
function HidePopup(){ function HideNewTaskWindow(){
generalPopup.style.display = "none"; addtaskpopup.style.display = "none";
addTaskWindow.style.display = "none";
publicationViewer.style.display = "none";
} }
const fadeIn = [ const fadeIn = [
@ -167,7 +134,7 @@ const fadeIn = [
]; ];
const fadeInTiming = { const fadeInTiming = {
duration: 50, duration: 150,
iterations: 1, iterations: 1,
fill: "forwards" fill: "forwards"
} }
@ -177,11 +144,7 @@ GetTasks()
//.then(json => console.log(json)) //.then(json => console.log(json))
.then(json => json.forEach(task => { .then(json => json.forEach(task => {
var publication = CreatePublication(task.publication, task.connectorName); var publication = CreatePublication(task.publication, task.connectorName);
publication.addEventListener("click", (event) => ShowPublicationViewerWindow(task.publication.internalId, event));
tasksContent.appendChild(publication); tasksContent.appendChild(publication);
if(tasks.filter(task => task.publication.internalId === publication.internalId) < 1)
tasks.push(task);
})); }));
setInterval(() => { setInterval(() => {
@ -190,10 +153,6 @@ setInterval(() => {
//.then(json => console.log(json)) //.then(json => console.log(json))
.then(json => json.forEach(task => { .then(json => json.forEach(task => {
var publication = CreatePublication(task.publication, task.connectorName); var publication = CreatePublication(task.publication, task.connectorName);
publication.addEventListener("click", (event) => ShowPublicationViewerWindow(task.publication.internalId, event));
tasksContent.appendChild(publication); tasksContent.appendChild(publication);
if(tasks.filter(task => task.publication.internalId === publication.internalId) < 1)
tasks.push(task);
})); }));
}, 5000); }, 5000);

View File

@ -181,20 +181,18 @@ publication-information {
justify-content: start; justify-content: start;
} }
publication-information * {
z-index: 1;
color: var(--accent-color);
}
connector-name{ connector-name{
width: fit-content; width: fit-content;
margin: 10px 0; margin: 10px 0;
z-index: 1;
} }
publication-name{ publication-name{
width: fit-content; width: fit-content;
font-size: 16pt; font-size: 16pt;
font-weight: bold; font-weight: bold;
z-index: 1;
color: var(--accent-color);
} }
publication img { publication img {
@ -206,7 +204,7 @@ publication img {
z-index: 0; z-index: 0;
} }
popup{ addtask-popup{
display: none; display: none;
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
@ -216,7 +214,7 @@ popup{
z-index: 2; z-index: 2;
} }
blur-background { addtask-background {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
@ -226,7 +224,7 @@ blur-background {
} }
addtask-window { addtask-window {
display: none; display: flex;
flex-direction: column; flex-direction: column;
flex-wrap: nowrap; flex-wrap: nowrap;
position: absolute; position: absolute;
@ -305,74 +303,4 @@ addtask-settings addtask-setting{
flex-wrap: wrap; flex-wrap: wrap;
justify-content: start; justify-content: start;
align-content: start; align-content: start;
}
publication-viewer{
display: none;
width: 500px;
height: 300px;
position: absolute;
top: 200px;
left: 400px;
background-color: var(--accent-color);
border-radius: 5px;
overflow: hidden;
}
publication-viewer{
padding: 30px;
}
publication-viewer::after{
content: '';
position: absolute;
left: 0; top: 0;
border-radius: 5px;
width: 100%; height: 100%;
background: rgba(0,0,0,0.8);
backdrop-filter: blur(3px);
}
publication-viewer img {
position: absolute;
left: 0;
top: 0;
min-height: 100%;
max-width: 100%;
border-radius: 5px;
z-index: 0;
}
publication-viewer publication-information publication-name{
margin: 5px 0;
}
publication-viewer publication-information publication-author {
margin: 5px 0;
}
publication-viewer publication-information publication-author::before {
content: "Author: ";
}
publication-viewer publication-information publication-description::before {
content: "Description";
display: block;
font-weight: bolder;
}
publication-viewer publication-information publication-description {
font-size: 12pt;
margin: 5px 0;
max-height: 200px;
overflow-x: scroll;
}
publication-viewer publication-information publication-delete {
position: absolute;
bottom: 0px;
right: 0px;
color: red;
margin: 20px;
font-size: 16pt;
} }