Bootstrap port

This commit is contained in:
oitsjustjose 2020-12-02 10:56:13 -06:00
commit d384c23646
32 changed files with 134 additions and 3848 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,81 +0,0 @@
/**
* Uses ZERO Jquery!!
*/
let menuOpen = false;
const toggleSubMenu = (el) => {
let icon = el.querySelector("i.fa");
let isOpen = icon.hasAttribute("submenuOpen") ? parseInt(icon.getAttribute("submenuOpen")) : 0;
document.querySelectorAll(`[for=${el.getAttribute("from")}]`).forEach((elSearched) => {
if (isOpen == 1) {
elSearched.classList.remove("visible");
} else {
elSearched.classList.add("visible");
}
});
if (isOpen == 1) {
icon.style.transition = "transform ease-in-out 250ms";
icon.style.transform = "rotate(0deg)";
icon.setAttribute("submenuOpen", 0);
} else { // Not open..
icon.style.transition = "transform ease-in-out 250ms";
icon.style.transform = "rotate(90deg)";
icon.setAttribute("submenuOpen", 1);
}
};
const toggleMenu = () => {
let menu = document.querySelector(".mobile-menu");
menuOpen = !menuOpen;
if (menuOpen) {
menu.classList.add("visible");
document.body.classList.add("no-scroll");
} else {
menu.classList.remove("visible");
document.body.classList.remove("no-scroll");
}
};
window.addEventListener("DOMContentLoaded", (evt) => {
document.querySelectorAll(".compact.submenu.item").forEach((el) => {
let id = `subMenu_${new Date().getMilliseconds()}`;
el.setAttribute("from", id);
let subMenuItems = [];
el.querySelectorAll(".compact.sub.item").forEach((child) => {
subMenuItems.push(child);
});
subMenuItems.reverse();
subMenuItems.forEach((child) => {
child.setAttribute("for", id);
el.parentElement.insertBefore(child, el.nextSibling);
});
});
// Add .active to clicked on menus
document.querySelectorAll(".dropdown.item").forEach((dropdown) => {
dropdown.addEventListener("click", () => {
if (dropdown.classList.contains("active")) {
dropdown.classList.remove("active");
} else {
dropdown.classList.add("active");
}
});
dropdown.addEventListener("mouseout", () => {
if (dropdown.classList.contains("active")) {
dropdown.classList.remove("active");
}
});
});
});

View file

@ -1,38 +0,0 @@
window.addEventListener("DOMContentLoaded", (evt) => {
window.onclick = (event) => {
if (event.target.classList.contains("modal")) {
let modal = event.target;
modal.classList.remove("visible");
modal.removeAttribute("active");
document.body.classList.remove("modal-no-scroll");
}
};
document.querySelectorAll(".modal .close").forEach((closeBtn) => {
closeBtn.addEventListener('click', (evt) => {
let modal = closeBtn.parentElement.parentElement;
modal.classList.remove("visible");
modal.removeAttribute("active");
document.body.classList.remove("modal-no-scroll");
});
});
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
modalTrigerEl.addEventListener('click', (evt) => {
let modal = document.getElementById(modalTrigerEl.getAttribute("for-modal"));
modal.classList.add("visible");
modal.setAttribute("active", "");
document.body.classList.add("modal-no-scroll");
});
});
document.body.addEventListener('keydown', (evt) => {
if (evt.key == "Escape") {
let modal = document.querySelector(".modal[active]");
modal.classList.remove("visible");
modal.removeAttribute("active");
document.body.classList.remove("modal-no-scroll");
}
});
});

View file

