mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
Enhanced Program.cs with response caching, compression, CORS policy, and private paste handling. Refactored user ban logic and added expiration date handling. Improved admin.html with localization and overflow handling. Introduced PrivatePaste and Punishment classes. Enhanced Paste and User classes for private pastes and punishments. Updated initialization logic for punishedUsers table. Ensured salts are written back to config.json if generated. Enhanced user.html with ban/unban functionality and animations. Improved archives.html, dash.html, and index.html with new UI elements and styles. Added asynchronous content loading and notifications to paste.html. Introduced Encryption.cs for AES encryption and decryption. Created banned.html for displaying error messages. Added privatepaste.html with dynamic content, password protection, and user interactions.
280 lines
7.4 KiB
HTML
280 lines
7.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap" rel="stylesheet">
|
|
<title>archive</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="nav-div">
|
|
<a href="/">home</a>
|
|
<a href="/pastes">recent pastes</a>
|
|
<a href="/archive">archive</a>
|
|
{html}
|
|
</div>
|
|
<div class="container-wrapper">
|
|
<div class="pastes-container">
|
|
<h1>paste archive</h1>
|
|
<input type="text" placeholder="search" class="text-input" oninput="search()">
|
|
<div class="pastes-wrapper">
|
|
{pastes}
|
|
<a title="" href="/yZXC7EmRpexG"><li>Untitled 46 2.1 hrs ago 488.28KB</li></a>
|
|
</div>
|
|
<div class="buttons-wrapper">
|
|
<a class="arrow-button" href="/archive?page={backpagenum}"><</a>
|
|
<p>{currentpagenum}/{totalpages}</p>
|
|
<a class="arrow-button" href="/archive?page={pagenum}">></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
let searchTimeout;
|
|
|
|
function search() {
|
|
clearTimeout(searchTimeout);
|
|
searchTimeout = setTimeout(searchPastes, 200);
|
|
}
|
|
|
|
function searchPastes() {
|
|
const searchInput = document.querySelector('.text-input');
|
|
if (searchInput.value.length < 3 && searchInput.value.length != 0) {
|
|
return;
|
|
}
|
|
else if (searchInput.value.length == 0) {
|
|
fetch(`/api/pastes/search?html=true`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
query: ''
|
|
})
|
|
})
|
|
.then(response => response.text())
|
|
.then(data => {
|
|
const pastesWrapper = document.querySelector('.pastes-wrapper');
|
|
if (data === '') {
|
|
pastesWrapper.innerHTML = '<h1>no pastes found</h1>';
|
|
return;
|
|
}
|
|
try {
|
|
json = JSON.parse(data);
|
|
if (json.error != null) {
|
|
pastesWrapper.innerHTML = `<h1>${json.error}</h1>`;
|
|
return;
|
|
}
|
|
}
|
|
catch {
|
|
}
|
|
|
|
pastesWrapper.innerHTML = data;
|
|
});
|
|
return;
|
|
}
|
|
fetch(`/api/pastes/search?html=true`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
query: searchInput.value
|
|
})
|
|
})
|
|
.then(response => response.text())
|
|
.then(data => {
|
|
const pastesWrapper = document.querySelector('.pastes-wrapper');
|
|
if (data === '') {
|
|
pastesWrapper.innerHTML = '<h1>no pastes found</h1>';
|
|
return;
|
|
}
|
|
try {
|
|
json = JSON.parse(data);
|
|
if (json.error != null) {
|
|
pastesWrapper.innerHTML = `<h1>${json.error}</h1>`;
|
|
return;
|
|
}
|
|
}
|
|
catch {
|
|
}
|
|
pastesWrapper.innerHTML = data;
|
|
});
|
|
}
|
|
</script>
|
|
<style>
|
|
body {
|
|
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
|
font-weight: bold;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
background-color: #0d0d0d;
|
|
overflow-y: hidden;
|
|
}
|
|
|
|
.container-wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100vh;
|
|
}
|
|
|
|
.pastes-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
width: 80%;
|
|
padding: 20px;
|
|
background-color: #181818;
|
|
color: white;
|
|
border-radius: 5px;
|
|
height: fit-content;
|
|
max-height: 80vh;
|
|
min-height: 20%;
|
|
border: #222222 2px solid;
|
|
transition: height 300ms;
|
|
}
|
|
|
|
.pastes-wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
width: 100%;
|
|
padding: 20px;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
max-height: 70vh;
|
|
}
|
|
|
|
|
|
|
|
li {
|
|
transition: 300ms;
|
|
list-style: none;
|
|
padding: 10px;
|
|
margin: 10px;
|
|
background-color: #222222;
|
|
border-radius: 5px;
|
|
width: 100%;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
border: #22222200 2px solid;
|
|
}
|
|
|
|
li:hover {
|
|
transition: 300ms;
|
|
background-color: #333333;
|
|
border: #3a3a3a 2px solid;
|
|
}
|
|
|
|
.buttons-wrapper {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: 100%;
|
|
padding: 20px;
|
|
}
|
|
|
|
.buttons-wrapper a {
|
|
transition: 300ms;
|
|
text-decoration: none;
|
|
color: white;
|
|
width: fit-content;
|
|
margin-left: 10px;
|
|
margin-right: 10px;
|
|
min-width: 20%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
background-color: #222222;
|
|
border-radius: 5px;
|
|
padding: 10px;
|
|
border: #22222200 2px solid;
|
|
}
|
|
|
|
.buttons-wrapper a:hover {
|
|
transition: 300ms;
|
|
background-color: #333333;
|
|
border: 2px solid #3a3a3a;
|
|
}
|
|
|
|
.pastes-wrapper a {
|
|
text-decoration: none;
|
|
color: white;
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.text-input {
|
|
transition: border 300ms;
|
|
width: calc(100% - 44px);
|
|
height: 1.2rem;
|
|
padding: 10px;
|
|
margin: 10px;
|
|
margin-left: 12px;
|
|
border-radius: 5px;
|
|
border: #222222 2px solid;
|
|
background-color: #222222;
|
|
color: white;
|
|
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
|
}
|
|
|
|
.text-input:focus {
|
|
transition: border 300ms;
|
|
outline: none;
|
|
border: #3a3a3a 2px solid;
|
|
}
|
|
|
|
.nav-div {
|
|
top: 0;
|
|
margin-top: 10px;
|
|
position: absolute;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: fit-content;
|
|
background-color: #181818;
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
color: white;
|
|
border-radius: 5px;
|
|
height: fit-content;
|
|
overflow-y: auto;
|
|
border: #222222 2px solid;
|
|
}
|
|
|
|
.nav-div a {
|
|
text-decoration: none;
|
|
color: white;
|
|
padding: 10px;
|
|
margin: 10px;
|
|
border-radius: 5px;
|
|
background-color: #222222;
|
|
transition: 300ms;
|
|
border: #2a2a2a00 2px solid;
|
|
}
|
|
|
|
.nav-div a:hover {
|
|
transition: 300ms;
|
|
background-color: #333333;
|
|
border: #3a3a3a 2px solid;
|
|
}
|
|
|
|
.arrow-button {
|
|
min-width: fit-content !important;
|
|
padding-left: 1rem !important;
|
|
padding-right: 1rem !important;
|
|
}
|
|
</style>
|
|
|
|
</html> |