Delete web directory

This commit is contained in:
Данил 2022-11-02 20:53:33 +03:00 committed by GitHub
parent 605bb1a246
commit 983d03575f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 0 additions and 840 deletions

View file

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EveryNasa</title>
<link rel="icon" href="/image/icons/favicon.png">
</head>
<style>
* {
line-height: 1.2;
margin: 0;
}
lottie-player {
margin: 0 auto;
width: 300px; height: 300px;
}
p {
font-family: sans-serif;
text-align: center;
margin: 0.4% auto;
width: 300px;
}
a:visited {
color: #9FA4AF;
}
</style>
<body style="background: #131313; color: white;">
<lottie-player src="/static/image/lottie/lf20_2QSlz3Li88.json" background="transparent" speed="1" loop autoplay></lottie-player>
<p style="font-size: 160%;">Page not found!</p>
<p style="font-size: 115%;">Sorry, but the page you want to view may have been deleted or moved!</p>
<p><a style="font-size: 1em;" href="/">General page</a></p>
<script src="/static/scripts/lottie-player.js"></script>
</body>
</html>

View file

@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EveryNasa</title>
<link rel="icon" href="/static/image/icons/favicon.png">
<style>
lottie-player {
margin: 2% auto;
width: 250px;
height: 250px;
}
p {
font-family: sans-serif;
text-align: center;
font-size: 130%;
}
li {
font-family: sans-serif;
margin-top: 3%;
margin-left: 43%
}
</style>
</head>
<body style="background: #131313; color: white;">
<lottie-player src="/static/image/lottie/lf20_3FGZxC.json" background="transparent" speed="0.5" style="width: 250px; height: 250px;" loop autoplay></lottie-player>
<p style="margin: 3% auto; font-size: 1.7em;">No internet connection</p>
<p style="margin: -2% auto; font-size: 1.2em;">Try to do the following:</p>
<li>Check the network cables, modem and router.</li>
<li style="margin-top: 1%; margin-left: 43%">Connect to the Wi-Fi network again.</li>
<script src="static/scripts/lottie-player.js"></script>
</body>
</html>

View file

@ -1,15 +0,0 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func About(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/about.html")
}

View file

@ -1,15 +0,0 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func Gallery(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/gallery.html")
}

View file

@ -1,15 +0,0 @@
package page
import (
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2"
)
func Settings(c *fiber.Ctx) error {
con := functions.Connected()
if con == false {
return c.SendFile("./web/errors/500.html")
}
return c.SendFile("./web/src/settings.html")
}

File diff suppressed because one or more lines are too long

View file

@ -1,75 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EveryNasa</title>
<link rel="icon" href="/static/image/icons/favicon.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<link rel="stylesheet" href="/static/style/gallery.css" type="text/css">
</head>
<body style="background: #131313; color: white;">
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="/static/image/icons/favicon.png" width="45" alt="EveryNasa">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/settings">Settings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about">About</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="modal fade" id="WallpaperModal" aria-hidden="true" aria-labelledby="WallpaperModal" tabindex="-1" style="color: black;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="WallpaperModale">
<span class="d-inline-block text-truncate w-modal-title" style="max-width: 429px;"></span>
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="container">
<header class="header-row"></header>
</div>
<div class="preloader">
<lottie-player src="https://assets4.lottiefiles.com/datafiles/a3YH0ragZcwfKHS/data.json" background="transparent" speed="1" style="width: 600px; height: 600px;" loop autoplay></lottie-player>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="EveryNasa" width="30">
<strong class="me-auto" style="color: black;">EveryNasa</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body" style="color: black;"></div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<script src="/static/scripts/gallery.js" type="application/javascript"></script>
</body>
</html>

View file

