Changed the file structure to make it more readable and removed the file endings in urls

This commit is contained in:
ION606
2022-10-11 08:38:45 -04:00
parent 5a34a4cbab
commit 1f717bf78e
10 changed files with 53 additions and 50 deletions
+72
View File
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Selmer Bot Web Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script>
window.onload = () => {
var counter = document.getElementById('counter');
var countTime = 0;
const interval = setInterval(function() {
counter.innerText = countTime;
if (countTime >= 404) {
clearInterval(interval);
} else {
countTime += 4;
}
}, 0);
}
</script>
<style>
h1 {
text-align: center;
margin-top: 30vh;
font-size: 50px;
}
h2 {
font-size: 20px;
text-align: center;
}
body {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/257418/andy-holmes-698828-unsplash.jpg);
background-size: cover;
background-repeat: no-repeat;
min-height: 70vh;
min-width: 100vw;
font-family: "Roboto Mono", "Liberation Mono", Consolas, monospace;
color: white;
}
button {
color: #79edf7;
background-color: #000000;
font-size: 19px;
border: 1px solid #2d63c8;
padding: 15px 50px;
cursor: pointer;
margin-top: 100px;
}
button:hover {
color: #2d63c8;
}
</style>
</head>
<body class="text-center">
<h1 id="counter"></h1>
<h2>You look a little lost...</h2>
<h2>The page you're looking for can't be found!</h2>
<button onclick="window.location='/'">HOME</button>
</body>
</html>
+277
View File
@@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* SUBMIT BUTTON START */
.submitButton{
position: relative;
background-color: black;
border-radius: 4em;
font-size: 16px;
color: white;
padding: 0.8em 1.8em;
cursor:pointer;
user-select:none;
text-align: center;
text-decoration: none;
cursor: pointer;
transition-duration: 0.4s;
/* margin-left: 65px; */
margin-left: 30px;
margin-bottom: 40px;
-webkit-transition-duration: 0.4s; /* Safari */
}
.submitButton:hover {
transition-duration: 0.1s;
background-color: #3A3A3A;
}
.submitButton:after {
content: "";
display: block;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
width: 100%;
height: 100%;
opacity: 0;
transition: all 0.5s;
box-shadow: 0 0 10px 40px white;
}
.submitButton:active:after {
box-shadow: 0 0 0 0 white;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
opacity: 1;
transition: 0s;
}
.submitButton:active {
top: 1px;
}
.btnActive {
color: #ffffff;
background-color: #ff1117;
font-size: 13px;
border: 1px solid #000000;
border-radius: 9px;
padding: 10px 40px;
letter-spacing: 1px;
cursor: pointer;
margin-left: 40px;
}
.btnCanceled {
color: #ffffff;
background-color: #7a7a7a;
font-size: 13px;
border: 1px solid #000000;
border-radius: 9px;
padding: 10px 40px;
letter-spacing: 1px;
cursor: pointer;
margin-left: 40px;
}
/* SUBMIT BUTTON END */
.newEvtBtn {
margin-left: 40px;
color: #ffffff;
background-color: #0cdc01;
font-size: 16px;
border-radius: 4em;
padding: 0.8em 1.8em;
cursor: pointer
}
.newEvtBtn:hover {
color: #6e6e6e;
background-color: #14fe07;
}
</style>
<style>
body {
background-color: rgb(59, 58, 58);
}
.evtclass {
margin-bottom: 50px;
color: white;
line-height: 23px;
}
.evtclass a {
color: rgb(0, 250, 237);
}
.evtclass a:active {
color: rgb(255, 0, 255);
}
</style>
<script>
window.onbeforeunload = function(){
window.close();
};
window.onload = () => {
if (!window.sessionStorage.getItem('evlist')) { return; }
const d = new Date();
document.title = `Editing ${d.getMonth()}/${sessionStorage.getItem('day')}/${d.getFullYear()}`;
window.sessionStorage.setItem('delObjKeys', JSON.stringify([]));
const evlist = JSON.parse(window.sessionStorage.getItem('evlist'));
var b = document.getElementById('main');
var div = document.createElement('div');
for (ind in evlist) {
for (i in evlist[ind]) {
if (i === 'time' || i === '_id' || i === 'amt') { continue; }
const ev = evlist[ind][i];
let p = document.createElement("p");
let link = document.createElement('a');
link.href = ev.link; //unnecessary?
link.innerText = ev.link;
link.onclick = function(event) { event.preventDefault(); window.open(ev.link, '_blank'); }
const timeFull = new Date(Number(evlist[ind].time) + (Number(ev.offset)) * 60000);
var time = [timeFull.getHours().toString(), timeFull.getMinutes().toString()];
//Make sure it looks like 01:08 and not 1:8
if (time[0].length < 2) { time[0] = `0${time[0]}` }
if (time[1].length < 2) { time[1] = `0${time[1]}` }
p.innerText = `Name: ${ev.name}\nDescription: ${ev.description}\nTime: ${time[0]}:${time[1]}\nOffset: ${ev.offset}\nLocation: ${ev.location}\nLink: `;
p.appendChild(link);
// p.style = 'color: green; margin-bottom: 50px;';
p.className = 'evtclass';
//Add buttons
let b = document.createElement('button');
b.id = `${evlist[ind].time}|${i}|${ind}`;
b.className = 'btnActive';
b.innerText = "Cancel";
b.onclick = function() {
const id = this.id.split("|");
var sstor = JSON.parse(sessionStorage.getItem('evlist'));
var delObjKeys = JSON.parse(sessionStorage.getItem('delObjKeys'));
//The keys are the same as in the cloud, sort by time and remove by key
delObjKeys.push({time: id[0], eventInd: id[1]});
delete sstor[id[2]][id[1]];
sstor[id[2]].amt --; //Maybe useless (perhaps sstor is never used again)?
sessionStorage.setItem('evlist', JSON.stringify(sstor));
sessionStorage.setItem('delObjKeys', JSON.stringify(delObjKeys));
b.className = 'btnCanceled';
b.innerText = "Cancelled";
b.onclick = function() { alert("This event has already been cancelled!"); }
}
p.appendChild(document.createElement('br'));
p.appendChild(document.createElement('br'));
p.appendChild(b);
div.appendChild(p);
// div.appendChild(document.createElement('p').style = 'margin-top=100px;');
}
}
var newbtn = document.createElement('button');
newbtn.className = 'newEvtBtn';
newbtn.innerText = "Create New Event";
newbtn.onclick = function() {
// event.preventDefault();
const day = Number(sessionStorage.getItem('day'));
createCalEvent(day)
}
b.appendChild(div);
document.getElementById('btns').appendChild(newbtn);
};
</script>
<!-- DUPLICATE OF ANOTHER PAGE WILL NOT LINK -->
<script>
function sendData(event, inp) {
event.preventDefault();
var serverSettings = JSON.parse(window.sessionStorage.getItem('serverInfo'));
window.opener.location.reload();
if (inp.inp == 'cal') {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
xhrsess.onloadend = (e) => {
const sessionData = JSON.parse(xhrsess.response);
var userId = JSON.parse(sessionData.userId);
const delObjKeys = sessionStorage.getItem('delObjKeys');
if (sessionStorage.getItem('ref') == 'guild') {
userId = serverSettings.Id;
}
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/sendData/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader(`reminders`, true);
xhr.setRequestHeader(`delObjKeys`, delObjKeys);
xhr.onloadend = (e) => {
console.log(e);
alert("Saved!");
window.close();
};
xhr.send();
}
xhrsess.send();
}
}
async function createCalEvent(day) {
// event.preventDefault();
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent.html','newCalPopWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { alert("Your browser has JavaScript Disabled!"); return w.close(); }
w.sessionStorage.setItem("day", day);
w.location.reload();
// w.document.write('<title>Editing ${(' + String(day) + ')}</title>');
});
}
</script>
</head>
<body>
<div id="main" style="margin-left: 20px;"></div>
<!-- NOTHING IN HERE -->
<div id="btns" style="margin-top: 75px;">
<input type="submit" value="Submit" class="submitButton" onclick="sendData(event, { 'inp': 'cal' })">
</div>
</body>
</html>
+577
View File
@@ -0,0 +1,577 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<span id="IMPORTS">
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://js.stripe.com/v3/"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel&family=Rajdhani:wght@300&family=Rouge+Script&family=Share+Tech+Mono&display=swap" rel="stylesheet">
</span>
<title>Selmer Bot Web Dashboard</title>
<style>
html { width:100%; height:100%; margin:0; padding:0; }
body {
/* background-color: rgb(4, 4, 85); */
background-color: rgb(41, 42, 48);
width:100%; height:100%; margin:0; padding:0;
}
/* .dropdown a:hover { background-color: #ddd; } */
.show { display: block; }
.hide { display: none; }
.loadingscreen {
height: 90vh;
background-color: bisque;
z-index: 100;
}
.navbar {
background-color: rgb(0, 0, 0);
/* height: 50px;
border-width: 1px;
border-style: double; */
}
.navbar .nav-item {
margin-right: 25px;
margin-left: 25px;
}
#right {
float: right;
margin-right: 50px;
}
.box {
font-size: 20px;
height: 40px;
width: auto;
margin-bottom: 15px;
padding: 3px;
border: 1px solid black;
clear: both;
align-content: center;
margin-right: 30px;
margin-left: 30px;
}
.statusdiv {
border-style: dashed;
border-color: rgb(247, 189, 0);
width: 140px;
height: 120px;
margin-top: 20px;
float: right;
margin-right: 50px;
text-align: center;
}
.saved {
background-color: rgb(11, 184, 11);
}
.saving {
background-color: orange;
}
.failed {
background-color: red;
}
.buttonsmainbar {
background-color: green;
width: 200px;
height: 60px;
}
.btnmain {
background-color: rgb(0, 0, 0);
}
.sidebar {
background-color: #42424b;
width: 11%;
position: fixed;
top: 75px;
bottom: 0;
display: flex;
flex-wrap: wrap;
border: 0px;
border-right: 2px;
border-color: black;
border-style: solid;
}
.wc {
align-content: center;
align-self: center;
color: white;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
letter-spacing: 1px;
}
.lg {
align-content: center;
align-self: center;
color: white;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
letter-spacing: 1px;
}
.form-select {
width: 200px;
background-color:rgb(187, 183, 183);
border-color: #000000;
}
</style>
<!-- Buttons -->
<style>
.jumpButton {
/* color: #ffffff; */
font-size: 15px;
border: 1px solid #000000;
width: 200px;
height: 40px;
cursor: pointer;
align-self: center;
background-color: rgb(2, 2, 192);
}
.jumpButton:hover {
color: #2d63c8;
/* background-color: #ffffff; */
}
/* SUBMIT BUTTON START */
.submitButton{
position: relative;
background-color: black;
border-radius: 4em;
font-size: 16px;
color: white;
padding: 0.8em 1.8em;
cursor:pointer;
user-select:none;
text-align: center;
text-decoration: none;
cursor: pointer;
transition-duration: 0.4s;
-webkit-transition-duration: 0.4s; /* Safari */
}
.submitButton:hover {
transition-duration: 0.1s;
background-color: #3A3A3A;
}
.submitButton:after {
content: "";
display: block;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
width: 100%;
height: 100%;
opacity: 0;
transition: all 0.5s;
box-shadow: 0 0 10px 40px white;
}
.submitButton:active:after {
box-shadow: 0 0 0 0 white;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
opacity: 1;
transition: 0s;
}
.submitButton:active {
top: 1px;
}
/* SUBMIT BUTTON END */
.logoutbtn {
margin-top: 14px;
scale: 1.4;
}
.logoutbtn:hover {
cursor: pointer;
color: red;
}
#sevradio br {
margin-top: 10px;
}
.btnside {
color: #ffffff;
background-color: #42424b;
font-size: 19px;
/* border: 2px solid #000000; */
outline: none;
border: none;
width: 100%;
height: 50px;
cursor: pointer;
}
.btnside:hover {
color: #ffffff;
background-color: #377aea;
}
.helpbtn {
margin-top: 30px;
margin-bottom: 30px;
font-size: 20px;
align-self: right;
padding: 0px;
border-radius: 50%;
border-style: solid;
}
.calbtn {
width: 100px;
height: 70px;
}
.green {
background-color: rgb(6, 185, 6);
}
.red {
background-color: rgb(129, 129, 129);
}
.uploadLabel {
border: 1px solid #ccc;
display: inline-block;
padding: 7px 15px;
cursor: pointer;
border-radius: 5px;
background-color: rgb(13, 179, 179);
scale: 1.5;
margin-top: 50px;
}
.uploadButton {
display: none;
}
</style>
<!-- Calendar -->
<script>
async function openNewCalWindow(evjs, day) {
const ev = JSON.parse(evjs);
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/calEvent.html','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
w.sessionStorage.setItem("evlist", evjs);
w.sessionStorage.setItem('day', day);
w.sessionStorage.setItem('ref', 'user');
w.location.reload();
w.document.write('<title>Editing ${(new Date(Number(ev.time)))}</title>');
})
}
async function createCalEvent(day) {
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent.html','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
w.sessionStorage.setItem("day", day);
w.sessionStorage.setItem("ref", 'user');
w.location.reload();
// w.document.write('<title>Editing ${(' + String(day) + ')}</title>');
});
}
//Month + 1 because the 0 will set the date back a month
function daysInMonth (d) {
return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();
}
function calSetup(calList) {
const d = new Date((new Date()).getFullYear(), (new Date()).getMonth());
const startDay = new Date(d.getFullYear(), d.getMonth(), 1).getDay() + 1;
var cal = document.getElementById('calbody');
var tr = document.createElement('tr');
var dayint = 1;
const ll = daysInMonth(d);
for (let i = 1; i <= 42; i ++) {
var td = document.createElement('td');
if (i >= startDay && dayint <= ll) {
let btn = document.createElement('button');
btn.innerText = dayint.toString();
btn.classList.add('calbtn');
if (calList.has(Number(dayint.toString()))) { btn.classList.add('green'); }
else { btn.classList.add('red'); }
btn.onclick = function(event) {
const timestamp = new Date(new Date().getFullYear(), new Date().getMonth(), Number(this.innerText));
event.preventDefault();
if (calList.has(Number(this.innerText))) {
const ev = calList.get(Number(this.innerText));
openNewCalWindow(JSON.stringify(ev), Number(this.innerText));
} else {
// Check if the day has already passed
if (Number(this.innerText) >= (new Date()).getDate()) {
createCalEvent(Number(this.innerText));
} else {
alert("Please pick a future date!");
}
}
}
td.appendChild(btn);
dayint ++;
}
tr.appendChild(td);
if (i % 7 == 0) {
let tr2 = document.createElement('tr');
cal.appendChild(tr);
cal.appendChild(tr2);
tr2 = document.createElement('tr');
tr = document.createElement('tr');
}
}
cal.appendChild(tr);
if (window.innerWidth < 1020) {
//Calendar resize
const calSpacing = document.getElementById("spaceId");
calSpacing.cellSpacing = 1;
calSpacing.cellPadding = 1;
}
document.getElementById('calHeader').style = "";
}
</script>
<script>
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
//Reminder that this will return a map of strings (you'll have to use JSON.parse() again)
xhrsess.onloadend = (e) => {
resolve(JSON.parse(xhrsess.response));
}
xhrsess.send();
});
}
window.onload = () => {
var sessionId = window.localStorage.getItem('sessionId');
if (!sessionId) {
alert("Please log in to continue");
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
//Get serverId
// const id = serverSettings.Id; // window.localStorage.getItem('Id').toString();
const session = getSessionData();
session.then((sessionInfo) => {
const id = sessionInfo.userId;
//Check if the user has premium
var xhrverify = new XMLHttpRequest();
xhrverify.open('post', 'https://www.selmerbot.com/verifypremium/', true);
xhrverify.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
xhrverify.setRequestHeader('userId', id);
xhrverify.onloadend = (e) => {
if (xhrverify.response == "Unauthorized") {
document.getElementById("unauth").style.display = "block";
return;
}
var xhr2 = new XMLHttpRequest();
xhr2.open('get', 'https://www.selmerbot.com/getCal/', true);
xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
xhr2.setRequestHeader('userId', id);
// //import ics file
// const form = document.createElement("span");
// const label = document.createElement("label");
// label.innerText = "Upload File";
// label.className = "inpBtn";
// document.getElementsByTagName("body")[0].appendChild(label);
// const uploadICS = document.createElement('input');
// uploadICS.type = "file";
// form.appendChild(uploadICS);
// document.getElementsByTagName("body")[0].appendChild(form);
xhr2.onloadend = (e) => {
const calList = new Map();
const res = JSON.parse(xhr2.response);
const times = res[0];
const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
document.getElementById('monthName').innerText = `Editing Reminders for the Month of ${monthNames[(new Date()).getMonth()]}`;
times.forEach((time, ind) => {
const fullDate = new Date(Number(time));
const month = fullDate.getMonth();
const day = fullDate.getDate();
//Make sure it's the right month (old ones should be removed, this is just a catch)
if (month == (new Date()).getMonth()) {
if (calList.has(day)) {
var temp = calList.get(day);
temp.push(res[1][ind]);
calList.set(day, temp);
} else {
calList.set(day, [res[1][ind]]);
}
}
});
calSetup(calList);
}
xhr2.send();
}
xhrverify.send();
});
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-fixed-top">
<div class="container-fluid mx-auto">
<a class="navbar-brand" href="/">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="width: 50px;">
</a>
<!-- <li class="nav-item">
<a href="index.html" style="color: white" class="nav-link"><i class="fa-solid fa-house-chimney", alt="Home" style="scale: 2;"></i></a>
</li> -->
<ul class="navbar-nav">
<li class="nav-item">
<a href="myGuilds" id="guildslink" class="nav-link"><i class="fa-solid fa-server" alt="Servers" style="scale: 2; color: rgb(11, 189, 189);"></i></a>
</li>
<li class="nav-item">
<a href="calendar" id="callink" class="nav-link"><i class="fa-solid fa-calendar" alt="Calendar" style="scale: 2; color: lightgrey;"></i></a>
</li>
<li class="nav-item">
<a href="https://docs.selmerbot.com" target="_blank" class="nav-link"><i class="fa-solid fa-book" style="scale: 2; color: white;" alt="WIKI"></i></a>
</li>
<li class="nav-item">
<a href="premium" class="nav-link"><i class="fa-solid fa-crown" style="scale: 2; color: gold;" alt="PREMIUM"></i></a>
</li>
<li class="nav-item">
<a href="team" class="nav-link"><i class="fa-solid fa-user-gear" style="scale: 2; color: rgb(12, 216, 5);" alt="AUTHOR"></i></a>
</li>
</ul>
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button> -->
<div class="container" style="font-family: 'Rajdhani', sans-serif; color: white;"><h1>Selmer Bot Web Dashboard</h1></div>
<span class="ms-auto" style="margin-right: 1%;">
<button onclick="logout()" id="logoutbtn" class="logoutbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
</span>
</div>
</nav>
<div id="cal" class="wc" style="margin-top: 20px;">
<h1 id="monthName" style="text-align: center; margin-top: 50px; margin-bottom: 25px;"></h1>
<form>
<table id="spaceId" style="background-color: lightgrey;"
cellspacing="15" cellpadding="15" class="mx-auto">
<caption style="caption-side: top;"></caption>
<div id="unauth" style="display: none;" class="text-center">
<h1 style="margin-bottom: 20px;">You have to be a premium subscriber to use this feature!</h1>
<h3 style="margin-bottom: 50px;">vvv GET PREMIUM NOW vvv</h3>
<a href="premium"><i class="fa-solid fa-crown" style="scale: 4; color: gold;" alt="PREMIUM"></i></a>
</div>
<thead>
<tr id="calHeader" style="display: none;">
<th style="color: white; background: purple;">
Sun</th>
<th style="color: white; background: purple;">
Mon</th>
<th style="color: white; background: purple;">
Tue</th>
<th style="color: white; background: purple;">
Wed</th>
<th style="color: white; background: purple;">
Thu</th>
<th style="color: white; background: purple;">
Fri</th>
<th style="color: white; background: purple;">
Sat</th>
</tr>
</thead>
<tbody id="calbody" style="color: black;">
</tbody>
</table>
</form>
</body>
</html>
+897
View File
@@ -0,0 +1,897 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Selmer Bot Web Dashboard</title>
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel&family=Rajdhani:wght@300&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<style>
html { width:100%; height:100%; margin:0; padding:0; }
body {
/* background-color: rgb(4, 4, 85); */
background-color: rgb(41, 42, 48);
width:100%; height:100%; margin:0; padding:0;
}
/* .dropdown a:hover { background-color: #ddd; } */
.show { display: block; }
.hide { display: none; }
.loadingscreen {
height: 90vh;
background-color: bisque;
z-index: 100;
}
.navbar {
background-color: rgb(0, 0, 0);
/* height: 50px;
border-width: 1px;
border-style: double; */
}
.navbar .nav-item {
margin-right: 25px;
margin-left: 25px;
}
#right {
float: right;
margin-right: 50px;
}
.box {
font-size: 20px;
height: 40px;
width: auto;
margin-bottom: 15px;
padding: 3px;
border: 1px solid black;
clear: both;
align-content: center;
margin-right: 30px;
margin-left: 30px;
}
.statusdiv {
border-style: dashed;
border-color: rgb(247, 189, 0);
width: 140px;
height: 120px;
margin-top: 20px;
float: right;
margin-right: 50px;
text-align: center;
}
.saved {
background-color: rgb(11, 184, 11);
}
.saving {
background-color: orange;
}
.failed {
background-color: red;
}
.buttonsmainbar {
background-color: green;
width: 200px;
height: 60px;
}
.btnmain {
background-color: rgb(0, 0, 0);
}
.sidebar {
background-color: #42424b;
width: 11%;
position: fixed;
top: 75px;
bottom: 0;
display: flex;
flex-wrap: wrap;
border: 0px;
border-right: 2px;
border-color: black;
border-style: solid;
}
.wc {
align-content: center;
align-self: center;
color: white;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
letter-spacing: 1px;
}
.lg {
align-content: center;
align-self: center;
color: white;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
letter-spacing: 1px;
}
.form-select {
width: 200px;
background-color:rgb(187, 183, 183);
border-color: #000000;
}
.ardpd {
color: inherit;
background-color: rgba(85, 83, 83, 0.2);
}
.ardpd:focus-visible {
color: white;
}
</style>
<!-- Buttons -->
<style>
.jumpButton {
/* color: #ffffff; */
font-size: 15px;
border: 1px solid #000000;
width: 200px;
height: 40px;
cursor: pointer;
align-self: center;
background-color: rgb(2, 2, 192);
}
.jumpButton:hover {
color: #2d63c8;
/* background-color: #ffffff; */
}
/* SUBMIT BUTTON START */
.submitButton{
position: relative;
background-color: black;
border-radius: 4em;
font-size: 16px;
color: white;
padding: 0.8em 1.8em;
cursor:pointer;
user-select:none;
text-align: center;
text-decoration: none;
cursor: pointer;
transition-duration: 0.4s;
-webkit-transition-duration: 0.4s; /* Safari */
}
.submitButton:hover {
transition-duration: 0.1s;
background-color: #3A3A3A;
}
.submitButton:after {
content: "";
display: block;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
width: 100%;
height: 100%;
opacity: 0;
transition: all 0.5s;
box-shadow: 0 0 10px 40px white;
}
.submitButton:active:after {
box-shadow: 0 0 0 0 white;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
opacity: 1;
transition: 0s;
}
.submitButton:active {
top: 1px;
}
/* SUBMIT BUTTON END */
.logoutbtn {
margin-top: 14px;
scale: 1.4;
}
.logoutbtn:hover {
cursor: pointer;
color: red;
}
#sevradio br {
margin-top: 10px;
}
.btnside {
color: #ffffff;
background-color: #42424b;
font-size: 19px;
/* border: 2px solid #000000; */
outline: none;
border: none;
width: 100%;
height: 50px;
cursor: pointer;
}
.btnside:hover {
color: #ffffff;
background-color: #377aea;
}
.helpbtn {
margin-top: 30px;
margin-bottom: 30px;
font-size: 20px;
align-self: right;
padding: 0px;
border-radius: 50%;
border-style: solid;
}
.calbtn {
width: 100px;
height: 70px;
}
.green {
background-color: rgb(6, 185, 6);
}
.red {
background-color: rgb(129, 129, 129);
}
</style>
<!-- Calendar -->
<script>
async function openNewCalWindow(evjs, day) {
const ev = JSON.parse(evjs);
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/calEvent.html','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
w.sessionStorage.setItem("evlist", evjs);
w.sessionStorage.setItem('day', day);
w.sessionStorage.setItem('ref', 'guild');
w.sessionStorage.setItem('serverInfo', window.sessionStorage.getItem('serverInfo'));
w.location.reload();
w.document.write('<title>Editing ${(new Date(Number(ev.time)))}</title>');
})
// w.location.reload();
}
async function createCalEvent(day) {
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent.html','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
w.sessionStorage.setItem("day", day);
w.sessionStorage.setItem('ref', 'guild');
w.sessionStorage.setItem('serverInfo', window.sessionStorage.getItem('serverInfo'));
w.location.reload();
// w.document.write('<title>Editing ${(' + String(day) + ')}</title>');
});
}
//Month + 1 because the 0 will set the date back a month
function daysInMonth (d) {
return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();
}
function calSetup(calList) {
const d = new Date((new Date()).getFullYear(), (new Date()).getMonth());
const startDay = new Date(d.getFullYear(), d.getMonth(), 1).getDay() + 1;
var cal = document.getElementById('calbody');
var tr = document.createElement('tr');
var dayint = 1;
const ll = daysInMonth(d);
for (let i = 1; i <= 42; i ++) {
var td = document.createElement('td');
if (i >= startDay && dayint <= ll) {
let btn = document.createElement('button');
btn.innerText = dayint.toString();
btn.classList.add('calbtn');
if (calList.has(Number(dayint.toString()))) { btn.classList.add('green'); }
else { btn.classList.add('red'); }
btn.onclick = function(event) {
const timestamp = new Date(new Date().getFullYear(), new Date().getMonth(), Number(this.innerText));
event.preventDefault();
if (calList.has(Number(this.innerText))) {
const ev = calList.get(Number(this.innerText));
openNewCalWindow(JSON.stringify(ev), Number(this.innerText));
} else {
// Check if the day has already passed
if (Number(this.innerText) >= (new Date()).getDate()) {
createCalEvent(Number(this.innerText));
} else {
alert("Please pick a future date!");
}
}
}
td.appendChild(btn);
dayint ++;
}
tr.appendChild(td);
if (i % 7 == 0) {
let tr2 = document.createElement('tr');
cal.appendChild(tr);
cal.appendChild(tr2);
tr2 = document.createElement('tr');
tr = document.createElement('tr');
}
}
cal.appendChild(tr);
if (window.innerWidth < 1020) {
//Calendar resize
const calSpacing = document.getElementById("spaceId");
calSpacing.cellSpacing = 1;
calSpacing.cellPadding = 1;
}
}
</script>
<script>
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
//Reminder that this will return a map of strings (you'll have to use JSON.parse() again)
xhrsess.onloadend = (e) => {
resolve(JSON.parse(xhrsess.response));
}
xhrsess.send();
});
}
//Maybe pre-load the channels in the server into local storage for accessing when chosing the welcome/logging channels?
window.onload = () => {
const serverInfoPromise = getSessionData();
serverInfoPromise.then((sessionInfo) => {
const serverInfo = JSON.parse(sessionInfo.currentServer);
var serverSettings = JSON.parse(serverInfo.serverSettings);
if (!serverSettings) {
alert("Please log in to continue");
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=code&scope=identify%20guilds';
}
}
//Get serverId instead of the userId
const id = serverInfo.Id;
//Check if the user has premium
var xhrverify = new XMLHttpRequest();
xhrverify.open('post', 'https://www.selmerbot.com/verifypremium/', true);
xhrverify.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
xhrverify.setRequestHeader('userId', id);
xhrverify.onloadend = (e) => {
// //Load the channels
// var xhr = new XMLHttpRequest();
// xhr.open('get', `https://www.selmerbot.com/getChannels/`, true);
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
// xhr.setRequestHeader('serverNumber', id);
// xhr.onloadend = (e) => {
//Channel Section
const channels = JSON.parse(serverInfo.channels);
const roles = JSON.parse(serverInfo.roles);
// console.log(channels.text);
// window.localStorage.setItem('channels', (xhr.response));
for (let i = 0; i < channels.text.length; i ++) {
var channel = channels.text[i];
if (channel.name && channel.id) {
var optlog = document.createElement('option');
optlog.value = channel.id;
optlog.innerHTML = channel.name;
//I need two because if I try to append the same one, it only appends to one dorpdown
var optwelcome = document.createElement('option');
optwelcome.value = channel.id;
optwelcome.innerHTML = channel.name;
var optann = document.createElement('option');
optann.value = channel.id;
optann.innerHTML = channel.name;
if (serverSettings.WELCOME.welcomechannel == optwelcome.value) {
optwelcome.setAttribute('selected', '');
}
if (serverSettings.LOG.logchannel == optlog.value) {
optlog.setAttribute('selected', '');
// optlog.selected = serverSettings.LOG.logchannel;
}
if (serverSettings.announcement.channel == optann.value) {
optann.setAttribute('selected', '');
}
document.getElementById('logchanneldropdown').appendChild(optlog);
document.getElementById('welcomechanneldropdown').appendChild(optwelcome);
document.getElementById('achanneldropdown').appendChild(optann);
}
}
const ard = document.getElementById('aroledropdown');
roles.forEach((role) => {
var opt = document.createElement('option');
opt.value = role.Id;
opt.innerHTML = role.name;
// opt.style += `background-color: ${role.color + '33'};`;
if (role.color == '#000000') {
opt.style = 'color: white';
}
else {
opt.style = `color: ${role.color}; background-color: ${role.color + '33'};`;
}
if (serverSettings.announcement.role == role.Id) {
opt.setAttribute('selected', '');
}
ard.appendChild(opt);
});
// document.getElementById('body').classList.replace('hide', 'show');
//Welcome section
let wc = serverSettings.WELCOME.welcomechannel || '';
let wm = serverSettings.WELCOME.welcomemessage || '';
// document.getElementById('wc').setAttribute('value', wc);
document.getElementById('wm').setAttribute('value', wm);
//Logging section ,"LOG":{"_id":"LOG","keepLogs":false,"logchannel":null,"severity":0}}
let kl = serverSettings.LOG.keepLogs || false;
let lc = serverSettings.LOG.logchannel || '';
let ls = serverSettings.LOG.severity || 0;
document.getElementById('kl').checked = kl;
// document.getElementById('lc').setAttribute('value', lc);
// document.getElementById('ls').children[ls].checked = true; //Doesn't work
// }
// xhr.send();
//#region Calendar
if (xhrverify.response == "Unauthorized") {
document.getElementById("calForm").style.display = "none";
document.getElementById("unauth").style.display = "block";
return;
} else if (xhrverify.response == 'Internal Server Error') {
alert("Uh oh, an Internal Server Error has occured!\nPlease try again!");
return window.location.href = "/";
}
var xhr2 = new XMLHttpRequest();
xhr2.open('get', 'https://www.selmerbot.com/getCal/', true);
xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr2.setRequestHeader('guildId', id);
xhr2.onloadend = (e) => {
const calList = new Map();
const res = JSON.parse(xhr2.response); console.log(res, typeof res);
const times = res[0];
const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
document.getElementById('monthName').innerText = `Editing Reminders for the Month of ${monthNames[(new Date()).getMonth()]}`;
times.forEach((time, ind) => {
const fullDate = new Date(Number(time));
const month = fullDate.getMonth();
const day = fullDate.getDate();
//Make sure it's the right month (old ones should be removed, this is just a catch)
if (month == (new Date()).getMonth()) {
if (calList.has(day)) {
var temp = calList.get(day);
temp.push(res[1][ind]);
calList.set(day, temp);
} else {
calList.set(day, [res[1][ind]]);
}
}
});
calSetup(calList);
}
xhr2.send();
//#endregion
}
xhrverify.send();
});
}
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
xhr.onloadend = (e) => {
window.localStorage.clear();
window.sessionStorage.clear();
window.location.href = '/';
}
xhr.send();
}
</script>
<script>
function loadWelcomePage() {
document.getElementById('welcome').classList.replace('hide', 'show');
}
function loadLoggingPage() {
document.getElementById('log').classList.replace('hide', 'show');
}
function divChange(c1) {
// document.getElementById("mainDropdown").classList.toggle("show");
var divchildren = document.getElementById('inputs').children;
//Hide the divs we don't need
for (let i = 0; i < divchildren.length; i++) {
var d2 = document.getElementById(divchildren[i].id);
if (!d2.classList.contains('hide')) { d2.classList.add('hide'); }
}
//Show the div we want
var d1 = document.getElementById(c1);
d1.classList.toggle("hide");
}
function sendData(event, inp) {
event.preventDefault();
//Change saving status
var b = document.getElementById('savstat');
b.classList.replace('saved', 'saving');
b.innerText = 'SAVING';
const sessionInfoPromise = getSessionData();
sessionInfoPromise.then((sessionInfo) => {
var serverInfo = JSON.parse(sessionInfo.currentServer);
// var serverInfo = JSON.parse(window.sessionStorage.getItem('serverInfo'));
var serverSettings = JSON.parse(serverInfo.serverSettings);
if (inp.inp == 'logs') {
const ls = document.getElementsByName('ls');
var sevname = '';
for (i in ls) {
if (ls[i].checked) { sevname = ls[i].id.substring(3); }
}
const sevlist = ['none', 'low', 'meduim', 'high']
serverSettings.LOG.severity = sevlist.indexOf(sevname);
serverSettings.LOG.logchannel = document.getElementById('logchanneldropdown').value || null;
let kl = false;
if (document.getElementById('kl').checked) {
kl = true;
}
serverSettings.LOG.keepLogs = kl;
} else if (inp.inp == 'announcement') {
serverSettings.announcement.channel = document.getElementById('achanneldropdown').value || null;
serverSettings.announcement.role = document.getElementById('aroledropdown').value || null;
console.log(serverSettings.announcement);
} else {
serverSettings.WELCOME.welcomechannel = document.getElementById('welcomechanneldropdown').value || null;
serverSettings.WELCOME.welcomemessage = document.getElementById('wm').value || null;
}
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/sendData/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverSettings', JSON.stringify(serverSettings));
xhr.onloadend = (e) => {
if (xhr.response == 'DONE') {
//Change the current server data
var xhrs = new XMLHttpRequest();
xhrs.open('post', 'https://www.selmerbot.com/setCurrentServer/', true);
xhrs.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrs.setRequestHeader('serverNumber', serverInfo.Id);
xhrs.setRequestHeader('sessionid', window.localStorage.getItem("sessionId"));
xhrs.onloadend = (e) => {
if (xhrs.response != 'OK') { alert("Uh Oh! There's been a problem!\nError Code: " + xhrs.response); }
b.classList.replace('saving', 'saved');
b.innerText = 'SAVED';
window.sessionStorage.setItem('serverInfo', JSON.stringify(serverSettings));
window.location.reload();
}
xhrs.send();
} else {
b.classList.replace('saving', 'failed');
b.innerText = 'FAILED';
}
}
xhr.send(JSON.stringify(serverSettings));
});
}
function createDropDown(sect) {
if (sect == 'welcome') {
$("#alertWelcome").slideDown(500);
} else if (sect == 'logs') {
$("#alertLogs").slideDown(500);
}
console.log(sect);
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-fixed-top">
<div class="container-fluid mx-auto">
<a class="navbar-brand" href="/">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="width: 50px;">
</a>
<ul class="navbar-nav">
<li class="nav-item">
<a href="myGuilds" id="guildslink" class="nav-link"><i class="fa-solid fa-server" alt="Servers" style="scale: 2; color: rgb(11, 189, 189);"></i></a>
</li>
<li class="nav-item">
<a href="calendar" id="callink" class="nav-link"><i class="fa-solid fa-calendar" alt="Calendar" style="scale: 2; color: lightgrey;"></i></a>
</li>
<li class="nav-item">
<a href="https://docs.selmerbot.com" target="_blank" class="nav-link"><i class="fa-solid fa-book" style="scale: 2; color: white;" alt="WIKI"></i></a>
</li>
<li class="nav-item">
<a href="premium" class="nav-link"><i class="fa-solid fa-crown" style="scale: 2; color: gold;" alt="PREMIUM"></i></a>
</li>
<li class="nav-item">
<a href="team" class="nav-link"><i class="fa-solid fa-user-gear" style="scale: 2; color: rgb(12, 216, 5);" alt="AUTHOR"></i></a>
</li>
</ul>
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button> -->
<div class="container" style="font-family: 'Rajdhani', sans-serif; color: white;"><h1>Selmer Bot Web Dashboard</h1></div>
<span class="ms-auto" style="margin-right: 1%;">
<button onclick="logout()" id="logoutbtn" class="logoutbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
</span>
</div>
</nav>
<div id="help_alerts">
<div class="row custom-alert" style="display: none;" id="alertWelcome">
<div class="alert alert-warning alert-dismissible" id="banner" style="text-align: center" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<!--<strong class="mx-auto"></strong> -->Use {sn} to insert the server name, {un} to insert the user name, and {ut} to insert the user tag<br><i>Example: Welcome to {sn} Sir {un}#{ut}</i>
</div>
</div>
<div class="row custom-alert" style="display: none;" id="alertLogs">
<div class="alert alert-warning alert-dismissible" id="banner" style="text-align: center" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<!-- <strong class="mx-auto">Logged In Successfully!</strong> -->When setting the log severity, setting the tier will also include all higher tiers<br><i>For example, using !setup log_severity none will log things from every severity</i>
</div>
</div>
</div>
<div class="statusdiv">
<h2 style="color: white; margin-bottom: 10px; margin-top: 10px;">STATUS</h2>
<div id="savstat" class="box saved">SAVED</div>
</div>
<div class="sidebar">
<div id="buttons" class="buttonsmainbar">
<button onclick="divChange('welcome')" class="btnside">Welcome</button>
<button onclick="divChange('log')" class="btnside">Logging</button>
<button onclick="divChange('cal')" class="btnside">Calendar</button>
</div>
</div>
<!-- EVERYTHING NOT SIDEBAR -->
<div style="margin-left:15%">
<div id="inputs">
<div id="welcome", class="hide wc" style="margin-top: 20px;">
<button id="whbtn" class="helpbtn" onclick="createDropDown('welcome')"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.downloadclipart.net%2Flarge%2F45627-icon-with-question-mark-clipart.png&f=1&nofb=1" style="width: 50px; border-radius: 50%; border-style: solid;"></button>
<form>
<label for="wc">Welcome Channel Name:</label>
<select id="welcomechanneldropdown" class="form-select mb-5" aria-label="Default select example">
<option selected=""></option>
</select>
<label for="wm">Welcome Message:</label>
<input type="text" id="wm" name="wm"><br><br>
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event, { 'inp': 'welcome' })">
</form>
</div>
<div id="log", class="hide lg">
<button class="helpbtn" onclick="createDropDown('logs')"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.downloadclipart.net%2Flarge%2F45627-icon-with-question-mark-clipart.png&f=1&nofb=1" style="width: 50px; border-radius: 50%; border-style: solid;"></button>
<form>
<label for="kl">Keep Logs?</label>
<input type="checkbox" id="kl" name="kl"><br><br>
<label class="ps-1" for="lc">Log Channel Name:</label>
<select id="logchanneldropdown" class="form-select mb-5" aria-label="Default select example">
<option selected=""></option>
</select>
<div id="sevradio">
<p style="margin-bottom: 0px; text-underline-offset: 2px;"><u>Log Severity</u></p>
<label for="ls-none" style="margin-top: 0px;">None</label>
<input type="radio" id="ls-none" name="ls"><br>
<label for="ls-low">Low</label>
<input type="radio" id="ls-low" name="ls"><br>
<label for="ls-meduim">Medium</label>
<input type="radio" id="ls-meduim" name="ls"><br>
<label for="ls-high">High</label>
<input type="radio" id="ls-high" name="ls"><br><br>
</div>
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event, { 'inp': 'logs' })">
</form>
</div>
<div id="cal", class="hide wc" style="margin-top: 20px;">
<div id="unauth" class="text-center" style="display: none;">
<h1 style="margin-bottom: 20px;">You have to be a premium subscriber to use this feature!</h1>
<h3 style="margin-bottom: 50px;">vvv GET PREMIUM NOW vvv</h3>
<a href="premium"><i class="fa-solid fa-crown" style="scale: 4; color: gold;" alt="PREMIUM"></i></a>
</div>
<h1 id="monthName", style="text-align: center; margin-top: 50px; margin-bottom: 25px;"></h1>
<form id="calForm">
<table id="spaceId" style="background-color: lightgrey;"
cellspacing="15" cellpadding="15" class="mx-auto">
<!-- The tr tag is used to enter
rows in the table -->
<!-- It is used to give the heading to the
table. We can give the heading to the
top and bottom of the table -->
<caption align="top">
<!-- Here we have used the attribute
that is style and we have colored
the sentence to make it better
depending on the web page-->
</caption>
<!-- Here th stands for the heading of the
table that comes in the first row-->
<!-- The text in this table header tag will
appear as bold and is center aligned-->
<thead>
<tr>
<!-- Here we have applied inline style
to make it more attractive-->
<th style="color: white; background: purple;">
Sun</th>
<th style="color: white; background: purple;">
Mon</th>
<th style="color: white; background: purple;">
Tue</th>
<th style="color: white; background: purple;">
Wed</th>
<th style="color: white; background: purple;">
Thu</th>
<th style="color: white; background: purple;">
Fri</th>
<th style="color: white; background: purple;">
Sat</th>
</tr>
</thead>
<tbody id="calbody" style="color: black;">
</tbody>
</table><br><br>
<label for="ardpd" style="margin-top: 30px;">Select your event ping role</label>
<select id="aroledropdown" name="ardpd" class="form-select mb-5 ardpd" aria-label="Default select example">
<option selected=""></option>
</select>
<label class="ps-1" for="acd">Event Channel Name:</label>
<select id="achanneldropdown" name="acd" class="form-select mb-5">
<option selected=""></option>
</select>
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event, { 'inp': 'announcement' })">
</form>
</div>
</div>
</div>
</body>
</html>
+610
View File
@@ -0,0 +1,610 @@
<!DOCTYPE html>
<!-- MAKE SURE THE PERSON CAN'T CHANGE THE SERVER NUMBER AND ACCESS RANDOM SERVERS -->
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Discord embed start -->
<title>Website Name</title>
<meta content="Selmer Bot Web Dashboard" property="og:title" />
<meta content="A web dashboard for Selmer Bot (still in Beta)" property="og:description" />
<meta content="https://www.selmerbot.com" property="og:url" />
<meta content="https://raw.githubusercontent.com/ION606/selmer-bot-website/main/assets/favicon.ico" property="og:image" />
<meta content="#050089" data-react-helmet="true" name="theme-color" />
<meta name="twitter:card" content="summary_large_image">
<!-- Discord embed end -->
<title>Selmer Bot Web Dashboard</title>
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@300&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- <script type="text/javascript" src="main.js"></script> -->
<style>
html { width:100%; height:100%; margin:0; padding:0; }
body {
background-color: rgb(41, 42, 48);
/* background-color: rgb(1, 1, 59); */
width:100%; height:100%; margin:0; padding:0;
}
.loginbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
}
.loginbtn:hover {
color: #377aea;
}
.tooltip {
position: relative;
display: inline-block;
cursor: default;
}
.tooltip .tooltiptext {
visibility: hidden;
padding: 0.25em 0.5em;
background-color: black;
color: #fff;
text-align: center;
border-radius: 0.25em;
white-space: nowrap;
/* Position the tooltip */
position: absolute;
z-index: 1;
top: 100%;
left: 100%;
transition-property: visibility;
transition-delay: 0s;
}
.tooltip:hover .tooltiptext {
visibility: visible;
transition-delay: 0.3s;
}
nav {
background-color: rgb(0, 0, 0);
/* color: blue; */
/* text-align: center; */
}
.navbar .nav-item {
margin-right: 25px;
margin-left: 25px;
}
#right {
float: right;
margin-right: 50px;
}
.logoutbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
/* float: right; */
}
.logoutbtn:hover {
cursor: pointer;
color: red;
}
.desctext {
/* float:left; */
color: white;
/* margin-left: 50px; */
margin-top: 20px;
background-color: rgb(1, 69, 196, 0.1);
padding: 20px;
border-radius: 10%;
width: auto;
}
/*************************
CAROUSEL
*************************/
.carousel .carousel-inner {
height: 550px;
margin-top: 20px;
margin-bottom: 100px;
background: #faf9f9;
border:1px solid rgb(94, 104, 104);
}
.carousel-control.right,
.carousel-control.left {
background-image: none;
}
.control-icon {
color: #393939;
text-shadow: none;
}
.carousel-inner {
position: relative;
height: 300px;
}
.carousel-img {
/* width: 200px;
height: 400px; */
background-size: cover;
position: relative;
/* top: 50px; */
transform: translateY(5%);
}
.cat-title {
text-shadow: none;
}
.item{
position: relative;
}
.navbar-fixed-top {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
top: 0;
}
</style>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> (no github icon so...) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
function generateRandomString() {
let randomString = '';
const randomNumber = Math.floor(Math.random() * 10);
for (let i = 0; i < 20 + randomNumber; i++) {
randomString += String.fromCharCode(33 + Math.floor(Math.random() * 94));
}
return randomString;
}
window.onload = () => {
// createBody();
const fragment = new URLSearchParams(window.location.hash.slice(1));
const [accessToken, tokenType, state] = [fragment.get('access_token'), fragment.get('token_type'), fragment.get('state')];
if (!accessToken && !window.localStorage.getItem('sessionId')) {
const randomString = generateRandomString();
localStorage.setItem('oauth-state', randomString);
document.getElementById('guildslink').href = '';
document.getElementById('guildslink').style = 'cursor: no-drop;';
// $(".custom-alert").slideUp(0);
// document.getElementById('login').href += `&state=${encodeURIComponent(btoa(randomString))}`;
// return document.getElementById('login').style.display = 'block';
} else if (!accessToken && window.localStorage.getItem('sessionId')) {
//The user is already logged in
document.getElementById('loginbtn').style.display = 'none'
document.getElementById('logoutbtn').style.display = "block";
}
if (localStorage.getItem('oauth-state') !== atob(decodeURIComponent(state))) {
console.log('You may have been click-jacked!');
}
fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `${tokenType} ${accessToken}`,
},
})
.then(result => result.json())
.then(response => {
// document.getElementById('TEMP').innerText = response.toString();
// console.log(response);
const { id, username, discriminator } = response;
window.sessionStorage.setItem('Id', id);
// console.log(guilds);
// document.getElementById('info').innerText += ` ${username}#${discriminator}`;
// window.location = `http://:53134/user?id=${id}`;
})
.catch(console.error);
//Guilds section
fetch('https://discord.com/api/users/@me/guilds', {
// method: 'POST',
headers: {
authorization: `${tokenType} ${accessToken}`,
}
}).then(response => {
response.json().then((result) => {
const owned = result.filter((inp) => { return (inp.owner); });
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/user/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('guilds', JSON.stringify(owned));
xhr.setRequestHeader('userId', window.sessionStorage.getItem('Id'));
xhr.onloadend = (e) => {
//No need
window.localStorage.removeItem("Id");
window.localStorage.setItem('sessionId', xhr.response);
document.getElementById('alertrow').style = "";
window.location.href = "/";
//Too far down, user can't see it
// $(".custom-alert").slideDown(500);
// window.setTimeout(function() {
// $(".custom-alert").slideUp(500, function() {
// $(this).remove();
// window.location.href = "index.html";
// });
// }, 5000);
}
xhr.send(JSON.stringify(owned));
}).then((r) => {
});
})
.catch(console.error);
}
</script>
<script>
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://www.selmerbot.com/ -->
function getAPIRedirect() {
if (window.location.href.indexOf('localhost') != -1) {
return 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
// return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
xhr.onloadend = (e) => {
window.localStorage.clear();
window.sessionStorage.clear();
window.location.href = '/';
}
xhr.send();
}
</script>
<script>
// function createBody() {
// var temp = document.getElementById("mainTemplate");
// var clon = temp.content.cloneNode(true);
// document.body.appendChild(clon);
// }
</script>
</head>
<body>
<!-- Nav Bar -->
<nav class="navbar navbar-expand-sm navbar-fixed-top">
<div class="container-fluid mx-auto">
<a class="navbar-brand" href="/">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="width: 50px;">
</a>
<!-- <li class="nav-item">
<a href="index.html" style="color: white" class="nav-link"><i class="fa-solid fa-house-chimney", alt="Home" style="scale: 2;"></i></a>
</li> -->
<ul class="navbar-nav">
<li class="nav-item">
<a href="myGuilds" id="guildslink" class="nav-link"><i class="fa-solid fa-server" alt="Servers" style="scale: 2; color: rgb(11, 189, 189);"></i></a>
</li>
<li class="nav-item">
<a href="calendar" id="callink" class="nav-link"><i class="fa-solid fa-calendar" alt="Calendar" style="scale: 2; color: lightgrey;"></i></a>
</li>
<li class="nav-item">
<a href="https://docs.selmerbot.com" target="_blank" class="nav-link"><i class="fa-solid fa-book" style="scale: 2; color: white;" alt="WIKI"></i></a>
</li>
<li class="nav-item">
<a href="premium" class="nav-link"><i class="fa-solid fa-crown" style="scale: 2; color: gold;" alt="PREMIUM"></i></a>
</li>
<li class="nav-item">
<a href="team" class="nav-link"><i class="fa-solid fa-user-gear" style="scale: 2; color: rgb(12, 216, 5);" alt="AUTHOR"></i></a>
</li>
</ul>
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button> -->
<div class="container" style="font-family: 'Rajdhani', sans-serif; color: white;"><h1>Selmer Bot Web Dashboard</h1></div>
<span class="ms-auto" style="margin-right: 1%;">
<!-- <button id="login" class="loginbtn" onclick="window.location = getAPIRedirect()">Log Into Dashboard</button> -->
<button onclick="logout()" id="logoutbtn" class="logoutbtn" style="display: none;"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
<button onclick="window.location = getAPIRedirect()" id="loginbtn" class="loginbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log In"></i></button>
</span>
</div>
</nav>
<!-- NAVBAR END -->
<!-- Header Begin -->
<!-- https://livewire.thewire.in/wp-content/uploads/2018/09/ekg-line-ekg-monitor-ekg-machine-heart-health-blue-ecg-monitor-shows-the-heart-beat-the-heart-stops-for-three-seconds-and-starts-again_nelyjny6x__F0000.png -->
<div class="row w-100 h-100" style="background-image: url('https://github.com/ION606/selmer-bot-website/blob/main/assets/Header%20BK.gif?raw=true'); background-size: cover; background-repeat: no-repeat;">
<div class="row w-100" style="color: rgb(10, 169, 243); text-align: center">
<h1 style="margin-top: 100px; -webkit-text-stroke: 2px rgb(255, 255, 255);">WELCOME TO THE SELMER BOT DASHBOARD</h1>
</div>
<div style="text-align: center;">
<h1 style="-webkit-text-stroke: 2px rgb(255, 255, 255);">Music, Games, an Economy System, and More!</h1>
</div>
</div>
<!-- Header End -->
<div class="row custom-alert" style="display: none;" id="alertrow">
<div class="alert alert-warning alert-dismissible" id="banner" style="text-align: center" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<strong class="mx-auto">Logged In Successfully!</strong> <!-- This alert box could indicate a successful or positive action. -->
</div>
</div>
<!-- <div style="text-align: center; align-content: center;">
<!- <h2 style="color:wheat">Based off a real Professor of Logic!</h2> ->
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="outline-style: dashed; border-radius: 50%; outline-color: green;">
</div> -->
<!-- Adds margins to the page -->
<div class="container">
<div style="margin-top: 100px;"></div>
<div id="music" class="row pb-md-5 mt-md-5">
<div class="col-xxl-4 col-xl-4 col-lg-5 col-md-12">
<img class="img-responsive" style="border-style: dashed; border-color:rgb(11, 189, 189);" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Audio1.png?raw=true">
<!-- <img class="img-responsive overlay-content" style="border-style: dashed; border-color:rgb(11, 189, 189); transform: rotate(25deg); margin-bottom: 20%; margin-left: 45%;" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Audio2.png?raw=true"> -->
</div>
<div class="col-xxl-4 col-xl-4 col-lg-5 col-md-6">
<div class="container desctext">
<p style="white-space: pre-line;">
Play your favorite songs with easy-to-use controls!
</p>
<b>Features: </b>
<ul>
<li>
Easy Controls
</li>
<li>
Audio Queue
</li>
<li>
Stopping, pausing and unpausing!
</li>
</ul>
</div>
</div>
</div>
<div id="anime" class="mx-auto container pt-lg-5 mt-lg-5 mt-sm-0 pt-sm-0">
<div id="features" class="row">
<div class="col-xxl-4 col-xl-5 col-lg-12 col-md-12 order-xl-first order-lg-last p-lg-0 pt-lg-4">
<div class="container desctext" style="width: 440px; background-color: rgba(77, 206, 3, 0.322); height: 300px;">
<p style="white-space: pre-line;">
Get details about your favorite Anime and Manga!
</p>
<b>Features: </b>
<ul>
<li>
Three different styles: <b>Fancy, Summary, and Stats</b>
</li>
<li>
Get info on the newsest releases
</li>
</ul>
<p>
<i>I've actually mispelled anime/manga names several times and found some amazing new mangas</i>
</p>
</div>
</div>
<div id="animecarousel" class="carousel slide col-xxl-4 col-xl-4 col-lg-5 col-md-12" data-bs-ride="carousel" style="width: 650px; position: relative; margin: auto; height: 650px;">
<div class="carousel-inner" style="background-color: #36393f; height: 650px;">
<div class="carousel-item active" style="position: relative">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Anime1.png?raw=true" alt="Shop1" class="d-block carousel-img">
</div>
<div class="carousel-item" style="position: relative">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Anime2.png?raw=true" alt="Shop2" class="d-block carousel-img" style="margin:auto; margin-top: 15px;">
</div>
<div class="carousel-item" style="position: relative; text-align: center;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Anime3.png?raw=true" alt="Shop2" class="d-block carousel-img" style="margin:auto; margin-top: 30px;">
<!-- <h2 style="margin-top: 70px; color: white; font-family: Goudy Old Style;">Reach up to Rank 101!</h2> -->
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#animecarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#animecarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>
</div>
</div>
<div id="shop" class="container pt-5 pb-5">
<div id="features" class="row pt-5">
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
<div id="shopcarousel" class="carousel slide" data-bs-ride="carousel" style="width: 500px; height: 300px;">
<div class="carousel-inner" style="background-color: #36393f; height: 300px;">
<div class="carousel-item active">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/shop1.png?raw=true" alt="Shop1" class="d-block carousel-img w-100">
</div>
<div class="carousel-item">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/work.png?raw=true" alt="Work1" class="d-block carousel-img" style="margin:auto; margin-top: 15px;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/balance.png?raw=true" alt="Balance1" class="d-block carousel-img" style="margin:auto">
</div>
<div class="carousel-item" style="text-align: center;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/rank.png?raw=true" alt="Rank1" class="d-block carousel-img w-100" style="margin:auto; margin-top: 30px;">
<h2 style="margin-top: 70px; color: white; font-family: Goudy Old Style;">Reach up to Rank 101!</h2>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#shopcarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#shopcarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>
</div>
<!-- <span class="col" style="float: right"> -->
<div class="desctext pt-1" style="width: 450px; height: 200px; background-color: rgba(243, 159, 3, 0.322);">
<p style="white-space: pre-line;">
Use the shop and even add custom items!
</p>
<b>Features: </b>
<ul>
<li>
Customizable Items
</li>
<li>
Selling and Buying among server members
</li>
<li>
Earning XP and currency through work and games!
</li>
</ul>
</div>
<!-- </span> -->
</div>
</div>
<div id="games" class="container pt-5">
<div class="row pt-5">
<div class="col pt-5">
<img src="https://github.com/ION606/selmer-bot-website/blob/adb98105f825c4f9f75681c4ac513c72f184ea37/assets/tmonitor.png?raw=true" class="ps-lg-5 ps-sm-5" style="position: absolute; margin-top: 50px; scale: 1.5;">
<div id="gamescarousel" class="carousel slide p-md-0" data-bs-ride="carousel" style="width: 600px; height: 300px;">
<div class="carousel-inner" style="background-color: #36393f; height: 300px; border-style: none;">
<div class="carousel-item active">
<div class="row">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/ttcplayed.jpeg?raw=true" alt="ttc1" class="d-block carousel-img col-sm-6" style="margin-top: 20px;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/tttwon.jpeg?raw=true" alt="ttc2" class="d-block carousel-img col-sm-6" style="margin-top: 20px;">
</div>
</div>
<div class="carousel-item" style="position: relative">
<div class="row">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/trivia1.png?raw=true" alt="ttc1" class="d-block carousel-img" style="margin-top: 20px;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/triviafail.png?raw=true" alt="ttc1" class="d-block carousel-img" style="scale: 0.8">
</div>
</div>
<div class="carousel-item" style="position: relative; text-align: center;">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/triviapass.png?raw=true" alt="ttc1" class="d-block carousel-img" style="margin: auto; margin-top: 20px;">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#gamescarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#gamescarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>
</div>
<!-- <div style="margin-top: 200px;"></div> -->
<span class="container desctext col-xl-1" style="width: 500px; background-color: rgba(243, 3, 3, 0.322); float: right; margin-top: 200px">
<p style="white-space: pre-line;">
Play games and win XP and Selmer Coins!
</p>
<b>Features: </b>
<ul>
<li>
Sever games
</li>
<li>
Play by yourself or others
</li>
<li>
Use the currency in the item shop!
</li>
</ul>
<b>Games: </b>
<ul>
<li>
Trivia
</li>
<li>
Tic Tac Toe
</li>
</ul>
</span>
</div>
</div>
<!-- <div style="margin-top: 500px;"></div> -->
<!-- <img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/AI1.png?raw=true"> -->
<!-- Footer -->
<ul style="margin-top: 100px; text-align: center;" class="row">
<li style="display: inline; vertical-align: text-top;">
<a href="https://github.com/ION606/selmerBot"><i class="fa fa-github" style="font-size:72px; color: #000000;" alt="Github Repository"></i></a>
<span style="margin-left: 40px;"></span>
<a href="https://discord.com/oauth2/authorize?client_id=944046902415093760&scope=applications.commands+bot&permissions=549755289087"><img src="https://cdn-icons-png.flaticon.com/512/5968/5968756.png" style="width: 72px; height: 72px; margin-bottom: 40px;" alt="Discord Invite Link"></a>
</li>
</ul>
</div>
<!-- <script type="module" src="./main.js", type="application/json"></script> -->
</body>
</html>
+161
View File
@@ -0,0 +1,161 @@
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Selmer Bot Web Dashboard</title>
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<style>
html { width:100%; height:100%; margin:0; padding:0; }
body {
background-color: rgb(41, 42, 48);
width:100%; height:100%; margin:0; padding:0;
}
.server {
padding: 30px;
width: 100px;
height: 100px;
align-content: top;
object-fit:scale-down;
}
.serverImgIn {
width: 100px;
height: 100px;
object-fit:scale-down;
border-radius:50%;
cursor: pointer;
}
.serverImgOut {
width: 100px;
height: 100px;
object-fit:scale-down;
border-radius:50%;
cursor: pointer;
filter: grayscale(100%);
}
.serverRow {
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
</style>
<script>
function createServerPage() {
var tempPage = "<html>" + "HELLO WORLD, I'M A BLANK PAGE!" + "</html>";
var w = window.open('TEMP');
w.document.write(tempPage);
}
</script>
<script>
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
//Reminder that this will return a map of strings (you'll have to use JSON.parse() again)
xhrsess.onloadend = (e) => {
resolve(JSON.parse(xhrsess.response));
}
xhrsess.send();
});
}
window.onload = async () => {
//#region GUILDS
const sessionDataPromise = getSessionData();
sessionDataPromise.then((sessionData) => {
const guilds = JSON.parse(sessionData.guilds);
if (!guilds) {
alert("Please log in to continue");
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
var wrapper = document.getElementById('wrapper');
var row = document.createElement("servers_row");
row.innerHTML = ""; // clear images
row.classList.add('serverRow');
for (let i = 0; i < guilds.length; i++) {
//New row every 10 servers
if (i % 10 == 0) {
wrapper.appendChild(row);
row.innerHTML = "";
row.classList.add('serverRow');
}
var div = document.createElement("div");
var imagem = document.createElement("img");
var name = document.createElement("p");
name.innerText = guilds[i].name;
name.style = "color: white";
if (guilds[i].icon) {
imagem.src = `https://cdn.discordapp.com/icons/${guilds[i].id}/${guilds[i].icon}.png`;
} else {
imagem.src = 'https://github.com/ION606/selmer-bot-website/blob/main/assets/circleOutline.png?raw=true';
}
if (guilds[i].inServer) {
imagem.className = 'serverImgIn';
imagem.onclick = function() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/setCurrentServer/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', guilds[i].id);
xhr.setRequestHeader('sessionid', window.localStorage.getItem("sessionId"));
xhr.onloadend = (e) => {
// window.sessionStorage.setItem('serverInfo', (xhr.response));
window.location = 'https://www.selmerbot.com/dashboard.html';
}
xhr.send();
}
} else {
// imagem.classList.add('serverImgOut');
imagem.className = 'serverImgOut';
imagem.onclick = function() {
window.open('https://discord.com/oauth2/authorize?client_id=926551095352901632&scope=applications.commands+bot&permissions=549755289087');
}//OPEN A NEW WINDOW WITH SERVER INVITE
}
div.appendChild(imagem);
div.appendChild(name);
div.classList.add('server');
row.appendChild(div);
}
wrapper.appendChild(row);
wrapper.appendChild(document.createElement('div'));
});
//#endregion
}
</script>
</head>
<body>
<div id="wrapper">
<!-- PLACEHOLDER TEXT HERE -->
<!-- <img id="1" src="https://cdn.discordapp.com/icons/930148608400035860/76aab371cf5393ee9ae56c7493c656d4.png" alt="" title="" style="cursor: pointer; border-radius: 50%; border: 3px solid rgb(106, 255, 170);" width="128" height="128"> -->
</div>
</body>
+270
View File
@@ -0,0 +1,270 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel&family=Rajdhani:wght@300&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<style>
/* SUBMIT BUTTON START */
.submitButton{
position: relative;
background-color: black;
border-radius: 4em;
font-size: 16px;
color: white;
padding: 0.8em 1.8em;
cursor:pointer;
user-select:none;
text-align: center;
text-decoration: none;
cursor: pointer;
transition-duration: 0.4s;
/* margin-left: 65px; */
margin-left: 30px;
-webkit-transition-duration: 0.4s; /* Safari */
}
.submitButton:hover {
transition-duration: 0.1s;
background-color: #3A3A3A;
}
.submitButton:after {
content: "";
display: block;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
width: 100%;
height: 100%;
opacity: 0;
transition: all 0.5s;
box-shadow: 0 0 10px 40px white;
}
.submitButton:active:after {
box-shadow: 0 0 0 0 white;
position: absolute;
border-radius: 4em;
left: 0;
top:0;
opacity: 1;
transition: 0s;
}
.submitButton:active {
top: 1px;
}
.btnActive {
color: #ffffff;
background-color: #ff1117;
font-size: 13px;
border: 1px solid #000000;
border-radius: 9px;
padding: 10px 40px;
letter-spacing: 1px;
cursor: pointer;
margin-left: 40px;
}
.btnCanceled {
color: #ffffff;
background-color: #7a7a7a;
font-size: 13px;
border: 1px solid #000000;
border-radius: 9px;
padding: 10px 40px;
letter-spacing: 1px;
cursor: pointer;
margin-left: 40px;
}
/* SUBMIT BUTTON END */
.time input {
width: 30px;
text-align: center;
}
.inp input {
margin-left: 5px;
margin-right: 10px;
}
body {
background-color: rgb(128, 128, 128);
color: white;
}
</style>
<script>
window.onload = () => {
const d = new Date();
document.title = `Editing ${d.getMonth()}/${sessionStorage.getItem('day')}/${d.getFullYear()}`;
}
window.onbeforeunload = function() {
window.close();
};
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
//Reminder that this will return a map of strings (you'll have to use JSON.parse() again)
xhrsess.onloadend = (e) => {
resolve(JSON.parse(xhrsess.response));
}
xhrsess.send();
});
}
async function sendData(event) {
event.preventDefault();
try {
const name = document.getElementById('ename').value;
const desc = document.getElementById('edesc').value;
const url = document.getElementById('elink').value;
const loc = document.getElementById('eloc').value;
//Time
var hour = Number(document.getElementById('ehr').value);
var minute = Number(document.getElementById('emin').value);
var offset = Number(document.getElementById('tofst').value);
var day = sessionStorage.getItem('day');
//Check if it's a valid name/desc
if (!name) {
return alert("Please enter a valid name!");
}
//Check if it's a valid time
if (!(hour != undefined && minute != undefined && hour >= 0 && minute >= 0 && hour < 24 && minute < 60)) {
return alert("Please enter a valid time!");
}
if (!offset || offset >= 60 || offset < 0) {
offset = 0;
}
//Deal with the offset
//Convert the offset into ms timestamp and subtract
const offsetTS = offset * 60000;
const d = new Date(new Date().getFullYear(), new Date().getMonth(), day, hour, minute);
const serverSettings = JSON.parse(window.sessionStorage.getItem('serverInfo'));
const sessionDataPromise = getSessionData();
sessionDataPromise.then((sessionData) => {
var uid = null;
var gid = null;
if (sessionStorage.getItem("ref") == "user") {
uid = sessionData.userId;
} else if (serverSettings != undefined) {
gid = serverSettings.Id;
}
//Reminder format = { time: 1212122, event: { guildId: "930148608400035860", userId: "12", name: "Some Generic Name", description: "Some description", offset: "15", link: "https://www.example.com" location: "Some location" } }
let obj = { time: String(d.getTime() - offsetTS), event: { guildId: gid, userId: uid, name: name, description: desc, offset: offset, link: url, location: loc } }
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/newCalEvent/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader(`newCalEvent`, JSON.stringify(obj));
xhr.onloadend = (e) => {
console.log(xhr.response);
if (xhr.response == "OK") {
//make sure the opened window isn't a popup
if (window.opener.opener == null) { window.opener.location.reload(); }
else {
window.opener.opener.location.reload();
window.opener.location.reload();
}
alert("Saved!");
window.close();
} else if (xhr.response == "Internal Server Error") {
alert("Internal Server Error\nPlease try again!");
window.close();
} else if (xhr.response == "Conflict") {
alert("There's already an event at this time!");
}
};
xhr.send();
});
// alert(`${name}, ${desc}, ${url}, ${loc}, ${d}`);
} catch (err) {
console.error(err);
alert("An error has occured, please try again!");
window.close();
}
}
</script>
</head>
<body>
<!--
Name:
Description:
Day: Hour: Minute: //Scroller?
Location:
Link:
-->
<div name="newCalEvent" style="margin-top: 20px; margin-left: 20px;">
<form class="inp">
<label for="ename">Event Name:</label>
<input type="text" id="ename" name="ename"><br><br>
<label for="edesc">Event Descriptions:</label>
<input type="text" id="edesc" name="edesc"><br><br>
<!-- Time Start -->
<div class="time">
<label for="ehr">Hour:</label> <input type="text" id="ehr" name="ehr">
<label for="emin">Minute:</label> <input type="text" id="emin" name="emin">
<label for="tofst">Offset (minutes):</label> <input type="text" id="tofst" name="tofst"><br><br>
</div>
<!-- Time End -->
<label for="elink">Event Link:</label>
<input type="text" id="elink" name="elink"><br><br>
<label for="eloc">Event Location:</label>
<input type="text" id="eloc" name="eloc"><br><br>
<input type="submit" value="Submit", class="submitButton" onclick="sendData(event)">
</form>
<!-- <input type="time"> come back to this -->
</div>
</body>
</html>
+406
View File
@@ -0,0 +1,406 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Selmer Bot Web Dashboard</title>
<span id="IMPORTS">
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://js.stripe.com/v3/"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel&family=Rajdhani:wght@300&family=Rouge+Script&family=Share+Tech+Mono&display=swap" rel="stylesheet">
</span>
<style>
html { width:100%; height:100%; margin:0; padding:0; }
body {
/* background-color: rgb(4, 4, 85); */
background-color: rgb(38, 39, 49);
width:100%; height:100%; margin:0; padding:0;
color: white;
}
.navbar .nav-item {
margin-right: 25px;
margin-left: 25px;
}
#right {
float: right;
margin-right: 50px;
}
#right {
float: right;
margin-right: 50px;
}
h1 {
/* color: rgb(0, 74, 235); */
/* outline-style: dotted; */
text-align: center;
margin-right: 1%;
margin-left: 1%;
}
h2 {
color: rgb(255, 255, 255);
text-align: center;
}
p {
color: white;
margin-left: 1%;
}
h3 {
margin-left: 1%;
}
.desctext {
color: white;
margin-top: 20px;
background-color: rgb(1, 69, 196, 0.1);
padding: 10px;
border-radius: 10%;
border-style: groove;
border-color: rgb(255, 255, 255, 0.6);
width: auto;
}
.navbar-fixed-top {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
top: 0;
}
.picon {
border-radius: 50%;
background-color: rgba(255, 204, 51, 0.2);
box-shadow: 0 0 12px 7px rgba(252, 200, 28, 0.2);
}
</style>
<!-- BUTTONS HERE -->
<style>
.logoutbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
}
.logoutbtn:hover {
cursor: pointer;
color: red;
}
.loginbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
}
.loginbtn:hover {
color: #377aea;
}
.fivedollarbtn {
color: #00f2f2;
font-size: 23px;
border: 1px solid #2fffe0;
border-radius: 10px;
padding: 10px 30px;
letter-spacing: 1px;
cursor: pointer
}
.fivedollarbtn:hover {
color: #000000;
background-color: #00f2f2;
}
.tendollarbtn {
color: #30f200;
font-size: 23px;
border: 1px solid #50f801;
border-radius: 10px;
padding: 10px 30px;
letter-spacing: 1px;
cursor: pointer
}
.tendollarbtn:hover {
color: #000000;
background-color: #30f200;
}
h1 {
font-family: 'Share Tech Mono', monospace;
}
</style>
<script>
window.onload = () => {
if (!window.localStorage.getItem('sessionId')) {
document.getElementById('guildslink').href = '';
document.getElementById('guildslink').style = 'cursor: no-drop;';
//The user is logged out
document.getElementById('loginbtn').style.display = 'block'
document.getElementById('logoutbtn').style.display = "none";
}
}
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
xhr.onloadend = (e) => {
window.localStorage.clear();
window.sessionStorage.clear();
window.location.href = '/';
}
xhr.send();
}
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://www.selmerbot.com/ -->
function getAPIRedirect() {
if (window.location.href.indexOf('localhost') != -1) {
return 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
// return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
function pay(url, qrurl = null, qr = false) {
//$5 - https://buy.stripe.com/7sIfZW2Er0aZ1by000 - https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment5.png?raw=true
//$10 - https://buy.stripe.com/14kfZWcf19Lz7zWfYZ - https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment10.png?raw=true
if (qr) {
window.open(qrurl,'MyWindow','width=266.667px,height=351.667px');
} else {
try {
window.open(url, target="_blank");
} catch (err) {
console.error(err);
window.open(qrurl,'Something went wrong :( try this instead!','width=266.667px,height=351.667px');
}
}
}
</script>
</head>
<body>
<!-- Nav Bar -->
<nav class="navbar navbar-expand-sm bg-black">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="width: 50px;">
</a>
<ul class="navbar-nav">
<li class="nav-item">
<a href="myGuilds" id="guildslink" class="nav-link"><i class="fa-solid fa-server" alt="Servers" style="scale: 2; color: rgb(11, 189, 189);"></i></a>
</li>
<li class="nav-item">
<a href="calendar" id="callink" class="nav-link"><i class="fa-solid fa-calendar" alt="Calendar" style="scale: 2; color: lightgrey;"></i></a>
</li>
<li class="nav-item">
<a href="https://docs.selmerbot.com" target="_blank" class="nav-link"><i class="fa-solid fa-book" style="scale: 2; color: white;" alt="WIKI"></i></a>
</li>
<li class="nav-item">
<a href="premium" class="nav-link"><i class="fa-solid fa-crown" style="scale: 2; color: gold;" alt="PREMIUM"></i></a>
</li>
<li class="nav-item">
<a href="team" class="nav-link"><i class="fa-solid fa-user-gear" style="scale: 2; color: rgb(12, 216, 5);" alt="AUTHOR"></i></a>
</li>
</ul>
<div class="container"><h1 style="font-family: 'Rajdhani', sans-serif; text-align: left;">Selmer Bot Web Dashboard</h1></div>
<span class="ms-auto" style="margin-right: 1%;">
<button onclick="logout()" id="logoutbtn" class="logoutbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
<button onclick="window.location = getAPIRedirect()" id="loginbtn" class="loginbtn" style="display: none;"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log In"></i></button>
</span>
</div>
</nav>
<!-- NAVBAR END -->
<!-- Main Page -->
<div class="container">
<div id="titlediv" style="margin-top: 30px; margin-bottom: 150px;">
<h1 style="font-family: 'Cinzel', serif;">SELMER BOT PREMIUM <span class="picon"><i class="fa-solid fa-crown"></i></span></h1>
<h1 style="font-family: 'Rouge Script', cursive;">It's only logical!</h1>
</div>
<h1 style="font-size: 70px;">FEATURES</h1>
<!-- <div id="features" class="row pb-4 pt-5" style="text-align: center; font-family: Lucida Console;">
<h2 style="color: gold; font-size: 60px; text-align: center; font-family: Lucida Console;">AI</h2>
</div> -->
<div id="AI1" class="row pb-md-5 mt-md-5">
<h2 style="color: gold; font-size: 60px; text-align: center; font-family: Lucida Console; margin-bottom: 60px;">AI</h2>
<div class="col-xxl-4 col-xl-4 col-lg-5 col-md-12">
<img class="img-responsive" style="border-style: groove; border-color:rgb(11, 189, 189);" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/AI1.png?raw=true">
<!-- <img class="img-responsive overlay-content" style="border-style: dashed; border-color:rgb(11, 189, 189); transform: rotate(25deg); margin-bottom: 20%; margin-left: 45%;" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Audio2.png?raw=true"> -->
</div>
<div class="col-xxl-4 col-xl-4 col-lg-5 col-md-6">
<div class="container desctext" style="width: 500px; font-family: Lucida Console;">
<p style="white-space: pre-line;">
<b>Chat with Selmer Bot using State-of-the-Art AI!</b>
<p>
Talk with Selmer Bot about anything!
From the weather to sports to the meaning of life,
Selmer Bot will make sure you won't get bored!
</p>
<i>He can even (poorly) help with your homework!</i>
</p>
</div>
</div>
</div>
<div id="AI2" class="row pb-5 mt-md-5 pt-5">
<div class="col-xxl-5 col-xl-6 col-lg-12 col-md-12 order-xl-first order-md-last order-sm-last">
<div class="container desctext" style="width: 500px; font-family: Lucida Console; background-color: rgba(255, 196, 0, 0.384);">
<p style="white-space: pre-line;">
<b>The AI also comes with real-world data!</b>
<p>
Get semi-accurate weather reports,
the best burger places in town and even what the best
milkshake flavor is!
</p>
</p>
</div>
</div>
<div class="col-xxl-6 col-xl-6 col-lg-12 col-md-12">
<img class="img-responsive" style="border-style: groove; border-color:rgb(255, 153, 0);" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/AI_weather.png?raw=true">
<!-- <img class="img-responsive overlay-content" style="border-style: dashed; border-color:rgb(11, 189, 189); transform: rotate(25deg); margin-bottom: 20%; margin-left: 45%;" src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/Audio2.png?raw=true"> -->
</div>
</div>
<div id="REMINDER" class="row pb-5 mt-md-5 pt-5">
<div class="col-xxl-5 col-xl-6 col-lg-12 col-md-12 order-xl-last order-md-last order-sm-last">
<div class="container desctext" style="width: 500px; font-family: Lucida Console; background-color: rgba(0, 153, 255, 0.384);">
<p style="white-space: pre-line;">
<p>Have Selmer Bot remind you about your upcoming events!</p>
<b>Features: </b>
<ul>
<li>
Send reminders to yourself or your server!
</li>
<li>
Easy-to-use form inside Discord!
</li>
<li>
Choose the reminder channel and pingable role!
</li>
</ul>
<br>
<i>Note: Reminder offset will only be available on the website due to restrictions on Discord</i>
</p>
</div>
</div>
<div id="remindercarousel" class="carousel slide col-xxl-4 col-xl-4 col-lg-5 col-md-12" data-bs-ride="carousel" style="width: 590px; position: relative; margin: auto; height: 400px;">
<div class="carousel-inner" style="background-color: #36393f; height: 400px;">
<div class="carousel-item active" style="position: relative">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/REMINDER1.png?raw=true" alt="Rem1" class="d-block carousel-img" style="margin-top: 22px;">
</div>
<div class="carousel-item" style="position: relative">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/REMINDER2.png?raw=true" alt="Rem2" class="d-block carousel-img" style="margin:auto;">
</div>
<div class="carousel-item" style="position: relative">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Features/REMINDER_FORM.png?raw=true" alt="Rem3" class="d-block carousel-img" style="margin:auto; scale:0.75">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#remindercarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#remindercarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>
</div>
<div class="row pt-5" style="margin-top: 70px; margin-bottom: 0px;"><h1 style="font-size: 50px;">GET THE PREMIUM MONTHLY PLAN</h1></div>
<div id="paymentbuttons" class="row pt-5 pb-5">
<div id="fivedollar" class="col-6">
<button type="button" class="btn fivedollarbtn float-end" onclick="pay('https://buy.stripe.com/7sIfZW2Er0aZ1by000', 'https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment5.png?raw=true')">
Basic Tier - $5
</button>
</div>
<div id="tendollar" class="col-6">
<button type="button" class="btn tendollarbtn float-start" onclick="pay('https://buy.stripe.com/14kfZWcf19Lz7zWfYZ', 'https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment10.png?raw=true')">
Special Tier - $10
</button>
</div>
</div>
<div class="row pt-5" id="paymentbuttonQR">
<h2>Want to pay from your phone? Use our QR codes instead!</h2>
<div class="col-6 pt-3">
<button class="btn-lg btn-primary float-end" type="button" data-bs-toggle="collapse" data-bs-target="#fivedollarQR" aria-expanded="false" aria-controls="fivedollarQR">
Basic Tier - $5
</button>
</div>
<div class="col-6 pt-3">
<button class="btn-lg btn-primary float-start" type="button" data-bs-toggle="collapse" data-bs-target="#tendollarQR" aria-expanded="false" aria-controls="tendollarQR">
Special Tier - $10
</button>
</div>
</div>
<div class="row pt-3" id="paymentQRImg">
<div class="col-6">
<div class="collapse multi-collapse float-end" id="fivedollarQR">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment5.png?raw=true" style="width: 266.667px; height: 351.667px">
</div>
</div>
<div class="col-6">
<div class="collapse multi-collapse float-start" id="tendollarQR">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/stripe_payment10.png?raw=true" style="width: 266.667px; height: 351.667px">
</div>
</div>
</div>
</div>
<!-- Footer -->
<ul style="margin-top: 150px; text-align: center;" class="row">
<li style="display: inline; vertical-align: text-top;">
<a href="https://github.com/ION606/selmerBot"><i class="fa fa-github" style="font-size:72px; color: #000000;" alt="Github Repository"></i></a>
<span style="margin-left: 40px;"></span>
<a href="https://discord.com/oauth2/authorize?client_id=944046902415093760&scope=applications.commands+bot&permissions=549755289087"><img src="https://cdn-icons-png.flaticon.com/512/5968/5968756.png" style="width: 72px; height: 72px; margin-bottom: 40px;" alt="Discord Invite Link"></a>
</li>
</ul>
<div style="text-align: center; margin-bottom: 20px;"><i>Disclaimer: Selmer Bot uses OpenAI integration for the chat AI. The conversation data is stored for the duration of the conversation to help provide context and is then deleted.</i></div>
</body>
</html>
+273
View File
@@ -0,0 +1,273 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="shortcut icon" href="https://github.com/ION606/selmer-bot-website/blob/main/assets/favicon.ico?raw=true" type="image/x-icon">
<script src="https://kit.fontawesome.com/728e740903.js" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@300&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>Selmer Bot Directory</title>
<style>
body {
/* background-color: black; */
/* background-image: linear-gradient(140deg, #EADEDB 0%, #BC70A4 50%, #BFD641 75%); */
background-image: linear-gradient(140deg, #4a12e4 10%, #13206d 50%, #41d6d6 75%);
background-repeat:no-repeat;
background-size: 100vw 100vh;
}
.webBtn {
margin: 50px;
font-family:'Comic Sans MS';
font-size:20px;
line-height:20px;
color:#ffffff;
background-color:#4d4d4d;
padding:20px;
border-radius:10px;
}
.webBtn:hover {
color: #000000;
background-color: #9b9999;
}
.loginbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
}
.loginbtn:hover {
color: #377aea;
}
.tooltip {
position: relative;
display: inline-block;
cursor: default;
}
.tooltip .tooltiptext {
visibility: hidden;
padding: 0.25em 0.5em;
background-color: black;
color: #fff;
text-align: center;
border-radius: 0.25em;
white-space: nowrap;
/* Position the tooltip */
position: absolute;
z-index: 1;
top: 100%;
left: 100%;
transition-property: visibility;
transition-delay: 0s;
}
.tooltip:hover .tooltiptext {
visibility: visible;
transition-delay: 0.3s;
}
nav {
/* background-color: rgb(0, 0, 0); */
background: linear-gradient(0deg, #06075f00 10%, #13206d 50%, #41d6d6 95%);
/* color: blue; */
/* text-align: center; */
}
.navbar .nav-item {
margin-right: 25px;
margin-left: 25px;
}
#right {
float: right;
margin-right: 50px;
}
.logoutbtn {
margin-top: 14px;
scale: 1.2;
border-radius: 10%;
/* float: right; */
}
.logoutbtn:hover {
cursor: pointer;
color: red;
}
.headerText {
color: white;
font-family: 'Rajdhani', sans-serif;
}
h1 {
color: rgb(150, 148, 148);
-webkit-text-stroke-width: 0.3px;
-webkit-text-stroke-color: white;
}
/* h3 {
margin-right: 20%;
margin-left: 20%;
color: white;
text-align: center;
line-height: 40px;
} */
.abtme {
text-align: center;
background-color: rgba(0, 0, 0, 0.212);
margin-right: 20%;
margin-left: 20%;
margin-top: 20px;;
color: white;
text-align: center;
line-height: 40px;
}
.inpbox {
width: 250px;
height: 100px;
border-radius: 20px;
background-color: rgb(200, 200, 202);
}
.sbtn {
margin: 20px;
color: #ffffff;
background: linear-gradient(0deg, #5f060600 10%, #6d1335 50%, #d64141 95%);
background: linear-gradient(0deg, #d64141 10%, #6d1335 50%, #5f060600 95%);
font-size: 19px;
border: 1px solid #2d63c8;
border-radius: 30px;
padding: 15px 50px;
cursor: pointer;
}
</style>
<script>
/*
Get the sessionId and the suggestion, send it to the back end where you can get the userId and attach it to the suggestion,
then send all that to the selmer-bot ideas channel in the RPI Directory and Emojibase server
*/
function sendData(event) {
event.preventDefault();
const sid = window.localStorage.getItem('sessionId');
if (!sid) {
return alert("Please log in to send feedback!");
}
const sbox = document.getElementById("sugbx");
if (!sbox.value) { return; }
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/suggestion/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionId', sid);
xhr.setRequestHeader('suggestion', sbox.value);
xhr.onloadend = (e) => {
if (xhr.response == 'OK') {
sbox.value = "Thank you for your suggestion, it has been recorded!";
sbox.disabled = true;
document.getElementById('sb').disabled = true;
}
}
xhr.send();
}
</script>
</head>
<body>
<!-- Nav Bar -->
<nav class="navbar navbar-expand-sm navbar-fixed-top">
<div class="container-fluid mx-auto">
<a class="navbar-brand" href="/">
<img src="https://github.com/ION606/selmer-bot-website/blob/main/assets/Selmer-icon.png?raw=true" alt="Selmer Icon" style="width: 50px;">
</a>
<!-- <li class="nav-item">
<a href="index.html" style="color: white" class="nav-link"><i class="fa-solid fa-house-chimney", alt="Home" style="scale: 2;"></i></a>
</li> -->
<ul class="navbar-nav">
<li class="nav-item">
<a href="myGuilds" id="guildslink" class="nav-link"><i class="fa-solid fa-server" alt="Servers" style="scale: 2; color: rgb(11, 189, 189);"></i></a>
</li>
<li class="nav-item">
<a href="calendar" id="callink" class="nav-link"><i class="fa-solid fa-calendar" alt="Calendar" style="scale: 2; color: lightgrey;"></i></a>
</li>
<li class="nav-item">
<a href="https://docs.selmerbot.com" target="_blank" class="nav-link"><i class="fa-solid fa-book" style="scale: 2; color: white;" alt="WIKI"></i></a>
</li>
<li class="nav-item">
<a href="premium" class="nav-link"><i class="fa-solid fa-crown" style="scale: 2; color: gold;" alt="PREMIUM"></i></a>
</li>
<li class="nav-item">
<a href="team" class="nav-link"><i class="fa-solid fa-user-gear" style="scale: 2; color: rgb(12, 216, 5);" alt="AUTHOR"></i></a>
</li>
</ul>
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button> -->
<div class="container headerText"><h1>Selmer Bot Web Dashboard</h1></div>
<!-- <span class="ms-auto" style="margin-right: 1%;">
< !-- <button id="login" class="loginbtn" onclick="window.location = getAPIRedirect()">Log Into Dashboard</button> -- >
<button onclick="logout()" id="logoutbtn" class="logoutbtn" style="display: none;"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log Out"></i></button>
<button onclick="window.location = getAPIRedirect()" id="loginbtn" class="loginbtn"><i class="fa-solid fa-arrow-right-from-bracket" alt="Log In"></i></button>
</span> -->
</div>
</nav>
<div style="text-align: center;">
<h1>Selmer Bot is being created by ION606!</h1>
<h3 style="text-align: center;" class="abtme">
Hello there, and welcome to the Selmer Bot Web Dashboard! I'm ION606 and I'm a sophomore in college for a Computer Science and an Information Technology dual major.
I like creating bots and programming new things! Feel free to suggest new features in the suggestion box (coming soon)!
</h3>
<h1 style="margin-top: 30px;">Find me here!</h1>
</div>
<div class="row">
<div style="text-align: center;">
<button onclick="window.open('https://www.selmerbot.com/', target='_blank')" class="webBtn">selmerbot.com</button>
<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button" data-slug="ion606" data-color="#FFDD00" data-emoji="" data-font="Cookie" data-text="Buy me a coffee" data-outline-color="#000000" data-font-color="#000000" data-coffee-color="#ffffff"></script>
</div>
</div>
<div style="text-align: center; margin-top:50px;">
<h1 style="color:rgb(240, 235, 235)"><u>Selmer Bot Feature Suggestion</u></h1>
<form action="/suggestion" method="post">
<textarea type="text" class="inpbox" id="sugbx"></textarea>
</form>
<button onclick="sendData(event)" class="sbtn" id="sb">Submit</button>
</div>
<div style="text-align: center; position: absolute; bottom: 5px; color: white;">Copyright @ION606 2022</div>
</body>
</html>