initial commit

This commit is contained in:
Данил 2023-05-01 20:49:43 +03:00
parent dd2684c3a9
commit aa8930c07e
No known key found for this signature in database
GPG key ID: 5051BCD5AB064A7B
4 changed files with 209 additions and 0 deletions

20
api/utils/respond.go Normal file
View file

@ -0,0 +1,20 @@
package utils
import (
"encoding/json"
"github.com/Redume/EveryNASA/utils"
"github.com/gofiber/fiber/v2"
)
func Message(status bool, message string) map[string]interface{} {
return map[string]interface{}{"status": status, "message": message}
}
func Respond(c *fiber.Ctx, data map[string]interface{}) {
c.Set("Content-Type", "application/json")
err := json.NewEncoder(c).Encode(data)
if err != nil {
utils.Log(err.Error())
}
}

View file

@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EveryNASA</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="/static/fonts/Roboto.css" rel="stylesheet">
<link href="/static/styles/vendors/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/static/styles/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/assets/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="/favorite">Favorite</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="wallpaper"
aria-hidden="true"
aria-labelledby="wallpaperWindow"
tabindex="-1" style="color: black;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
<span class="d-inline-block text-truncate w-modal-title" style="max-width: 429px;"></span>
</h5>
</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: 800px; height: 800px; margin: 0 auto;"
loop autoplay>
</lottie-player>
</div>
<script src="/static/scripts/vendors/jquery.min.js" type="application/javascript"></script>
<script src="/static/scripts/vendors/bootstrap.bundle.min.js" type="application/javascript"></script>
<script src="/static/scripts/vendors/lottie-player.js" type="application/javascript"></script>
<script src="/static/scripts/vendors/bodymovin.min.js" type="application/javascript"></script>
<script src="/static/scripts/gallery.js" type="application/javascript"></script>
<script type="application/javascript">
startDate.setDate(startDate.getUTCDate() - 19);
$(document).ready(function() {
$.ajax({
url: "https://api.nasa.gov/planetary/apod",
type: "GET",
data: {
api_key: apiKEY,
start_date: `${startDate.getUTCFullYear()}-${startDate.getUTCMonth() + 1}-${startDate.getUTCDate()}`,
end_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
},
success: function(data) {
data.reverse();
wallpaperLoad(data);
},
});
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

View file

@ -0,0 +1,90 @@
.card {
background-color: #131313;
border-radius: 34px;
width: 359px;
height: 237px;
overflow: hidden;
}
.header-row {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(1, 1fr);
grid-gap: 40px;
padding: 10px;
margin-left: -100px;
}
.card-img-top {
min-width: 120%;
min-height: 120%;
}
.card-img {
border-radius: 16px;
}
.modal-content {
background-color: #131313;
color: white;
}
.shimmer {
display: inline-block;
color: #333333;
-webkit-mask: linear-gradient(-60deg, #000 30%, #0005, #000 70%) right/386% 100%;
background-repeat: no-repeat;
animation: shimmer 2.5s infinite;
filter: blur(50px)
}
@keyframes shimmer {
100% {-webkit-mask-position: left}
}
#show-more {
background-color: #212529;
color: white;
border: none;
border-radius: 16px;
padding: 10px;
margin: 10px;
}
.modal-body p {
font-family: 'Roboto', sans-serif;
margin-top: 16px;
}
.navbar {
position: -webkit-sticky;
position: sticky;
z-index: 100;
top: 0;
}
#favorite {
width: 120px;
height: 120px;
position: absolute;
left: 280px;
top: 89.3%;
}
#favorite:hover {
cursor: pointer;
}
#favorite:active {
transform: scale(0.9);
}
#setWallpaper:disabled {
cursor: unset;
transform: none;
}
.btn-close{
background-color: white;
}