@ -1,76 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EveryNasa</title>
<link rel="icon" href="/static/image/icons/favicon.png">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<link rel="stylesheet" href="/static/style/settings.css" type="text/css">
</head>
<body style="background: #131313; color: white;">
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="/" draggable="false">
<img src="/static/image/icons/favicon.png" width="45" alt="EveryNasa">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/settings">Settings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about">About</a>
</li>
</ul>
</div>
</div>
</nav>
<h1 id="title">Application Settings</h1>
<div class="container">
<header class="header-row">
<div class="settings">
<p class="title"><strong>Add a program to the startup</strong></p>
<p class="desc">EverNasa will automatically start when you log in.</p>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="settings_startupSwitch">
<label class="form-check-label" for="settings_startupTogglerName" id="settings_startupTogglerName">Off</label>
</div>
</div>
<div class="settings">
<p class="title"><strong>Auto-change of desktop wallpaper</strong></p>
<p class="desc">EveryNasa will automatically change the desktop wallpaper at startup as well as every day.</p>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="settings_autoSetWallpaperSwitch">
<label class="form-check-label" for="settings_autoSetWallpaperTogglerName" id="settings_autoSetWallpaperTogglerName">Off</label>
</div>
</div>
<div class="settings">
<p class="title"><strong>Create an application shortcut</strong></p>
<p class="desc">EveryNasa will create an application shortcut on your desktop.</p>
<button type="button" class="btn btn-outline-primary" id="createLabelButton">Create</button>
</div>
</header>
</header>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="EveryNasa" width="30">
<strong class="me-auto" style="color: black;">EveryNasa</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body" style="color: black;"></div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
<script src="/static/scripts/switch.js" type="application/javascript"></script>
<script src="/static/scripts/createLabel.js" type="application/javascript"></script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

View file

@ -1,20 +0,0 @@
let button = document.querySelector("#createLabelButton");
button.addEventListener("click", function() {
$.ajax({
url: "http://localhost:3000/api/create/label",
type: "POST",
success: function(data) {
if(data.status) {
$(".toast-body").text(data.message);
let toastLiveExample = document.getElementById('liveToast');
let toast = new bootstrap.Toast(toastLiveExample);
toast.show();
} else {
$(".toast-body").text("An error occurred while creating the label.");
let toastLiveExample = document.getElementById('liveToast');
let toast = new bootstrap.Toast(toastLiveExample);
toast.show();
}
}
});
});

View file

