feat: Added New Theme
This commit is contained in:
+48
@@ -22,15 +22,63 @@ var theme = (() => {
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
var HACKER_KEY = 'argus-hacker-unlocked';
|
||||
|
||||
function isHackerUnlocked() {
|
||||
try {
|
||||
return localStorage.getItem(HACKER_KEY) === 'true';
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function unlockHacker() {
|
||||
try {
|
||||
localStorage.setItem(HACKER_KEY, 'true');
|
||||
} catch (e) { }
|
||||
addHackerOption();
|
||||
}
|
||||
|
||||
function addHackerOption() {
|
||||
var picker = document.getElementById('theme-picker');
|
||||
if (!picker.querySelector('option[value="hacker"]')) {
|
||||
var opt = document.createElement('option');
|
||||
opt.value = 'hacker';
|
||||
opt.textContent = '\u2588 H4CK3R';
|
||||
picker.appendChild(opt);
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
var saved = get();
|
||||
set(saved);
|
||||
|
||||
// Add hacker option if previously unlocked
|
||||
if (isHackerUnlocked()) {
|
||||
addHackerOption();
|
||||
}
|
||||
|
||||
var picker = document.getElementById('theme-picker');
|
||||
picker.value = saved;
|
||||
picker.addEventListener('change', function () {
|
||||
set(picker.value);
|
||||
});
|
||||
|
||||
// Easter egg: listen on the scan input
|
||||
var scanInput = document.getElementById('ip-range-input');
|
||||
scanInput.addEventListener('input', function () {
|
||||
var val = scanInput.value.toLowerCase().trim();
|
||||
if (val === 'all your base are belong to us') {
|
||||
if (!isHackerUnlocked()) {
|
||||
unlockHacker();
|
||||
set('hacker');
|
||||
picker.value = 'hacker';
|
||||
scanInput.value = '';
|
||||
console.log('%c> ACCESS GRANTED', 'color: #00ff41; font-size: 20px; font-family: monospace;');
|
||||
console.log('%c> HACKER THEME UNLOCKED', 'color: #00ff41; font-size: 14px; font-family: monospace;');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Apply immediately (before DOMContentLoaded) to prevent flash
|
||||
|
||||
Reference in New Issue
Block a user