preston i'm liquifying ur code rn
This commit is contained in:
parent
da6de49227
commit
93e2e9b7cd
@ -12,7 +12,7 @@ body {
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
color: #333;
|
color: #333;
|
||||||
transition: background-color 0.3s ease, color 0.3s ease;
|
transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
body.dark-mode {
|
body.dark-mode {
|
||||||
@ -63,7 +63,7 @@ button, .source-btn, .dsc-btn, .clr-btn {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
transition: background-color 0.3s ease, transform 0.3s ease;
|
transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
.clientbutton button {
|
.clientbutton button {
|
||||||
background-color: #5fff5a;
|
background-color: #5fff5a;
|
||||||
@ -105,7 +105,7 @@ button:hover {
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
transition: border-color 0.3s ease;
|
transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-bar:focus {
|
#search-bar:focus {
|
||||||
@ -142,7 +142,7 @@ button:hover {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
transition: background-color 0.3s ease, transform 0.3s ease;
|
transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ button:hover {
|
|||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
|
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
transition: background-color 0.3s ease, color 0.3s ease;
|
transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal h2 {
|
.modal h2 {
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
|
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
|
||||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2593894696548093" crossorigin="anonymous"></script>
|
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2593894696548093" crossorigin="anonymous"></script>
|
||||||
<script src="js/darkmode.js"></script>
|
<script type="module" src="js/darkmode.js"></script>
|
||||||
<script src="js/ga4.js"></script>
|
<script type="module" src="js/ga4.js"></script>
|
||||||
<script src="js/main.js"></script>
|
<script type="module" src="js/main.js"></script>
|
||||||
<script src="js/popup.js"></script>
|
<script type="module" src="js/popup.js"></script>
|
||||||
|
|
||||||
<meta property="og:title" content="Eaglercraft Client Collections" />
|
<meta property="og:title" content="Eaglercraft Client Collections" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
|
125
js/darkmode.js
125
js/darkmode.js
@ -1,83 +1,66 @@
|
|||||||
$(document).ready(function() {
|
import {
|
||||||
function updateDarkMode(isChecked) {
|
hexToRGB,
|
||||||
|
pushStyles,
|
||||||
|
selectClass,
|
||||||
|
selectId,
|
||||||
|
selectTag,
|
||||||
|
} from "./helperFunctions";
|
||||||
|
|
||||||
|
global.querySelectorAll = document.querySelectorAll;
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
function applyStyles(elements, styles) {
|
||||||
|
elements.forEach(element => pushStyles(element, styles));
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateDarkMode(isChecked = true) {
|
||||||
|
const body = document.body.id ? selectId(document.body.id) : selectTag('body');
|
||||||
|
const commonStyles = isChecked ? {
|
||||||
|
backgroundColor: hexToRGB('#141414'),
|
||||||
|
color: hexToRGB('#f1f1f1')
|
||||||
|
} : {
|
||||||
|
backgroundColor: '#f1f1f1',
|
||||||
|
color: 'black',
|
||||||
|
backgroundImage: "url('/images/grass-background.jpg')"
|
||||||
|
};
|
||||||
|
|
||||||
|
pushStyles(body, commonStyles);
|
||||||
|
|
||||||
|
applyStyles(document.querySelectorAll('p'), { color: commonStyles.color });
|
||||||
|
applyStyles([selectTag('h2'), selectTag('h1')], { color: commonStyles.color });
|
||||||
|
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
const body = document.querySelector('body');
|
pushStyles(selectTag('h1'), {
|
||||||
body.style.backgroundColor = '#141414';
|
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
|
||||||
body.style.color = '#f1f1f1';
|
|
||||||
body.style.backgroundImage= 'none';
|
|
||||||
const paragraphs = document.querySelectorAll('p');
|
|
||||||
paragraphs.forEach(function(p) {
|
|
||||||
p.style.color = '#f1f1f1';
|
|
||||||
});
|
});
|
||||||
const headTwo = document.querySelector('h2');
|
pushStyles(selectClass('footer'), { backgroundColor: hexToRGB('#6C8592') });
|
||||||
headTwo.style.color = '#f1f1f1';
|
pushStyles(selectClass('source-btn'), { backgroundColor: hexToRGB('#ff6847') });
|
||||||
const head = document.querySelector('h1');
|
applyStyles(document.querySelectorAll('button'), { backgroundColor: hexToRGB('#30d3d2') });
|
||||||
head.style.color = '#f1f1f1';
|
applyStyles(document.querySelectorAll('.version-text'), { color: hexToRGB('#f1f1f1') });
|
||||||
head.classList.add('text-shadow');
|
pushStyles(document.querySelector('.danger-zone'), { color: '#ff6847' });
|
||||||
head.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
pushStyles(document.querySelector('.modal'), { color: '#ff3c00' });
|
||||||
|
|
||||||
const foot = document.querySelector('.footer');
|
|
||||||
foot.style.backgroundColor = '#6C8592';
|
|
||||||
const gitBtn = document.querySelector('.source-btn');
|
|
||||||
gitBtn.style.backgroundColor = '#ff6847';
|
|
||||||
|
|
||||||
const buttons = document.querySelectorAll('button');
|
|
||||||
buttons.forEach(function(button) {
|
|
||||||
button.style.backgroundColor = '#30d3d2';
|
|
||||||
});
|
|
||||||
const versionTexts = document.querySelectorAll('.version-text');
|
|
||||||
versionTexts.forEach(function(vt) {
|
|
||||||
vt.style.color = '#f1f1f1';
|
|
||||||
});
|
|
||||||
const dZone = document.querySelector('.danger-zone');
|
|
||||||
dZone.style.color = '#ff6847';
|
|
||||||
const dZoneText = document.querySelector('.modal');
|
|
||||||
dZoneText.style.color = '#ff3c00';
|
|
||||||
localStorage.setItem('darkModeOn', true);
|
localStorage.setItem('darkModeOn', true);
|
||||||
} else {
|
} else {
|
||||||
const body = document.querySelector('body');
|
pushStyles(selectTag('h1'), {
|
||||||
body.style.backgroundColor = '#f1f1f1';
|
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
|
||||||
body.style.color = 'black';
|
|
||||||
body.style.backgroundImage= "url('/images/grass-background.jpg')";
|
|
||||||
const paragraphs = document.querySelectorAll('p');
|
|
||||||
paragraphs.forEach(function(p) {
|
|
||||||
p.style.color = 'black';
|
|
||||||
});
|
});
|
||||||
const headTwo = document.querySelector('h2');
|
pushStyles(selectClass('footer'), { backgroundColor: '#000000', color: '#ffffff' });
|
||||||
headTwo.style.color = 'black';
|
pushStyles(selectClass('source-btn'), { backgroundColor: '#0095ff' });
|
||||||
const head = document.querySelector('h1');
|
applyStyles(document.querySelectorAll('button'), { backgroundColor: '#4caf50' });
|
||||||
head.style.color = 'black';
|
applyStyles(document.querySelectorAll('.version-text'), { color: 'black' });
|
||||||
head.classList.remove('text-shadow');
|
pushStyles(document.querySelector('.danger-zone'), { color: '#010101' });
|
||||||
head.style.textShadow = '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white';
|
pushStyles(document.querySelector('.modal'), { color: '#010101' });
|
||||||
|
|
||||||
const foot = document.querySelector('.footer');
|
|
||||||
foot.style.backgroundColor = '#000000';
|
|
||||||
foot.style.color = '#ffffff';
|
|
||||||
const gitBtn = document.querySelector('.source-btn');
|
|
||||||
gitBtn.style.backgroundColor = '#0095ff';
|
|
||||||
const buttons = document.querySelectorAll('button');
|
|
||||||
buttons.forEach(function(button) {
|
|
||||||
button.style.backgroundColor = '#4caf50';
|
|
||||||
});
|
|
||||||
const versionTexts = document.querySelectorAll('.version-text');
|
|
||||||
versionTexts.forEach(function(vt) {
|
|
||||||
vt.style.color = 'black';
|
|
||||||
});
|
|
||||||
const dZone = document.querySelector('.danger-zone');
|
|
||||||
dZone.style.color = '#010101';
|
|
||||||
const dZoneText = document.querySelector('.modal');
|
|
||||||
dZoneText.style.color = '#010101';
|
|
||||||
localStorage.removeItem("darkModeOn");
|
localStorage.removeItem("darkModeOn");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (localStorage.getItem('darkModeOn') == true) {
|
|
||||||
document.getElementById('darkModeCheckbox').checked = true;
|
const darkModeCheckbox = document.getElementById('darkModeCheckbox');
|
||||||
var checked = document.getElementById('darkModeCheckbox').checked;
|
if (localStorage.getItem('darkModeOn') === 'true') {
|
||||||
updateDarkMode(checked);
|
darkModeCheckbox.checked = true;
|
||||||
}
|
}
|
||||||
|
updateDarkMode(darkModeCheckbox.checked);
|
||||||
|
|
||||||
$("#darkModeCheckbox").on("change", function() {
|
$("#darkModeCheckbox").on("change", function() {
|
||||||
var checked = document.getElementById('darkModeCheckbox').checked;
|
updateDarkMode(darkModeCheckbox.checked);
|
||||||
updateDarkMode(checked);
|
|
||||||
});
|
});
|
||||||
updateDarkMode();
|
|
||||||
});
|
});
|
||||||
|
71
js/ga4.js
71
js/ga4.js
@ -1,54 +1,43 @@
|
|||||||
function addGoogleAnalyticsTags() {
|
function addGoogleAnalyticsTags() {
|
||||||
var currentDomain = window.location.hostname;
|
const currentOrigin = window.location.origin;
|
||||||
var trackingId;
|
const allowedOrigins = [
|
||||||
|
"https://eaglercraftx1-8.github.io",
|
||||||
|
"https://eaglercraftx1-8.netlify.app",
|
||||||
|
"https://eaglercraftx1-8.onrender.com",
|
||||||
|
"https://fastest.eaglercraft.win",
|
||||||
|
"https://notproxiedclient.eaglercraft.win",
|
||||||
|
"https://client.eaglercraft.win",
|
||||||
|
"https://client2.eaglercraft.win",
|
||||||
|
"https://client3.eaglercraft.win"
|
||||||
|
];
|
||||||
|
|
||||||
console.log("Current Domain:", currentDomain); // Log the domain to debug
|
const trackingIds = {
|
||||||
|
"https://eaglercraftx1-8.github.io": "G-C44R8LD9MC",
|
||||||
|
"https://eaglercraftx1-8.netlify.app": "G-0R2ZXFSYVT",
|
||||||
|
"https://eaglercraftx1-8.onrender.com": "G-MND1TVBSXV",
|
||||||
|
"https://fastest.eaglercraft.win": "G-0FMCWKD9KG",
|
||||||
|
"https://notproxiedclient.eaglercraft.win": "G-QWHQVSNLB6",
|
||||||
|
"https://client.eaglercraft.win": "G-SGELV1H17J",
|
||||||
|
"https://client2.eaglercraft.win": "G-995EPK8DXR",
|
||||||
|
"https://client3.eaglercraft.win": "G-3M7CR3HRJV"
|
||||||
|
};
|
||||||
|
|
||||||
switch (currentDomain) {
|
let trackingId = "G-81F615LDEZ"; // Default fallback tracking ID
|
||||||
case "eaglercraftx1-8.github.io":
|
|
||||||
console.log("Matched GitHub Pages");
|
if (allowedOrigins.includes(currentOrigin)) {
|
||||||
trackingId = "G-C44R8LD9MC";
|
trackingId = trackingIds[currentOrigin];
|
||||||
break;
|
|
||||||
case "eaglercraftx1-8.netlify.app":
|
|
||||||
console.log("Matched Netlify");
|
|
||||||
trackingId = "G-0R2ZXFSYVT";
|
|
||||||
break;
|
|
||||||
case "eaglercraftx1-8.onrender.com":
|
|
||||||
console.log("Matched Render");
|
|
||||||
trackingId = "G-MND1TVBSXV";
|
|
||||||
break;
|
|
||||||
case "fastest.eaglercraft.win":
|
|
||||||
console.log("Matched Netlify / Fastest");
|
|
||||||
trackingId = "G-0FMCWKD9KG";
|
|
||||||
break;
|
|
||||||
case "notproxiedclient.eaglercraft.win":
|
|
||||||
console.log("Matched OnRender / NotProxiedClient");
|
|
||||||
trackingId = "G-QWHQVSNLB6";
|
|
||||||
break;
|
|
||||||
case "client.eaglercraft.win":
|
|
||||||
console.log("Matched GitHub Pages / Client 1");
|
|
||||||
trackingId = "G-SGELV1H17J";
|
|
||||||
break;
|
|
||||||
case "client2.eaglercraft.win":
|
|
||||||
console.log("Matched OnRender / Client 2");
|
|
||||||
trackingId = "G-995EPK8DXR";
|
|
||||||
break;
|
|
||||||
case "client3.eaglercraft.win":
|
|
||||||
console.log("Matched Netlify / Client3");
|
|
||||||
trackingId = "G-3M7CR3HRJV";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("Using Fallback Analytics");
|
|
||||||
trackingId = "G-81F615LDEZ";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("Current Origin:", currentOrigin); // Log the origin to debug
|
||||||
|
console.log("Using Tracking ID:", trackingId); // Log the tracking ID to debug
|
||||||
|
|
||||||
if (trackingId) {
|
if (trackingId) {
|
||||||
var analyticsScript = document.createElement('script');
|
const analyticsScript = document.createElement('script');
|
||||||
analyticsScript.async = true;
|
analyticsScript.async = true;
|
||||||
analyticsScript.src = `https://www.googletagmanager.com/gtag/js?id=${trackingId}`;
|
analyticsScript.src = `https://www.googletagmanager.com/gtag/js?id=${trackingId}`;
|
||||||
document.head.appendChild(analyticsScript);
|
document.head.appendChild(analyticsScript);
|
||||||
|
|
||||||
var scriptContent = document.createElement('script');
|
const scriptContent = document.createElement('script');
|
||||||
scriptContent.innerHTML = `
|
scriptContent.innerHTML = `
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
47
js/helperFunctions.js
Normal file
47
js/helperFunctions.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import isValidTag from "./isValidTag";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {HTMLElement} element
|
||||||
|
* @param {string[]} classlist
|
||||||
|
*/
|
||||||
|
export function addClasslist(element, ...classlist) {
|
||||||
|
element.classList.add(...classlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isArray(value) {
|
||||||
|
return value instanceof Array;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isObject(value) {
|
||||||
|
return value instanceof Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function selectId(selector) {
|
||||||
|
return document.querySelector(selector.startsWith('#') ? selector : `#${selector}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function selectClass(selector) {
|
||||||
|
return document.querySelector(selector.startsWith('.') ? selector : `.${selector}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function selectTag(selector) {
|
||||||
|
return isValidTag(selector) ? document.querySelector(selector) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function pushStyles(element, styles) {
|
||||||
|
for (const [key, value] of Object.entries(styles)) {
|
||||||
|
element.style[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function elementHasIdOrClass(element) {
|
||||||
|
return isValidTag(selector) ? (element.id !== "" && element.className !== "") : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hexToRGB(hex) {
|
||||||
|
const hexValue = hex.replace('#', '');
|
||||||
|
const r = parseInt(hexValue.substring(0, 2), 16);
|
||||||
|
const g = parseInt(hexValue.substring(2, 4), 16);
|
||||||
|
const b = parseInt(hexValue.substring(4, 6), 16);
|
||||||
|
return `rgb(${r}, ${g}, ${b})`;
|
||||||
|
}
|
8
js/isValidTag.js
Normal file
8
js/isValidTag.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import htmlTags from '../json/html-tags.json' with { type: 'json' };
|
||||||
|
import htmlVoidTags from '../json/html-tags-void.json' with { type: 'json' };
|
||||||
|
|
||||||
|
export const unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
|
||||||
|
|
||||||
|
export default function isValidTag(tag) {
|
||||||
|
return unifiedTagCollection.includes(tag);
|
||||||
|
}
|
71
js/main.js
71
js/main.js
@ -1,47 +1,56 @@
|
|||||||
// main.js
|
import { selectId, pushStyles, selectTag, addClasslist } from './helperFunctions';
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
function toggleVisibility(selector, condition) {
|
||||||
|
$(selector).toggle(condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateDarkMode() {
|
||||||
|
const isChecked = $("#darkModeCheckbox").is(":checked");
|
||||||
|
const body = selectTag('body');
|
||||||
|
if (isChecked) {
|
||||||
|
addClasslist(body, 'dark-mode');
|
||||||
|
} else {
|
||||||
|
body.classList.remove('dark-mode');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
// Clr data
|
|
||||||
function openClrModal() {
|
function openClrModal() {
|
||||||
document.getElementById('clr-data-model').style.display = 'flex';
|
pushStyles(selectId('clr-data-model'), { display: 'flex' });
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeClrModal() {
|
function closeClrModal() {
|
||||||
document.getElementById('clr-data-model').style.display = 'none';
|
pushStyles(selectId('clr-data-model'), { display: 'none' });
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('clr-data-model').addEventListener('click', function(event) {
|
function handleClrModalClick(event) {
|
||||||
if (event.target.classList.contains('cancel-btn')) {
|
const target = event.target;
|
||||||
|
if (target.classList.contains('cancel-btn')) {
|
||||||
closeClrModal();
|
closeClrModal();
|
||||||
} else if (event.target.tagName === 'BUTTON' && event.target.textContent === 'Yes') {
|
} else if (target.tagName === 'BUTTON' && target.textContent === 'Yes') {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// Search Bar Functionality
|
|
||||||
$('#search-bar').on('keyup', function() {
|
|
||||||
var query = $(this).val().toLowerCase();
|
|
||||||
$('.filter-button').each(function() {
|
|
||||||
var buttonText = $(this).text().toLowerCase();
|
|
||||||
if (buttonText.indexOf(query) > -1) {
|
|
||||||
$(this).show();
|
|
||||||
} else {
|
|
||||||
$(this).hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Show Modded Clients Functionality
|
|
||||||
function updateShowModded() {
|
|
||||||
var isChecked = $("#showModded").is(":checked");
|
|
||||||
if (isChecked) {
|
|
||||||
$("#moddedButtons").show();
|
|
||||||
} else {
|
|
||||||
$("#moddedButtons").hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleSearchBarKeyup() {
|
||||||
|
const query = $('#search-bar').val().toLowerCase();
|
||||||
|
$('.filter-button').each(function() {
|
||||||
|
toggleVisibility(this, $(this).text().toLowerCase().indexOf(query) > -1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateShowModded() {
|
||||||
|
toggleVisibility("#moddedButtons", $("#showModded").is(":checked"));
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#darkModeCheckbox").on("change", updateDarkMode);
|
||||||
|
updateDarkMode();
|
||||||
|
|
||||||
|
selectId('clr-data-model').addEventListener('click', handleClrModalClick);
|
||||||
|
|
||||||
|
$('#search-bar').on('keyup', handleSearchBarKeyup);
|
||||||
|
|
||||||
$("#showModded").on("change", updateShowModded);
|
$("#showModded").on("change", updateShowModded);
|
||||||
updateShowModded();
|
updateShowModded();
|
||||||
});
|
});
|
||||||
|
29
js/popup.js
29
js/popup.js
@ -1,44 +1,37 @@
|
|||||||
|
import { selectId, pushStyles } from "./helperFunctions";
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
if (!localStorage.getItem('dontShowPopup')) {
|
if (!localStorage.getItem('dontShowPopup')) {
|
||||||
document.getElementById('joinModal').style.display = 'flex';
|
pushStyles(selectId('joinModal'), { display: 'flex' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openModal() {
|
function openModal() {
|
||||||
document.getElementById('joinModal').style.display = 'flex';
|
pushStyles(selectId('joinModal'), { display: 'flex' });
|
||||||
}
|
}
|
||||||
|
|
||||||
function openCopyModal() {
|
function openCopyModal() {
|
||||||
document.getElementById('joinModal').style.display = 'none';
|
if (selectId('joinModal').style.display === 'flex') {
|
||||||
document.getElementById('copyModal').style.display = 'flex';
|
pushStyles(selectId('joinModal'), { display: 'none' });
|
||||||
if (document.getElementById('dontShowCheckbox').checked) {
|
}
|
||||||
|
pushStyles(selectId('copyModal'), { display: 'flex' });
|
||||||
|
if (selectId('dontShowCheckbox').checked) {
|
||||||
localStorage.setItem('dontShowPopup', true);
|
localStorage.setItem('dontShowPopup', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeModal() {
|
function closeModal() {
|
||||||
document.getElementById('joinModal').style.display = 'none';
|
pushStyles(selectId('copyModal'), { display: 'none' });
|
||||||
document.getElementById('copyModal').style.display = 'none';
|
|
||||||
if (document.getElementById('dontShowCheckbox').checked) {
|
if (document.getElementById('dontShowCheckbox').checked) {
|
||||||
localStorage.setItem('dontShowPopup', true);
|
localStorage.setItem('dontShowPopup', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyLink() {
|
function copyLink() {
|
||||||
const copyText = document.getElementById('discordLink').textContent;
|
const copyText = selectId('discordLink').textContent;
|
||||||
navigator.clipboard.writeText(copyText).then(function() {
|
navigator.clipboard.writeText(copyText).then(function() {
|
||||||
alert("Discord link copied to clipboard!");
|
alert("Discord link copied to clipboard!");
|
||||||
}, function() {
|
}, function() {
|
||||||
alert("Failed to copy the link.");
|
alert("Failed to copy the link.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clr data
|
|
||||||
|
|
||||||
function openClrModal() {
|
|
||||||
document.getElementById('clr-data-model').style.display = 'flex';
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeClrModal() {
|
|
||||||
document.getElementById('clr-data-model').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
17
json/html-tags-void.json
Normal file
17
json/html-tags-void.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
"area",
|
||||||
|
"base",
|
||||||
|
"br",
|
||||||
|
"col",
|
||||||
|
"embed",
|
||||||
|
"hr",
|
||||||
|
"img",
|
||||||
|
"input",
|
||||||
|
"link",
|
||||||
|
"menuitem",
|
||||||
|
"meta",
|
||||||
|
"param",
|
||||||
|
"source",
|
||||||
|
"track",
|
||||||
|
"wbr"
|
||||||
|
]
|
120
json/html-tags.json
Normal file
120
json/html-tags.json
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
[
|
||||||
|
"a",
|
||||||
|
"abbr",
|
||||||
|
"address",
|
||||||
|
"area",
|
||||||
|
"article",
|
||||||
|
"aside",
|
||||||
|
"audio",
|
||||||
|
"b",
|
||||||
|
"base",
|
||||||
|
"bdi",
|
||||||
|
"bdo",
|
||||||
|
"blockquote",
|
||||||
|
"body",
|
||||||
|
"br",
|
||||||
|
"button",
|
||||||
|
"canvas",
|
||||||
|
"caption",
|
||||||
|
"cite",
|
||||||
|
"code",
|
||||||
|
"col",
|
||||||
|
"colgroup",
|
||||||
|
"data",
|
||||||
|
"datalist",
|
||||||
|
"dd",
|
||||||
|
"del",
|
||||||
|
"details",
|
||||||
|
"dfn",
|
||||||
|
"dialog",
|
||||||
|
"div",
|
||||||
|
"dl",
|
||||||
|
"dt",
|
||||||
|
"em",
|
||||||
|
"embed",
|
||||||
|
"fieldset",
|
||||||
|
"figcaption",
|
||||||
|
"figure",
|
||||||
|
"footer",
|
||||||
|
"form",
|
||||||
|
"h1",
|
||||||
|
"h2",
|
||||||
|
"h3",
|
||||||
|
"h4",
|
||||||
|
"h5",
|
||||||
|
"h6",
|
||||||
|
"head",
|
||||||
|
"header",
|
||||||
|
"hgroup",
|
||||||
|
"hr",
|
||||||
|
"html",
|
||||||
|
"i",
|
||||||
|
"iframe",
|
||||||
|
"img",
|
||||||
|
"input",
|
||||||
|
"ins",
|
||||||
|
"kbd",
|
||||||
|
"label",
|
||||||
|
"legend",
|
||||||
|
"li",
|
||||||
|
"link",
|
||||||
|
"main",
|
||||||
|
"map",
|
||||||
|
"mark",
|
||||||
|
"math",
|
||||||
|
"menu",
|
||||||
|
"menuitem",
|
||||||
|
"meta",
|
||||||
|
"meter",
|
||||||
|
"nav",
|
||||||
|
"noscript",
|
||||||
|
"object",
|
||||||
|
"ol",
|
||||||
|
"optgroup",
|
||||||
|
"option",
|
||||||
|
"output",
|
||||||
|
"p",
|
||||||
|
"param",
|
||||||
|
"picture",
|
||||||
|
"pre",
|
||||||
|
"progress",
|
||||||
|
"q",
|
||||||
|
"rb",
|
||||||
|
"rp",
|
||||||
|
"rt",
|
||||||
|
"rtc",
|
||||||
|
"ruby",
|
||||||
|
"s",
|
||||||
|
"samp",
|
||||||
|
"script",
|
||||||
|
"search",
|
||||||
|
"section",
|
||||||
|
"select",
|
||||||
|
"slot",
|
||||||
|
"small",
|
||||||
|
"source",
|
||||||
|
"span",
|
||||||
|
"strong",
|
||||||
|
"style",
|
||||||
|
"sub",
|
||||||
|
"summary",
|
||||||
|
"sup",
|
||||||
|
"svg",
|
||||||
|
"table",
|
||||||
|
"tbody",
|
||||||
|
"td",
|
||||||
|
"template",
|
||||||
|
"textarea",
|
||||||
|
"tfoot",
|
||||||
|
"th",
|
||||||
|
"thead",
|
||||||
|
"time",
|
||||||
|
"title",
|
||||||
|
"tr",
|
||||||
|
"track",
|
||||||
|
"u",
|
||||||
|
"ul",
|
||||||
|
"var",
|
||||||
|
"video",
|
||||||
|
"wbr"
|
||||||
|
]
|
@ -7,6 +7,7 @@
|
|||||||
"tsup": "^8.3.5"
|
"tsup": "^8.3.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/jquery": "^3.5.32",
|
||||||
"@types/node": "^22.10.5",
|
"@types/node": "^22.10.5",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.7.3"
|
||||||
},
|
},
|
||||||
|
14
vercel.json
Normal file
14
vercel.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://openapi.vercel.sh/vercel.json",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"source": "/(.*)",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Origin-Trial",
|
||||||
|
"value": "AgqJBzNb/dYyS/+JovzFbM178SHW/01lYlxzk/Njmu1kQmVJ5j3CzIHhaPgBng6QiaZ/T6Q5qJtsWNX1ORQ4IAgAAAByeyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0LXhpLnZlcmNlbC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYkFzc2VtYmx5SlNQcm9taXNlSW50ZWdyYXRpb24iLCJleHBpcnkiOjE3NDQ2NzUyMDB9"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user