@ -1,172 +0,0 @@
let today = new Date();
let endDate = new Date();
const ids = [];
let id = 0;
const apiKEY = "1gI9G84ZafKDEnrbydviGknReOGiVK9jqrQBE3et";
today.setDate(today.getDate() - 17);
$(document).ready(function() {
$.ajax({
url: "https://api.nasa.gov/planetary/apod",
type: "GET",
data: {
api_key: apiKEY,
start_date: `${today.getUTCFullYear()}-${today.getUTCMonth() + 1}-${today.getUTCDate()}`,
end_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
},
success: function(data) {
wallpaper(data);
},
});
});
function wallpaper(data) {
$(".preloader").hide();
data = data.reverse();
for (let i = 0; i < data.length; i++, id++) {
ids.push(data[i]);
if (ids.filter((item) => item['url'] === data[i]['url']).length > 1) {
continue;
}
let image = new Image();
image.src = ids[id]['media_type'] === "video" ?
`https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg` :
ids[id]['url'];
image.onload = function() {
if(image.width+image.height !== 210) {
$(`img[data-src="${image.src}"]`).attr("src", `${image.src}`);
}
}
if (ids[id]['media_type'] === "image") {
$(".header-row").append(`
<div class="card">
<a data-bs-toggle="modal" href="#WallpaperModal" role="button">
<img src="${ids[id]['url']}" alt="${ids[id]['title']}" class="card-img-top" id="${id}">
</a>
</div>
`);
} else {
$(".header-row").append(`
<div class="card">
<a data-bs-toggle="modal" href="#WallpaperModal" role="button">
<img src="http://localhost:3000/static/image/placeholder.png"
data-src="https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg"
alt="${ids[id]['title']}"
class="card-img-top"
id="${id}">
</a>
</div>
`);
}
}
let button_modal = document.querySelector(".header-row");
button_modal.addEventListener("click", function (event) {
if (event.target === button_modal) {
return;
}
let id = event.target.getAttribute("id");
let img = document.querySelector(".modal-body");
let title = document.querySelector(".w-modal-title");
let button = document.querySelector(".modal-footer");
if($(`img#${id}.card-img-top`).attr("src") !== "http://localhost:3000/static/image/placeholder.png") {
button.innerHTML = `<button type="button" class="btn btn-primary" id="setWallpaper">Set Wallpaper</button>`;
} else {
button.innerHTML = `<button type="button"
class="btn"
id="setWallpaper"
disabled
style="background-color: grey; color: white;">
Set Wallpaper
</button>`;
}
let setWallpaper = document.querySelector("#setWallpaper");
ids[id]['copyright'] = ids[id]['copyright'] === undefined ? "NASA" : ids[id]['copyright'];
if (ids[id]['media_type'] === "image") {
title.innerHTML = `<h5 class="modal-title">${ids[id]['title']}</h5>`;
img.innerHTML = `
<img src="${ids[id]['url']}" alt="${ids[id]['title']}" class="card-img">
<p><strong>Author:</strong> ${ids[id]['copyright']}</p>
<p><strong>Date of publication:</strong> ${ids[id]['date']}</p>
<p><strong>Explanation:</strong> ${ids[id]['explanation']}</p>
`;
setWallpaper.addEventListener("click", function () {
wallpaperUpdate(ids[id]['hdurl']);
});
} else {
title.innerHTML = `<h5 class="modal-title">${ids[id]['title']}</h5>`;
img.innerHTML = `
<iframe width="460"
height="315"
src="${ids[id]['url']}"
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen></iframe>
<p><strong>Author:</strong> ${ids[id]['copyright']}</p>
<p><strong>Date of publication:</strong> ${ids[id]['date']}</p>
<p><strong>Explanation:</strong> ${ids[id]['explanation']}</p>
`;
setWallpaper.addEventListener("click", function () {
wallpaperUpdate(`https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg`);
});
}
});
$(window).scroll(function () {
if (($(window).scrollTop() > $(document).height() - $(window).height() - 100)) {
$(".preloader").show();
$(window).off("scroll");
today.setDate(today.getDate() - 1);
endDate.setDate(endDate.getDate() - 15);
endDate.setMonth(endDate.getMonth() - 1);
$.ajax({
url: "https://api.nasa.gov/planetary/apod",
data: {
api_key: apiKEY,
start_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
end_date: `${today.getUTCFullYear()}-${today.getUTCMonth() + 1}-${today.getUTCDate()}`,
},
success: function (data) {
wallpaper(data);
$(window).on("scroll");
},
});
}
});
}
function wallpaperUpdate(url) {
$.ajax({
url: "http://localhost:3000/api/update/wallpaper",
type: "POST",
data: {
url: url,
},
success: function (data) {
$(".toast-body").text(data.message);
let toastLiveExample = document.getElementById('liveToast');
let toast = new bootstrap.Toast(toastLiveExample);
toast.show();
},
});
}

File diff suppressed because one or more lines are too long

View file

