Bug fixes and a shit ton of new content!
This commit is contained in:
BIN
oldprojects/neko/Screenshot.jpg
Normal file
BIN
oldprojects/neko/Screenshot.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
99
oldprojects/neko/index.html
Normal file
99
oldprojects/neko/index.html
Normal file
@@ -0,0 +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>
|
||||
</html>
|
||||
21
oldprojects/neko/info.html
Normal file
21
oldprojects/neko/info.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!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 © 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>
|
||||
Reference in New Issue
Block a user