@ -1,70 +0,0 @@
/**
* @author oitsjustjose | https://github.com/oitsjustjose | oitsjustjose.com
* Handles all things in regards to theming
*/
let themes = {
"dark": "/Libraries/css/dark.css",
"moonlight": "/Libraries/css/moonlight.css",
"light": "/Libraries/css/light.css"
};
let mode = "dark";
const css = document.getElementById("themekit");
const updateIcon = () => {
document.querySelectorAll(".theme-toggle").forEach((icon) => {
if (mode == "dark") {
icon.innerHTML = `<i class="fas fa-moon"></i>`;
} else if (mode == "moonlight") {
icon.innerHTML = `<i class="fas fa-sun"></i>`;
} else {
icon.innerHTML = `<i class="fas fa-adjust"></i>`;
}
});
};
const toggle = () => {
if (mode == "dark") {
window.localStorage.setItem("theme", "moonlight");
mode = "moonlight";
} else if (mode == "moonlight") {
window.localStorage.setItem("theme", "light");
mode = "light";
} else {
window.localStorage.setItem("theme", "dark");
mode = "dark";
}
css.href = themes[mode];
updateIcon();
};
window.addEventListener("DOMContentLoaded", (evt) => {
// Bootstrap the click event listener
document.querySelectorAll(".theme-toggle").forEach((icon) => {
icon.addEventListener("click", () => {
toggle();
});
});
if (window.localStorage.getItem("theme") === null) {
// Match with system dark mode
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
window.localStorage.setItem("theme", "dark");
}
// Match with system light mode
else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
window.localStorage.setItem("theme", "light");
}
// Literally choose the middle option
else {
window.localStorage.setItem("theme", "moonlight");
}
}
mode = window.localStorage.getItem("theme");
css.href = themes[mode];
updateIcon();
});

File diff suppressed because one or more lines are too long

7
Libraries/Bootstrap/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

Before

Width:  |  Height:  |  Size: 699 KiB

After

Width:  |  Height:  |  Size: 699 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 876 KiB

After

Width:  |  Height:  |  Size: 876 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 570 KiB

After

Width:  |  Height:  |  Size: 570 KiB

Before After
Before After

View file