@ -1,136 +0,0 @@
$(document).ready(async function() {
const $startupSwitch = $("#settings_startupSwitch");
const $startupSwitchTogglerName = $("#settings_startupTogglerName");
const $wallpaperSwitch = $("#settings_autoSetWallpaperSwitch");
const $wallpaperSwitchTogglerName = $("#settings_autoSetWallpaperTogglerName");
$.ajax({
url: "http://localhost:3000/api/get/settings",
type: "GET",
success: function(data) {
if (data["wallpaper"] === 1) {
$wallpaperSwitch.attr("checked", "true");
$wallpaperSwitchTogglerName.text("On");
}
if (data["startup"] === 1) {
$startupSwitch.attr("checked", "true");
$startupSwitchTogglerName.text("On");
}
},
});
$wallpaperSwitch.click(async function() {
$.ajax({
url: "http://localhost:3000/api/get/settings",
type: "GET",
success: function (data) {
if (data["wallpaper"] === 1) {
$.ajax({
url: "http://localhost:3000/api/update/settings",
type: "POST",
data: {
"wallpaper": 0,
},
success: function (data) {
if(data["status"]) {
$wallpaperSwitchTogglerName.text("Off");
$wallpaperSwitch.removeAttr("checked");
toast(data.message);
} else {
toast("Failed to apply settings.");
}
},
});
} else {
$.ajax({
url: "http://localhost:3000/api/update/settings",
type: "POST",
data: {
"wallpaper": 1,
},
success: function (data) {
if(data["status"]) {
$wallpaperSwitchTogglerName.text("On");
$wallpaperSwitch.attr("checked", "true");
toast(data.message);
} else {
toast("Failed to apply settings.");
}
},
});
}
},
})
});
$startupSwitch.click(async function() {
$.ajax({
url: "http://localhost:3000/api/get/settings",
type: "GET",
success: function (data) {
if (data["startup"] === 1) {
$.ajax({
url: "http://localhost:3000/api/update/settings",
type: "POST",
data: {
"startup": 0,
},
success: async function (data) {
if (data["status"]) {
await editStartup(0);
$startupSwitchTogglerName.text("Off");
$startupSwitch.removeAttr("checked");
toast(data.message);
} else {
toast("Failed to apply settings.");
}
},
});
} else {
$.ajax({
url: "http://localhost:3000/api/update/settings",
type: "POST",
data: {
"startup": 1,
},
success: async function (data) {
if (data["status"]) {
await editStartup(1);
$startupSwitchTogglerName.text("On");
$startupSwitch.attr("checked", "true");
toast(data.message);
} else {
toast("Failed to apply settings.");
}
},
});
}
},
});
});
});
function toast(message) {
$(".toast-body").text(message);
let toastLiveExample = document.getElementById('liveToast');
let toast = new bootstrap.Toast(toastLiveExample);
toast.show();
}
function editStartup(i) {
return $.ajax({
url: "http://localhost:3000/api/update/startup",
type: "POST",
data: {
"startup": i
},
});
}

View file

@ -1,2 +0,0 @@
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))

View file

@ -1,44 +0,0 @@
p {
font-family: sans-serif;
}
#title {
font-size: 1.6em;
text-align: center;
margin-top: 1%;
}
#banner {
display: block;
margin-right: auto;
margin-left: auto;
margin-top: 1%;
}
#description, #dev {
font-size: 1.2em;
text-align: center;
}
#contact-image {
display: flex;
justify-content: center;
align-items: center;
margin-top: -0.5%;
}
#version {
font-size: 1em;
text-align: center;
margin-top: -0.5%;
color: #9FA4AF
}
#license a, #github a {
color: #a596bd;
}
#license, #github {
font-size: 1em;
text-align: center;
}

View file

@ -1,37 +0,0 @@
.card {
border-radius: 2%;
min-width: 350px;
max-width: 400px;
height: 200px;
overflow: hidden;
margin: 10px;
background-color: #131313;
}
.header-row {
flex-wrap: wrap;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
}
.card-img-top {
object-fit: none;
object-position: center;
}
lottie-player {
margin: 0 auto;
}
.modal-body p {
font-family: 'Roboto', sans-serif;
}
.navbar {
position: -webkit-sticky;
position: sticky;
z-index: 100;
top: 0;
}

View file

@ -1,25 +0,0 @@
#title {
margin-top: 0.6em;
margin-left: 0.8em;
}
.title {
margin-top: 2.3em;
}
.desc {
margin-top: -0.7em;
}
.settings {
margin-top: 2.4em;
}
.settings p, .form-check {
margin-left: -17.5em;
margin-top: -0.8em;
}
#createLabelButton {
margin-left: -17.6em;
}