/guestbook, /autist, font changes and a new /projects entry

This commit is contained in:
zyqunix 2024-12-02 19:57:07 +01:00
parent edc8589d1d
commit 8fc3faf8bb
41 changed files with 400 additions and 101 deletions

35
guestbook/fetch.js Normal file
View file

@ -0,0 +1,35 @@
fetch('https://corsproxy.io/?https%3A%2F%2Fusers2.smartgb.com%2Fg%2Fg.php%3Fa%3Ds%26i%3Dg26-39906-27')
.then(response => response.text())
.then(html => {
let parser = new DOMParser();
let doc = parser.parseFromString(html, 'text/html');
let entries = doc.querySelectorAll('table[bgcolor="#F4F4F4"]');
entries.forEach(entry => {
let dateElement = entry.querySelector('tr > td > font > b');
let date = dateElement && dateElement.textContent.includes('Date:') ? dateElement.textContent.replace('Date:', '').trim() : 'No date';
let name = entry.querySelector('tr:nth-child(2) td:nth-child(2)') ? entry.querySelector('tr:nth-child(2) td:nth-child(2)').textContent.trim() : 'No name';
let email = entry.querySelector('tr:nth-child(3) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(3) td:nth-child(2) a').textContent.trim() : 'No email';
let web = entry.querySelector('tr:nth-child(4) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(4) td:nth-child(2) a').textContent.trim() : 'No website';
let number = entry.querySelector('tr:nth-child(5) td:nth-child(2)') ? entry.querySelector('tr:nth-child(5) td:nth-child(2)').textContent.trim() : 'No number';
let message = entry.querySelector('.divmess') ? entry.querySelector('.divmess').textContent.trim() : 'No message';
let guestbookEntry = document.createElement('div');
guestbookEntry.classList.add('guestbook-entry');
guestbookEntry.innerHTML = `
<p><strong>Date:</strong> ${date}</p>
<p><strong>Name:</strong> ${name}</p>
<p><strong>Email:</strong> <a href="mailto:${email}">${email}</a></p>
<p><strong>Website:</strong> <a href="${web}" target="_blank">${web}</a></p>
<p><strong>Number:</strong> ${number}</p>
<p><strong>Message:</strong> ${message}</p>
<hr>
`;
document.getElementById('guestbook-container').appendChild(guestbookEntry);
});
})
.catch(error => {
document.getElementById('guestbook-container').innerHTML = `Error fetching the guestbook: ${error}`;
});

20
guestbook/index.html Normal file
View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="https://rimgo.pussthecat.org/RFbdMMB.png" type="image/x-icon">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<title>Guestbook</title>
</head>
<body>
<h1>Guestbook from <a href="https://users2.smartgb.com/g/g.php?a=s&i=g26-39906-27">SmartGB</a></h1>
<div id="guestbook-container"></div>
<div id="error"></div>
<script src="fetch.js"></script>
</body>
</html>

92
guestbook/style.css Normal file
View file

@ -0,0 +1,92 @@
@font-face {
font-family: 'Hack';
src: url('/Fonts/Hack/Hack-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'JetBrainsMono';
src: url('/Fonts/JetBrainsMono/JetBrainsMono-Regular.woff2');
}
body {
background-color: #505050;
font-family: 'JetBrainsMono', 'Hack', monospace;
margin: 20px 40px 20px 40px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
padding: 20px;
flex-direction: column;
font-size: large;
}
::selection {
color: white;
background-color: #b49cdf;
}
* {
color: white;
}
.guestbook-entry {
margin-bottom: 20px;
padding: 10px;
border: 2px solid #707070;
background-color: #606060;
max-width: 50vw;
text-align: left;
border-radius: 8px;
}
.guestbook-entry p {
margin: 5px 0;
}
a {
color: #b49cdf;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.guestbook-entry a:hover {
text-decoration: underline;
}
@media (max-width: 1200px) {
.guestbook-entry {
max-width: 60vw;
}
body {
margin: 20px;
}
}
@media (max-width: 768px) {
body {
font-size: medium;
}
.guestbook-entry {
max-width: 80vw;
}
}
@media (max-width: 480px) {
body {
font-size: small;
margin: 10px;
}
.guestbook-entry {
max-width: 90vw;
padding: 8px;
}
}