@ -5,6 +5,22 @@
font-style: normal;
}
.masthead {
background-image: url("./Resources/Pano1-Blurred.png");
background-repeat: no-repeat;
background-size: cover;
background-position-x: center;
background-attachment: fixed;
height: auto;
margin-top: -3rem;
}
.masthead h1, .masthead h4 {
color: #eeeeee;
mix-blend-mode: overlay;
font-family: 'MinecraftiaRegular';
}
.mc_title {
display: flex;
flex-direction: row;
@ -17,81 +33,9 @@
user-select: none;
}
.masthead {
background-image: url("./Resources/Pano1-Blurred.png");
background-repeat: no-repeat;
background-size: cover;
background-position-x: center;
background-attachment: fixed;
height: auto;
margin-top: -3rem;
}
.masthead .content h1, .masthead .content h2 {
body {
color: #eeeeee;
mix-blend-mode: overlay;
}
#pano2 {
background-image: url("./Resources/Pano2-Blurred.png");
background-repeat: no-repeat;
background-size: cover;
background-position-x: center;
background-position-y: 100%;
background-attachment: fixed;
}
#pano2 p, #pano2 h1 {
mix-blend-mode: color-dodge;
}
.container {
padding-left: 25%;
padding-right: 25%;
margin: auto;
}
@media (max-width: 767px) {
.container {
padding-left: 5%;
padding-right: 5%;
}
}
.voidpack {
color: #ff4340;
cursor: pointer;
}
.voidpack:hover {
color: #ff110d;
}
.card img {
object-fit: cover;
}
.card-cover {
position: relative;
}
.card-cover h3 {
font-size: 24px !important;
font-family: 'MinecraftiaRegular';
font-weight: normal;
font-style: normal;
position: absolute;
bottom: 4px;
left: 0px;
text-align: center;
width: 100%;
}
.card-cover a {
font-family: 'MinecraftiaRegular';
font-weight: normal;
font-style: normal;
text-decoration: none;
background-color: #252525;
}
body.loading {
@ -105,17 +49,7 @@ body, .masthead {
transition: opacity ease-in-out 250ms;
}
.cards .card {
padding: 0px;
}
.cards .card h3, .cards .card h4 {
margin-left: 1rem;
margin-right: 1rem;
max-width: calc(100% - 2rem);
}
img.icon.image {
img.icn {
width: 20% !important;
height: auto;
position: absolute;
@ -124,12 +58,13 @@ img.icon.image {
width: 100%;
}
.embed-grid.grid {
padding: 0 4rem;
-ms-flex-align: center;
align-items: center;
-ms-grid-columns: (minmax(512px, 1fr))[auto-fit];
grid-template-columns: repeat(auto-fit, minmax(512px, 1fr));
.container {
width: 95% !important;
max-width: 1024px !important;
}
img.blurred {
filter: blur(10%);
}
.outline-text {

View file

@ -19,64 +19,63 @@ const update = async () => {
const renderServer = async (server) => {
const { name, id, port, hasPackVer, dynmapUrl } = server;
const resp = await fetch(`https://mcapi.us/server/status?ip=forgeserv.net&port=${port}`);
const resp = await fetch(`http://mcapi.us/server/status?ip=forgeserv.net&port=${port}`);
const data = await resp.json();
const card = document.createElement('div');
card.className = 'card';
/* BEGIN CARD COVER */
const cardCover = document.createElement('div');
cardCover.className = 'card-cover';
const img = document.createElement('img');
// img.className ='blurred card-img-top';
img.className = 'card-img-overlay';
img.src = `/Resources/servers/${id}cover.png`;
const cardImg = document.createElement('img');
cardImg.className = 'blurred';
cardImg.src = `/Resources/${id}/cover.png`;
const icn = document.createElement('img');
icn.className = 'icn';
icn.src = data.favicon ? data.favicon : '/Resources/default-icon.png';
const cardIcn = document.createElement('img');
cardIcn.className = 'icon image';
cardIcn.src = data.favicon ? data.favicon : '/Resources/default-icon.png';
const title = document.createElement('h5');
title.className = 'card-title';
title.innerText = name;
const serverName = document.createElement('h3');
serverName.innerText = name;
serverName.className = 'outline-text';
card.appendChild(img);
card.appendChild(icn);
card.appendChild(title);
cardCover.appendChild(cardImg);
cardCover.appendChild(cardIcn);
cardCover.appendChild(serverName);
/* END CARD COVER */
const cardText = document.createElement('div');
cardText.className = 'card-text';
/* BEGIN CARD BOTTOM */
const serverStatus = document.createElement('h3');
serverStatus.innerText = `Server is ${data.online ? 'online' : 'offline'}`;
serverStatus.style.color = data.online ? '#7cb342' : '#ff4340';
const sts = document.createElement('h6');
sts.innerText = `Server is ${data.online ? 'online' : 'offline'}`;
sts.style.color = data.online ? '#7cb342' : '#ff4340';
const playerCount = document.createElement('h4');
playerCount.innerText = `${data.players.now} / ${data.players.max} Players Online`;
const cnt = document.createElement('p');
cnt.innerText = `${data.players.now} / ${data.players.max} Players Online`;
const version = document.createElement('h4');
version.innerText = `Minecraft Version ${data.server.name}`;
const ver = document.createElement('p');
ver.innerText = `Minecraft Version ${data.server.name}`;
card.appendChild(cardCover);
card.appendChild(serverStatus);
card.appendChild(playerCount);
card.appendChild(version);
cardText.appendChild(sts);
cardText.appendChild(cnt);
cardText.appendChild(ver);
card.appendChild(cardText);
if (hasPackVer) {
const packVer = document.createElement('h4');
packVer.innerText = `Modpack Version ${extractVersion(data.motd)}`;
card.appendChild(packVer);
} else if (dynmapUrl) {
const dynmapAnchor = document.createElement('a');
dynmapAnchor.href = dynmapUrl;
const dynmap = document.createElement('h4');
dynmap.innerText = `${name.substring(0, 1).toUpperCase() + name.slice(1)} Dynmap`;
dynmapAnchor.appendChild(dynmap);
card.appendChild(dynmapAnchor);
}
/* END CARD BOTTOM */
if (dynmapUrl) {
const dynAnc = document.createElement('a');
dynAnc.href = dynmapUrl;
const dmap = document.createElement('b');
dmap.innerText = `${name.substring(0, 1).toUpperCase() + name.slice(1)} Dynmap`;
dynAnc.appendChild(dmap);
card.appendChild(dynAnc);
}
return card;
};
@ -88,6 +87,7 @@ const extractVersion = (motd) => {
window.addEventListener('load', () => {
update();
document.body.classList.remove("loading");
setInterval(() => {
update();
}, 30000);

23
index copy.html Normal file
View file

@ -0,0 +1,23 @@
<div class="container">
<h1><i class="fas fa-file-archive"></i> Suggested Resource Pack</h1>
<p>
I have been working on a custom resource pack for modded Minecraft that implement's a few of the
best 16x16 textures (including most if not all of Jappa's new 1.14.x textures) into a pack I've
called "Voidpack". I have made a few textures, but by no means to I claim ownership of them all. You
can check it out and download it <span class="voidpack" for-modal="voidpack">here!</span>
</p>
</div>
<div class="modal" id="voidpack">
<div class="modal-content">
<span class="close">
<i class="fas fa-times"></i>
</span>
<div class="embed">
<iframe src="https://voidpack.forgeserv.net"></iframe>
</div>
</div>
</div>
</body>
</html>

View file

@ -6,40 +6,45 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<link rel="shortcut icon" href="./Resources/logo.png" type="image/x-icon">
<title>ForgeServ</title>
<!-- Bootstrap -->
<link href="Libraries/Bootstrap/bootstrap.min.css" rel="stylesheet">
<script src="Libraries/Bootstrap/bootstrap.bundle.min.js"></script>
<!-- Other -->
<script src="./forgeserv.js"></script>
<link rel="stylesheet" type="text/css" href="/JuiceUI/css/dark.css" id="juiceui">
<link rel="stylesheet" type="text/css" href="JuiceUI/fontawesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="forgeserv.css">
<link rel="stylesheet" type="text/css" href="Libraries/FontAwesome/css/all.min.css">
</head>
<body>
<div class="masthead">
<div class="centered content">
<img src="./Resources/logo.png" class="centered image" style="width: 32em; height: auto;">
<body class="loading mb-3">
<div class="masthead py-5">
<div class="text-center py-3">
<img src="./Resources/logo.png" class="mb-5" style="width: 75%; max-width: 32em; height: auto;">
<h1>ForgeServ</h1>
<h2>A server for <i>many</i> Minecraft Modpacks + Servers</h2>
<h4>A server for <i>many</i> Minecraft Modpacks + Servers</h4>
</div>
</div>
<div class="container">
<div class="container my-3">
<h1><i class="fas fa-server"></i> Hardware</h1>
<p>
ForgeServ is hosted myself on a Fiber-Internet backend. The hardware specs of the new server machine are:
<h6>ForgeServ is hosted myself on a Fiber-Internet backend.</h6>
<h6>&nbsp;&nbsp;&nbsp;&nbsp;The hardware specs of the new server machine are:</h6>
<ul>
<li>8-Core / 16-Thread Intel Xeon E5-2670 @ 2.60GHz</li>
<li>64GB of ECC RAM</li>
<li>500GB SSD for OS, MC Servers and Web Servers</li>
<li>500GB SSD for backups</li>
<li>500GB SSD for Backups</li>
</ul>
</p>
</div>
<div class="divider"></div>
<div class="container">
<hr />
</div>
<div class="container">
<div class="mc_title">
<img src="/Resources/minecraft.png">
<h1>&nbsp;Current Packs & Versions</h1>
<img src="/Resources/minecraft.png" alt="Minecraft Logo">
<h1>&nbsp; Current Packs & Versions</h1>
</div>
<p>
@ -56,17 +61,20 @@
</div>
</div>
<div class="divider"></div>
<div class="container">
<hr />
</div>
<div class="container" id="pano2">
<h1><i class="fab fa-discord"></i> The Discord Server</h1>
<div class="embed" style="opacity: 90%;">
<div class="container">
<div class="ratio ratio-16x9" style="opacity: 90%s;">
<iframe src="https://discordapp.com/widget?id=303876626935054336&theme=dark" allowtransparency="true"
frameborder="0"></iframe>
</div>
</div>
<div class="divider"></div>
<div class="container">
<hr />
</div>
<div class="container">
<h1><i class="fas fa-file-signature"></i> Joining ForgeServ Servers</h1>
@ -80,28 +88,27 @@
</p>
</div>
<div class="divider"></div>
<div class="container">
<hr />
</div>
<div class="container">
<h1><i class="fas fa-file-archive"></i> Suggested Resource Pack</h1>
<p>
I have been working on a custom resource pack for modded Minecraft that implement's a few of the
best 16x16 textures (including most if not all of Jappa's new 1.14.x textures) into a pack I've
called "Voidpack". I have made a few textures, but by no means to I claim ownership of them all. You
can check it out and download it <span class="voidpack" for-modal="voidpack">here!</span>
called "Voidpack". I have made a few textures, but by no means to I claim ownership of them all.
</p>
</div>
<div class="modal" id="voidpack">
<div class="modal-content">
<span class="close">
<i class="fas fa-times"></i>
</span>
<div class="embed">
<iframe src="https://voidpack.forgeserv.net"></iframe>
</div>
<div class="text-center">
<a class="btn btn-info" href="https://voidpack.forgeserv.net" target="_blank">
<span>
<i class="fa fa-download"></i>&nbsp; Check It Out!
</span>
</a>
</div>
</div>
</body>
</html>