mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
Enhance rate limiting and mobile UI improvements for full mobile support!
Added new rate limiter policies "OneRequest" and "OneRequestPerIP" in `Program.cs`. Updated routing middleware and user authentication logic. Enhanced mobile navigation with a hamburger menu in multiple HTML files (`admin.html`, `user.html`, `archives.html`, `banned.html`, `error.html`, `login.html`, `paste.html`, `privatepaste.html`, `recent_pastes.html`). Introduced a notification system in `admin.html` and `login.html`. Updated CSS and JavaScript for better mobile responsiveness and user experience.
This commit is contained in:
+20
-3
@@ -40,6 +40,13 @@ class Program
|
|||||||
builder.Services.AddResponseCompression();
|
builder.Services.AddResponseCompression();
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services.AddRateLimiter(_ => _
|
||||||
|
.AddFixedWindowLimiter(policyName: "OneRequest", options =>
|
||||||
|
{
|
||||||
|
options.PermitLimit = 1;
|
||||||
|
options.QueueProcessingOrder = QueueProcessingOrder.OldestFirst;
|
||||||
|
options.QueueLimit = 2;
|
||||||
|
}));
|
||||||
builder.Services.AddRateLimiter(_ => _
|
builder.Services.AddRateLimiter(_ => _
|
||||||
.AddFixedWindowLimiter(policyName: "fixed", options =>
|
.AddFixedWindowLimiter(policyName: "fixed", options =>
|
||||||
{
|
{
|
||||||
@@ -56,6 +63,16 @@ class Program
|
|||||||
options.QueueProcessingOrder = QueueProcessingOrder.OldestFirst;
|
options.QueueProcessingOrder = QueueProcessingOrder.OldestFirst;
|
||||||
options.QueueLimit = 4;
|
options.QueueLimit = 4;
|
||||||
}));
|
}));
|
||||||
|
builder.Services.AddRateLimiter(options =>
|
||||||
|
{
|
||||||
|
options.AddPolicy("OneRequestPerIP", context =>
|
||||||
|
RateLimitPartition.GetConcurrencyLimiter(context.Request.Headers["X-Forwarded-For"].ToString() ?? context.Connection.RemoteIpAddress?.ToString() ?? "unknown", key => new ConcurrencyLimiterOptions
|
||||||
|
{
|
||||||
|
PermitLimit = 1,
|
||||||
|
QueueProcessingOrder = QueueProcessingOrder.OldestFirst,
|
||||||
|
QueueLimit = 1
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@@ -1477,7 +1494,7 @@ class Program
|
|||||||
string ip = context.Request.Headers["X-Forwarded-For"].ToString() ?? context.Connection.RemoteIpAddress.ToString();
|
string ip = context.Request.Headers["X-Forwarded-For"].ToString() ?? context.Connection.RemoteIpAddress.ToString();
|
||||||
string uploaderUUID = string.Empty;
|
string uploaderUUID = string.Empty;
|
||||||
string token = context.Request.Cookies["token"] ?? context.Request.Headers["Authorization"];
|
string token = context.Request.Cookies["token"] ?? context.Request.Headers["Authorization"];
|
||||||
|
var user = await GetLoggedInUserAsync(token);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(requestBody))
|
if (string.IsNullOrEmpty(requestBody))
|
||||||
{
|
{
|
||||||
@@ -1486,7 +1503,7 @@ class Program
|
|||||||
await context.Response.WriteAsJsonAsync(new JObject { ["error"] = "No content uploaded" }.ToString());
|
await context.Response.WriteAsJsonAsync(new JObject { ["error"] = "No content uploaded" }.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (await IsLoggedInAsync(token))
|
if (string.IsNullOrEmpty(user.UUID))
|
||||||
{
|
{
|
||||||
using (var connection = new SqliteConnection("Data Source=pastes.sqlite"))
|
using (var connection = new SqliteConnection("Data Source=pastes.sqlite"))
|
||||||
{
|
{
|
||||||
@@ -1497,7 +1514,7 @@ class Program
|
|||||||
var reader = await command.ExecuteReaderAsync();
|
var reader = await command.ExecuteReaderAsync();
|
||||||
await reader.ReadAsync();
|
await reader.ReadAsync();
|
||||||
uploaderUUID = reader.GetString(0);
|
uploaderUUID = reader.GetString(0);
|
||||||
var user = await GetLoggedInUserAsync(token);
|
|
||||||
if (user.State != 0)
|
if (user.State != 0)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 401;
|
context.Response.StatusCode = 401;
|
||||||
|
|||||||
+164
-7
@@ -15,6 +15,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="dash-container">
|
<div class="dash-container">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
@@ -36,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="idek-wrapper">
|
<div class="idek-wrapper accounts">
|
||||||
<div class="accounts-wrapper">
|
<div class="accounts-wrapper">
|
||||||
<h3>Accounts</h3>
|
<h3>Accounts</h3>
|
||||||
<input type="text" placeholder="search" class="text-input" oninput="waitSearch()">
|
<input type="text" placeholder="search" class="text-input" oninput="waitSearch()">
|
||||||
@@ -49,7 +62,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="notifcations-wrapper" id="notifications"></div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
let searchTimeout;
|
let searchTimeout;
|
||||||
@@ -67,7 +81,51 @@
|
|||||||
|
|
||||||
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
||||||
lastlogindateElement.innerText = "Last Login Date: " + localizeDateTime(parseInt(lastlogindateText));
|
lastlogindateElement.innerText = "Last Login Date: " + localizeDateTime(parseInt(lastlogindateText));
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
function createNotification(message) {
|
||||||
|
const notificationWrapper = document.getElementById('notifications');
|
||||||
|
const notificationDiv = document.createElement('div');
|
||||||
|
notificationDiv.classList.add('notification-div');
|
||||||
|
notificationDiv.id = 'notification';
|
||||||
|
|
||||||
|
const notificationText = document.createElement('h2');
|
||||||
|
notificationText.id = 'notification-text';
|
||||||
|
notificationText.innerText = message;
|
||||||
|
|
||||||
|
notificationDiv.appendChild(notificationText);
|
||||||
|
notificationWrapper.appendChild(notificationDiv);
|
||||||
|
|
||||||
|
notificationDiv.style.animation = 'none';
|
||||||
|
notificationDiv.style.display = 'none';
|
||||||
|
notificationDiv.style.display = 'flex';
|
||||||
|
notificationDiv.style.animation = 'hoverup 1s';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.style.animation = 'hoverdown 1s';
|
||||||
|
}, 4000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.remove();
|
||||||
|
}, 4900);
|
||||||
|
}
|
||||||
function waitSearch() {
|
function waitSearch() {
|
||||||
clearTimeout(searchTimeout);
|
clearTimeout(searchTimeout);
|
||||||
searchTimeout = setTimeout(search, 200);
|
searchTimeout = setTimeout(search, 200);
|
||||||
@@ -115,7 +173,7 @@
|
|||||||
const lastAccount = accounts[accounts.length - 1];
|
const lastAccount = accounts[accounts.length - 1];
|
||||||
const lastAccountUsername = lastAccount.querySelector('.list-item').innerText;
|
const lastAccountUsername = lastAccount.querySelector('.list-item').innerText;
|
||||||
const lastAccountUUID = lastAccount.querySelector('.list-item').getAttribute('data-uuid');
|
const lastAccountUUID = lastAccount.querySelector('.list-item').getAttribute('data-uuid');
|
||||||
var isScrolledDown = listContainer.scrollTop + listContainer.clientHeight >= listContainer.scrollHeight;
|
var isScrolledDown = listContainer.scrollTop + listContainer.clientHeight >= listContainer.scrollHeight - 100;
|
||||||
if (!isScrolledDown) {
|
if (!isScrolledDown) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -133,9 +191,9 @@
|
|||||||
if (data === '') {
|
if (data === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(listContainer.innerHTML);
|
if (listContainer.innerHTML.includes(data)) {
|
||||||
console.log(data);
|
return;
|
||||||
|
}
|
||||||
listContainer.innerHTML += data;
|
listContainer.innerHTML += data;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -186,7 +244,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-height: 80vh;
|
max-height: 100%;
|
||||||
min-height: 20%;
|
min-height: 20%;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
@@ -310,6 +368,50 @@
|
|||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -326,6 +428,61 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.dash-container{
|
||||||
|
height: 80%;
|
||||||
|
margin-top: 6rem;
|
||||||
|
}
|
||||||
|
.container-wrapper {
|
||||||
|
height: 90%;
|
||||||
|
}.wrapper {
|
||||||
|
height: 70%;
|
||||||
|
max-height: 70%;
|
||||||
|
}
|
||||||
|
.idek-wrapper {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.accounts{
|
||||||
|
max-height: 20%;
|
||||||
|
}
|
||||||
|
.account-info {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.pastes-wrapper {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.accounts-wrapper {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.list-container {
|
||||||
|
max-height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -15,6 +15,18 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="account-container">
|
<div class="account-container">
|
||||||
<div class="account-info">
|
<div class="account-info">
|
||||||
@@ -74,7 +86,25 @@
|
|||||||
if ('{typeban}' == 'unban') {
|
if ('{typeban}' == 'unban') {
|
||||||
document.getElementById('ban-date').style.display = 'none';
|
document.getElementById('ban-date').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
function banorunban() {
|
function banorunban() {
|
||||||
const banDiv = document.getElementById('ban-div');
|
const banDiv = document.getElementById('ban-div');
|
||||||
console.log(banDiv.style.display);
|
console.log(banDiv.style.display);
|
||||||
@@ -396,13 +426,13 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
width: 85%;
|
width: calc(100% - 40px);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: #222222;
|
background-color: #222222;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
margin-top: 26px;
|
margin-top: 10px;
|
||||||
height: 77.1%;
|
height: 77.1%;
|
||||||
max-height: 77.1%;
|
max-height: 77.1%;
|
||||||
}
|
}
|
||||||
@@ -428,6 +458,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #0d0d0d;
|
background-color: #0d0d0d;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
height: calc(100vh - 20px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
@@ -436,7 +467,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98.7vh;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-container {
|
.account-container {
|
||||||
@@ -449,8 +480,8 @@
|
|||||||
color: white;
|
color: white;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
max-height: 80vh;
|
margin-top: 6rem;
|
||||||
overflow-y: auto;
|
max-height: 100%;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,6 +495,7 @@
|
|||||||
width: 48%;
|
width: 48%;
|
||||||
max-width: 48%;
|
max-width: 48%;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-wrapper {
|
.action-wrapper {
|
||||||
@@ -472,7 +504,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
width: 85%;
|
width: calc(100% - 40px);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: #222222;
|
background-color: #222222;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@@ -508,6 +540,7 @@
|
|||||||
border: 2px solid #3a3a3a;
|
border: 2px solid #3a3a3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.nav-div {
|
.nav-div {
|
||||||
top: 0;
|
top: 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -527,6 +560,49 @@
|
|||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -543,6 +619,69 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container-wrapper{
|
||||||
|
height: 90%;
|
||||||
|
}
|
||||||
|
.account-container {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
.account-info {
|
||||||
|
margin-right: 0px;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 100%;
|
||||||
|
font-size: smaller !important;
|
||||||
|
}
|
||||||
|
.collumn-2 {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 48%;
|
||||||
|
}
|
||||||
|
.action-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 40%;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.pastes-wrapper {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: calc(500px * 1.5);
|
||||||
|
}
|
||||||
|
.pastes-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 20%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
text-align: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -15,6 +15,18 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="pastes-container">
|
<div class="pastes-container">
|
||||||
<h1>paste archive</h1>
|
<h1>paste archive</h1>
|
||||||
@@ -33,6 +45,28 @@
|
|||||||
<script>
|
<script>
|
||||||
let searchTimeout;
|
let searchTimeout;
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
clearTimeout(searchTimeout);
|
clearTimeout(searchTimeout);
|
||||||
searchTimeout = setTimeout(searchPastes, 200);
|
searchTimeout = setTimeout(searchPastes, 200);
|
||||||
@@ -233,6 +267,7 @@
|
|||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.nav-div {
|
.nav-div {
|
||||||
top: 0;
|
top: 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -252,6 +287,50 @@
|
|||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -268,6 +347,24 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.arrow-button {
|
.arrow-button {
|
||||||
min-width: fit-content !important;
|
min-width: fit-content !important;
|
||||||
|
|||||||
@@ -13,6 +13,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="error-container">
|
<div class="error-container">
|
||||||
<h1>Error {code}</h1>
|
<h1>Error {code}</h1>
|
||||||
@@ -31,7 +44,25 @@
|
|||||||
const dateElement = document.getElementById('unix-date');
|
const dateElement = document.getElementById('unix-date');
|
||||||
const time = localizeDateTime(parseInt(dateElement.innerText.trim()));
|
const time = localizeDateTime(parseInt(dateElement.innerText.trim()));
|
||||||
dateElement.innerText = time;
|
dateElement.innerText = time;
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body{
|
body{
|
||||||
@@ -103,6 +134,51 @@ body{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -113,10 +189,29 @@ body{
|
|||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
border: #2a2a2a00 2px solid;
|
border: #2a2a2a00 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div a:hover {
|
.nav-div a:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<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">
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap" rel="stylesheet">
|
||||||
<title>create paste</title>
|
<title>create paste</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="nav-div">
|
<div class="nav-div">
|
||||||
<a href="/">home</a>
|
<a href="/">home</a>
|
||||||
@@ -13,6 +15,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="dash-container">
|
<div class="dash-container">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
@@ -36,6 +51,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="notifcations-wrapper" id="notifications">
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
function localizeDateTime(unixTimestamp) {
|
function localizeDateTime(unixTimestamp) {
|
||||||
@@ -52,7 +69,51 @@
|
|||||||
|
|
||||||
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
||||||
lastlogindateElement.innerText = "Last Login Date: " + localizeDateTime(parseInt(lastlogindateText));
|
lastlogindateElement.innerText = "Last Login Date: " + localizeDateTime(parseInt(lastlogindateText));
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
function createNotification(message) {
|
||||||
|
const notificationWrapper = document.getElementById('notifications');
|
||||||
|
const notificationDiv = document.createElement('div');
|
||||||
|
notificationDiv.classList.add('notification-div');
|
||||||
|
notificationDiv.id = 'notification';
|
||||||
|
|
||||||
|
const notificationText = document.createElement('h2');
|
||||||
|
notificationText.id = 'notification-text';
|
||||||
|
notificationText.innerText = message;
|
||||||
|
|
||||||
|
notificationDiv.appendChild(notificationText);
|
||||||
|
notificationWrapper.appendChild(notificationDiv);
|
||||||
|
|
||||||
|
notificationDiv.style.animation = 'none';
|
||||||
|
notificationDiv.style.display = 'none';
|
||||||
|
notificationDiv.style.display = 'flex';
|
||||||
|
notificationDiv.style.animation = 'hoverup 1s';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.style.animation = 'hoverdown 1s';
|
||||||
|
}, 4000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.remove();
|
||||||
|
}, 4900);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -64,6 +125,7 @@ body{
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #0d0d0d;
|
background-color: #0d0d0d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -72,6 +134,7 @@ body{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98.7vh;
|
height: 98.7vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dash-container {
|
.dash-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@@ -83,12 +146,14 @@ body{
|
|||||||
height: 50%;
|
height: 50%;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.idek-wrapper {
|
.idek-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-info {
|
.account-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -101,6 +166,7 @@ body{
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pastes-wrapper {
|
.pastes-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -115,11 +181,13 @@ body{
|
|||||||
background-color: #222222;
|
background-color: #222222;
|
||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-a {
|
.list-a {
|
||||||
transition: background-color 300ms;
|
transition: background-color 300ms;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -135,14 +203,17 @@ body{
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
border: #3a3a3a00 2px solid;
|
border: #3a3a3a00 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-a:hover {
|
.list-a:hover {
|
||||||
transition: background-color 300ms;
|
transition: background-color 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-item {
|
.list-item {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div {
|
.nav-div {
|
||||||
top: 0;
|
top: 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -161,6 +232,51 @@ body{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -171,10 +287,63 @@ body{
|
|||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
border: #2a2a2a00 2px solid;
|
border: #2a2a2a00 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div a:hover {
|
.nav-div a:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.dash-container{
|
||||||
|
height: 80%;
|
||||||
|
margin-top: 6rem;
|
||||||
|
}
|
||||||
|
.container-wrapper {
|
||||||
|
height: 90%;
|
||||||
|
}.wrapper {
|
||||||
|
height: 70%;
|
||||||
|
max-height: 70%;
|
||||||
|
}
|
||||||
|
.idek-wrapper {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.accounts{
|
||||||
|
max-height: 20%;
|
||||||
|
}
|
||||||
|
.account-info {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.pastes-wrapper {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.list-container {
|
||||||
|
max-height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -13,6 +13,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="error-container">
|
<div class="error-container">
|
||||||
<h1>Error {code}</h1>
|
<h1>Error {code}</h1>
|
||||||
@@ -21,6 +34,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body{
|
body{
|
||||||
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
||||||
@@ -91,6 +126,51 @@ body{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -101,10 +181,29 @@ body{
|
|||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
border: #2a2a2a00 2px solid;
|
border: #2a2a2a00 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div a:hover {
|
.nav-div a:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</html>
|
</html>
|
||||||
@@ -26,14 +26,23 @@
|
|||||||
<h3 id="error-message"></h3>
|
<h3 id="error-message"></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="notifcations-wrapper" id="notifications">
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
let isLoggingIn = false;
|
||||||
document.getElementById("loginForm").addEventListener("submit", function (event) {
|
document.getElementById("loginForm").addEventListener("submit", function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
var usernameContent = document.getElementById("usernameInput").value;
|
var usernameContent = document.getElementById("usernameInput").value;
|
||||||
var passwordContent = document.getElementById("passwordInput").value;
|
var passwordContent = document.getElementById("passwordInput").value;
|
||||||
|
|
||||||
|
if (isLoggingIn) {
|
||||||
|
createNotification("Please wait for the login to finish.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isLoggingIn = true;
|
||||||
|
console.log(isLoggingIn);
|
||||||
var requestUrl = "/api/accounts/login";
|
var requestUrl = "/api/accounts/login";
|
||||||
fetch(requestUrl, {
|
fetch(requestUrl, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -45,11 +54,14 @@
|
|||||||
password: passwordContent
|
password: passwordContent
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(obj => {
|
.then(obj => {
|
||||||
const result = JSON.parse(obj);
|
const result = JSON.parse(obj);
|
||||||
|
isLoggingIn = true;
|
||||||
if (result.message != null) {
|
if (result.message != null) {
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
else if (result.error != null) {
|
else if (result.error != null) {
|
||||||
const errorElement = document.getElementById("error-message");
|
const errorElement = document.getElementById("error-message");
|
||||||
@@ -59,9 +71,36 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
errorElement.style.opacity = 0;
|
errorElement.style.opacity = 0;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
function createNotification(message) {
|
||||||
|
const notificationWrapper = document.getElementById('notifications');
|
||||||
|
const notificationDiv = document.createElement('div');
|
||||||
|
notificationDiv.classList.add('notification-div');
|
||||||
|
notificationDiv.id = 'notification';
|
||||||
|
|
||||||
|
const notificationText = document.createElement('h2');
|
||||||
|
notificationText.id = 'notification-text';
|
||||||
|
notificationText.innerText = message;
|
||||||
|
|
||||||
|
notificationDiv.appendChild(notificationText);
|
||||||
|
notificationWrapper.appendChild(notificationDiv);
|
||||||
|
|
||||||
|
notificationDiv.style.animation = 'none';
|
||||||
|
notificationDiv.style.display = 'none';
|
||||||
|
notificationDiv.style.display = 'flex';
|
||||||
|
notificationDiv.style.animation = 'hoverup 1s';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.style.animation = 'hoverdown 1s';
|
||||||
|
}, 4000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.remove();
|
||||||
|
}, 4900);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
@@ -215,5 +254,69 @@ body{
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes hoverup {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
25% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hoverdown {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateY(200%);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-div {
|
||||||
|
display: flex;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
|
color: white;
|
||||||
|
background-color: #181818;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.notifcations-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</html>
|
</html>
|
||||||
@@ -14,6 +14,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="paste-container">
|
<div class="paste-container">
|
||||||
<h1 id="paste-title" title="{pastetitleattribute}">{pastetitle}</h1>
|
<h1 id="paste-title" title="{pastetitleattribute}">{pastetitle}</h1>
|
||||||
@@ -64,7 +77,25 @@
|
|||||||
|
|
||||||
return read();
|
return read();
|
||||||
});
|
});
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
|
||||||
document.getElementById("copy-button").addEventListener("click", function () {
|
document.getElementById("copy-button").addEventListener("click", function () {
|
||||||
navigator.clipboard.writeText(document.querySelector(".paste-wrapper").innerText);
|
navigator.clipboard.writeText(document.querySelector(".paste-wrapper").innerText);
|
||||||
@@ -86,6 +117,7 @@
|
|||||||
</html>
|
</html>
|
||||||
<style>
|
<style>
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap');
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -203,6 +235,50 @@
|
|||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -219,4 +295,23 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -14,6 +14,18 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="paste-container">
|
<div class="paste-container">
|
||||||
<h1 id="paste-title" title="{pastetitleattribute}">{pastetitle}</h1>
|
<h1 id="paste-title" title="{pastetitleattribute}">{pastetitle}</h1>
|
||||||
@@ -79,8 +91,25 @@
|
|||||||
const creationdateText = creationdateElement.innerText.trim();
|
const creationdateText = creationdateElement.innerText.trim();
|
||||||
|
|
||||||
creationdateElement.innerText = localizeDateTime(parseInt(creationdateText));
|
creationdateElement.innerText = localizeDateTime(parseInt(creationdateText));
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
document.getElementById("copy-button").addEventListener("click", function () {
|
document.getElementById("copy-button").addEventListener("click", function () {
|
||||||
navigator.clipboard.writeText(document.querySelector(".paste-wrapper").innerText);
|
navigator.clipboard.writeText(document.querySelector(".paste-wrapper").innerText);
|
||||||
});
|
});
|
||||||
@@ -274,6 +303,7 @@
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.nav-div {
|
.nav-div {
|
||||||
top: 0;
|
top: 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -291,7 +321,50 @@
|
|||||||
height: fit-content;
|
height: fit-content;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
z-index: 102;
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
@@ -310,6 +383,24 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@keyframes hoverup {
|
@keyframes hoverup {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<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">
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap" rel="stylesheet">
|
||||||
<title>recent pastes</title>
|
<title>recent pastes</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="nav-div">
|
<div class="nav-div">
|
||||||
<a href="/">home</a>
|
<a href="/">home</a>
|
||||||
@@ -13,6 +15,19 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list"
|
||||||
|
viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="pastes-container">
|
<div class="pastes-container">
|
||||||
<h1>recent pastes</h1>
|
<h1>recent pastes</h1>
|
||||||
@@ -26,6 +41,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
font-family: "Noto Sans Mono", "Consolas", "SF Mono", monospace;
|
||||||
@@ -37,6 +74,7 @@ body{
|
|||||||
background-color: #0d0d0d;
|
background-color: #0d0d0d;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -45,6 +83,7 @@ body{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98.7vh;
|
height: 98.7vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pastes-container {
|
.pastes-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -59,6 +98,7 @@ body{
|
|||||||
min-height: 20%;
|
min-height: 20%;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pastes-wrapper {
|
.pastes-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -69,6 +109,7 @@ body{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pastes-wrapper a {
|
.pastes-wrapper a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -77,6 +118,7 @@ body{
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
@@ -89,11 +131,13 @@ li{
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: #22222200 2px solid;
|
border: #22222200 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
li:hover {
|
li:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-wrapper {
|
.buttons-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -102,6 +146,7 @@ li:hover{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-wrapper a {
|
.buttons-wrapper a {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -118,11 +163,13 @@ li:hover{
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: #22222200 2px solid;
|
border: #22222200 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-wrapper a:hover {
|
.buttons-wrapper a:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: 2px solid #3a3a3a;
|
border: 2px solid #3a3a3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div {
|
.nav-div {
|
||||||
top: 0;
|
top: 0;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@@ -141,6 +188,51 @@ li:hover{
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -151,10 +243,31 @@ li:hover{
|
|||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
border: #2a2a2a00 2px solid;
|
border: #2a2a2a00 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-div a:hover {
|
.nav-div a:hover {
|
||||||
transition: 300ms;
|
transition: 300ms;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -30,14 +30,24 @@
|
|||||||
<h3 id="error-message"></h3>
|
<h3 id="error-message"></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="notifcations-wrapper" id="notifications">
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
let isLoggingIn = false;
|
||||||
|
|
||||||
document.getElementById("signupForm").addEventListener("submit", function (event) {
|
document.getElementById("signupForm").addEventListener("submit", function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
var usernameContent = document.getElementById("usernameInput").value;
|
var usernameContent = document.getElementById("usernameInput").value;
|
||||||
var passwordContent = document.getElementById("passwordInput").value;
|
var passwordContent = document.getElementById("passwordInput").value;
|
||||||
|
|
||||||
|
if (isLoggingIn) {
|
||||||
|
createNotification("Please wait for the login to finish.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isLoggingIn = true;
|
||||||
|
|
||||||
var requestUrl = "/api/accounts/create";
|
var requestUrl = "/api/accounts/create";
|
||||||
fetch(requestUrl, {
|
fetch(requestUrl, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -54,6 +64,7 @@
|
|||||||
const result = JSON.parse(obj);
|
const result = JSON.parse(obj);
|
||||||
if (result.message != null) {
|
if (result.message != null) {
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
else if (result.error != null) {
|
else if (result.error != null) {
|
||||||
const errorElement = document.getElementById("error-message");
|
const errorElement = document.getElementById("error-message");
|
||||||
@@ -63,6 +74,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
errorElement.style.opacity = 0;
|
errorElement.style.opacity = 0;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -76,6 +88,32 @@
|
|||||||
var characterCount = passwordContent.length;
|
var characterCount = passwordContent.length;
|
||||||
document.getElementById("passcharacterCount").innerText = `${characterCount}/50`;
|
document.getElementById("passcharacterCount").innerText = `${characterCount}/50`;
|
||||||
});
|
});
|
||||||
|
function createNotification(message) {
|
||||||
|
const notificationWrapper = document.getElementById('notifications');
|
||||||
|
const notificationDiv = document.createElement('div');
|
||||||
|
notificationDiv.classList.add('notification-div');
|
||||||
|
notificationDiv.id = 'notification';
|
||||||
|
|
||||||
|
const notificationText = document.createElement('h2');
|
||||||
|
notificationText.id = 'notification-text';
|
||||||
|
notificationText.innerText = message;
|
||||||
|
|
||||||
|
notificationDiv.appendChild(notificationText);
|
||||||
|
notificationWrapper.appendChild(notificationDiv);
|
||||||
|
|
||||||
|
notificationDiv.style.animation = 'none';
|
||||||
|
notificationDiv.style.display = 'none';
|
||||||
|
notificationDiv.style.display = 'flex';
|
||||||
|
notificationDiv.style.animation = 'hoverup 1s';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.style.animation = 'hoverdown 1s';
|
||||||
|
}, 4000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
notificationDiv.remove();
|
||||||
|
}, 4900);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -255,6 +293,69 @@
|
|||||||
#button-margin-top {
|
#button-margin-top {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
@keyframes hoverup {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
25% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hoverdown {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateY(200%);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-div {
|
||||||
|
display: flex;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
|
color: white;
|
||||||
|
background-color: #181818;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.notifcations-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
+146
-3
@@ -15,6 +15,18 @@
|
|||||||
<a href="/archive">archive</a>
|
<a href="/archive">archive</a>
|
||||||
{html}
|
{html}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-hamburger-menu">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16" id="hamburger-button" style="cursor: pointer;">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" />
|
||||||
|
</svg>
|
||||||
|
<div class="nav-buttons">
|
||||||
|
<a href="/">home</a>
|
||||||
|
<a href="/pastes">recent pastes</a>
|
||||||
|
<a href="/archive">archive</a>
|
||||||
|
{html}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container-wrapper">
|
<div class="container-wrapper">
|
||||||
<div class="account-container">
|
<div class="account-container">
|
||||||
<div class="account-info">
|
<div class="account-info">
|
||||||
@@ -50,7 +62,25 @@
|
|||||||
const creationdateText = creationdateElement.innerText.trim();
|
const creationdateText = creationdateElement.innerText.trim();
|
||||||
|
|
||||||
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
creationdateElement.innerText = "Creation Date: " + localizeDateTime(parseInt(creationdateText));
|
||||||
|
var mobile = window.mobileCheck();
|
||||||
|
if (mobile) {
|
||||||
|
document.querySelector('.nav-div').style.display = 'none';
|
||||||
|
document.querySelector('.nav-hamburger-menu').style.display = 'flex';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById("hamburger-button").addEventListener("click", function () {
|
||||||
|
const nav = document.querySelector('.nav-buttons');
|
||||||
|
if (nav.style.display == 'none' || nav.style.display == '') {
|
||||||
|
nav.style.display = 'flex';
|
||||||
|
} else {
|
||||||
|
nav.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.mobileCheck = function () {
|
||||||
|
let check = false;
|
||||||
|
(function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
return check;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -61,6 +91,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #0d0d0d;
|
background-color: #0d0d0d;
|
||||||
|
height: calc(100vh - 20px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
@@ -69,7 +100,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98.7vh;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-container {
|
.account-container {
|
||||||
@@ -82,8 +113,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
max-height: 80vh;
|
max-height: 100%;
|
||||||
overflow-y: auto;
|
|
||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +127,7 @@
|
|||||||
width: 48%;
|
width: 48%;
|
||||||
max-width: 48%;
|
max-width: 48%;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -184,6 +215,50 @@
|
|||||||
border: #222222 2px solid;
|
border: #222222 2px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 99vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #181818;
|
||||||
|
color: white;
|
||||||
|
height: fit-content;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: #222222 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #222222;
|
||||||
|
transition: 300ms;
|
||||||
|
border: #2a2a2a00 2px solid;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a:hover {
|
||||||
|
transition: 300ms;
|
||||||
|
background-color: #333333;
|
||||||
|
border: #3a3a3a 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-div a {
|
.nav-div a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -200,6 +275,74 @@
|
|||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
border: #3a3a3a 2px solid;
|
border: #3a3a3a 2px solid;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.nav-div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-hamburger-menu {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container-wrapper{
|
||||||
|
margin-top: calc(90% - 180px);
|
||||||
|
padding-bottom: 50px;
|
||||||
|
height: 90%;
|
||||||
|
}
|
||||||
|
.account-container {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
.account-info {
|
||||||
|
margin-right: 0px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-width: 100%;
|
||||||
|
font-size: smaller !important;
|
||||||
|
}
|
||||||
|
.collumn-2 {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 48%;
|
||||||
|
}
|
||||||
|
.action-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 40%;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.pastes-wrapper {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 97%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: calc(500px * 1.5 - 260px);
|
||||||
|
}
|
||||||
|
.pastes-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 90%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
text-align: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user