Added new files

This commit is contained in:
2024-07-27 00:25:21 +02:00
parent 2603d13c5c
commit 391c330de5
131 changed files with 1888 additions and 2824 deletions

0
oldprojects/neko/Screenshot.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

196
oldprojects/neko/index.html Normal file → Executable file
View File

@@ -1,99 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neko Images</title>
<link rel="stylesheet" href="https://envs.net/css/css_style.css">
<!-- Set the background color, font, and spacing of the body -->
<style>
body {
background-color: #1d1d1d;
color: #f1f1f1;
font-family: 'Fira Code', monospace;
font-size: 18px;
line-height: 1.6;
margin: 0;
padding: 0;
}
/* Center the container on the page */
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
/* Style the header text */
h1 {
color: #f1f1f1;
font-weight: bold;
line-height: 1.2;
margin-top: 0;
}
/* Style the neko image */
img {
max-width: 100%;
max-height: 500px;
margin-bottom: 1rem;
display: none; /* Hide the image initially */
}
/* Style the "Show another Neko image" button */
button.show-another {
display: none; /* Hide the button initially */
margin-top: 1rem;
padding: 0.5rem 1rem;
font-size: 1rem;
background-color: #2e7bff;
color: #f1f1f1;
border: none;
border-radius: 0.5rem;
cursor: pointer;
}
/* Set the button background color on hover */
button.show-another:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<!-- Add the heading text -->
<h1>Neko Images</h1>
<!-- Add the neko image with an initial blank source -->
<img src="" alt="Neko image">
<!-- Add the "Show another Neko image" button -->
<button class="show-another" onclick="showNeko()">Show another Neko image</button>
</div>
<!-- JS SHIT UNDER-->
<script>
window.onload = function() {
var nekoImg = document.querySelector('img');
var showAnother = document.querySelector('.show-another');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
nekoImg.style.display = 'block';
showAnother.style.display = 'block';
var jsonResponse = JSON.parse(xhr.responseText);
nekoImg.src = jsonResponse.url;
}
}
xhr.open('GET', 'https://nekos.life/api/v2/img/neko');
xhr.send();
}
function showNeko() {
var nekoImg = document.querySelector('img');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var jsonResponse = JSON.parse(xhr.responseText);
nekoImg.src = jsonResponse.url;
}
}
xhr.open('GET', 'https://nekos.life/api/v2/img/neko');
xhr.send();
}
</script>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neko Images</title>
<link rel="stylesheet" href="https://envs.net/css/css_style.css">
<!-- Set the background color, font, and spacing of the body -->
<style>
body {
background-color: #1d1d1d;
color: #f1f1f1;
font-family: 'Fira Code', monospace;
font-size: 18px;
line-height: 1.6;
margin: 0;
padding: 0;
}
/* Center the container on the page */
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
/* Style the header text */
h1 {
color: #f1f1f1;
font-weight: bold;
line-height: 1.2;
margin-top: 0;
}
/* Style the neko image */
img {
max-width: 100%;
max-height: 500px;
margin-bottom: 1rem;
display: none; /* Hide the image initially */
}
/* Style the "Show another Neko image" button */
button.show-another {
display: none; /* Hide the button initially */
margin-top: 1rem;
padding: 0.5rem 1rem;
font-size: 1rem;
background-color: #2e7bff;
color: #f1f1f1;
border: none;
border-radius: 0.5rem;
cursor: pointer;
}
/* Set the button background color on hover */
button.show-another:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<!-- Add the heading text -->
<h1>Neko Images</h1>
<!-- Add the neko image with an initial blank source -->
<img src="" alt="Neko image">
<!-- Add the "Show another Neko image" button -->
<button class="show-another" onclick="showNeko()">Show another Neko image</button>
</div>
<!-- JS SHIT UNDER-->
<script>
window.onload = function() {
var nekoImg = document.querySelector('img');
var showAnother = document.querySelector('.show-another');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
nekoImg.style.display = 'block';
showAnother.style.display = 'block';
var jsonResponse = JSON.parse(xhr.responseText);
nekoImg.src = jsonResponse.url;
}
}
xhr.open('GET', 'https://nekos.life/api/v2/img/neko');
xhr.send();
}
function showNeko() {
var nekoImg = document.querySelector('img');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var jsonResponse = JSON.parse(xhr.responseText);
nekoImg.src = jsonResponse.url;
}
}
xhr.open('GET', 'https://nekos.life/api/v2/img/neko');
xhr.send();
}
</script>
</body>
</html>

View File

@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>=INFO=</title>
<link rel="stylesheet" href="/style.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div class="content-blog"> <!--Yes i am reusing my CSS everywhere-->
<p><a href="https://purplebored.pl/">Return to main site.</a></br>===INFO===<p>
So this was my Second HTML project it's very basic and very simple. I did it to learn a lil bit more about APIs and JS. The website is using the NekoLife API.</br>
<center><img src="/oldprojects/neko/Screenshot.jpg" alt="A screenshot from the website."></center>
<center>Screenshot from the project ^^</center>
</div>
<footer>
<a class="clean">Purplebored &copy; 2023-2024 </a> | <a href="https://codeberg.org/Purplebored" target="_blank">My Codeberg</a> | <a href="https://github.com/PurpleBored" target="_blank">My Github</a> | <a href="/contact.html/" target="_blank">Contact Me</a> | </pre>
</footer>>
</body>
</html>