Implemented Theme Switch

This commit is contained in:
robiot 2021-09-16 16:53:21 +03:00
parent 55f2c520a0
commit fb4d01bd48
8 changed files with 388 additions and 50 deletions

View File

@ -69,6 +69,13 @@ _:-ms-fullscreen, :root body {
max-height: 20rem;
}
#theme-selector {
width: 100px;
height: 30px;
font-size: 13px;
margin-top: 5px;
}
.custom-select {
background-color: #646464;
color: white;

View File

@ -1 +1 @@
.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#426992;font-weight:bold;font-size:1em}.highlighted-warning{color:red;font-weight:bold}.custom-switch label{cursor:pointer;user-select:none}.nav-tabs{border-bottom:none !important}.nav-tabs .nav-link:hover{background-color:#375a7f}.nav-tabs .nav-link.active{background-color:#375a7f}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75)}#reverse-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}#bind-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}#msfvenom-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:white}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,0.75);height:100% !important}h2{color:white;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}.list-group-item.active,.list-group-item-action:focus,.list-group-item-action:hover{background-color:#375a7f}.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media(max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#426992;font-weight:bold;font-size:1em}.highlighted-warning{color:red;font-weight:bold}.custom-switch label{cursor:pointer;user-select:none}.nav-tabs{border-bottom:none !important}.nav-tabs .nav-link:hover{background-color:#375a7f}.nav-tabs .nav-link.active{background-color:#375a7f}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75)}#reverse-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}#bind-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}#msfvenom-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,0.75);background-color:#464646;max-height:20rem}#theme-selector{width:100px;height:30px;font-size:13px;margin-top:5px}.custom-select{background-color:#646464;color:white}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,0.75);height:100% !important}h2{color:white;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}.list-group-item.active,.list-group-item-action:focus,.list-group-item-action:hover{background-color:#375a7f}.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media(max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}

325
css/meme-mode.css Normal file
View File

@ -0,0 +1,325 @@
/*
Ain't got time for using CSS the right way. !important everything!
*/
[data-theme="meme"] {
background-color: pink !important;
}
[data-theme="meme"] .card {
background-color: rgb(175, 139, 173) !important;
color: #000;
}
[data-theme="meme"] .bg-white {
background-color: rgb(221, 215, 215) !important;
}
[data-theme="meme"] .bg-dark {
background-color: rgb(231, 212, 224) !important;
}
[data-theme="meme"] .rainbow {
text-shadow: 2px 2px 4px #000;
font-size: 40px;
-webkit-animation: rainbow 5s infinite;
-ms-animation: rainbow 5s infinite;
animation: rainbow 5s infinite;
font-family: 'Comic Mono';
}
[data-theme="meme"] .prompt-sign {
position: absolute;
top: 25px;
left: 40px;
pointer-events: none;
font-size: 1em;
color: #2e3e86;
}
[data-theme="meme"] .input-group-text {
background-color: #f1c6ce;
color: #000;
}
[data-theme="meme"] .btn {
background-color: #a56096;
color: #000;
border-color: #a56096;
}
[data-theme="meme"] .highlighted-parameter {
color: #7223b5;
font-weight: bold;
font-size: 1em;
}
[data-theme="meme"] .highlighted-warning {
color: red;
font-weight: bold;
}
[data-theme="meme"] .custom-switch label {
cursor: pointer;
user-select: none;
}
[data-theme="meme"] .custom-control-input:checked~.custom-control-label::before {
background-color: #7223b5;
}
[data-theme="meme"] #listener-command {
border: none !important;
border-radius: 5px;
box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75);
background-color: rgb(45, 139, 135);
color: #000;
}
[data-theme="meme"] #reverse-shell-command {
border: none !important;
border-radius: 5px;
box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75);
background-color: rgb(45, 139, 135);
color: #000;
max-height: 20rem;
}
[data-theme="meme"] #bind-shell-command {
border: none !important;
border-radius: 5px;
box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75);
background-color: rgb(45, 139, 135);
color: #000;
max-height: 20rem;
}
[data-theme="meme"] #msfvenom-command {
border: none !important;
border-radius: 5px;
box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75);
background-color: rgb(45, 139, 135);
color: #000;
max-height: 20rem;
}
[data-theme="meme"] .custom-select {
background-color: #f1c6ce;
color: #000;
border-color: #a56096;
}
[data-theme="meme"] .nav-link {
color: #000;
background: transparent;
box-shadow: 5px 5px 5px 0px rgba(153, 28, 143, 0.75);
}
[data-theme="meme"] .nav-link:hover {
background-color: #7223b5;
}
[data-theme="meme"] .nav-link.active {
background-color: #a56096;
color:#000;
}
[data-theme="meme"] .custom-control-input:checked {
color: #000;
}
[data-theme="meme"] a {
background-color: #f1c6ce;
color: #000;
}
[data-theme="meme"] .list-group-item {
background-color: #f1c6ce;
color: #000;
}
[data-theme="meme"] .list-group-item.active {
background-color: #a56096;
border-color: #000;
}
[data-theme="meme"] .list-group-item:hover {
background-color: #a56096;
}
[data-theme="meme"] .list-group-item.hover {
background-color: rgba(153, 28, 143, 0.75);
}
[data-theme="meme"] .container {
padding: 10px;
border-radius: 20px;
box-shadow: 10px 0px 20px 0px rgba(153, 28, 143, 0.75);
height: 100% !important;
}
[data-theme="meme"] .card-title {
color: #000 !important;
}
[data-theme="meme"] .custom-control-label {
color: black;
}
[data-theme="meme"] h2 {
color: white;
text-align: center;
}
[data-theme="meme"] .pre-wrap {
white-space: pre-wrap;
}
[data-theme="meme"] .card-body {
max-height: 40rem;
}
@font-face {
font-family: "Comic Mono";
src: url(../assets/ComicMono.ttf);
}
@-webkit-keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}
/* Internet Explorer */
@-ms-keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}
/* Standar Syntax */
@keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}

1
css/meme-mode.min.css vendored Normal file
View File

@ -0,0 +1 @@
[data-theme="meme"]{background-color:pink !important}[data-theme="meme"] .card{background-color:#af8bad !important;color:#000}[data-theme="meme"] .bg-white{background-color:#ddd7d7 !important}[data-theme="meme"] .bg-dark{background-color:#e7d4e0 !important}[data-theme="meme"] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme="meme"] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme="meme"] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme="meme"] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme="meme"] .highlighted-parameter{color:#7223b5;font-weight:bold;font-size:1em}[data-theme="meme"] .highlighted-warning{color:red;font-weight:bold}[data-theme="meme"] .custom-switch label{cursor:pointer;user-select:none}[data-theme="meme"] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme="meme"] #listener-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,0.75);background-color:#2d8b87;color:#000}[data-theme="meme"] #reverse-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,0.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme="meme"] #bind-shell-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,0.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme="meme"] #msfvenom-command{border:none !important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,0.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme="meme"] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme="meme"] .nav-link{color:#000;background:transparent;box-shadow:5px 5px 5px 0 rgba(153,28,143,0.75)}[data-theme="meme"] .nav-link:hover{background-color:#7223b5}[data-theme="meme"] .nav-link.active{background-color:#a56096;color:#000}[data-theme="meme"] .custom-control-input:checked{color:#000}[data-theme="meme"] a{background-color:#f1c6ce;color:#000}[data-theme="meme"] .list-group-item{background-color:#f1c6ce;color:#000}[data-theme="meme"] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme="meme"] .list-group-item:hover{background-color:#a56096}[data-theme="meme"] .list-group-item.hover{background-color:rgba(153,28,143,0.75)}[data-theme="meme"] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,0.75);height:100% !important}[data-theme="meme"] .card-title{color:#000 !important}[data-theme="meme"] .custom-control-label{color:black}[data-theme="meme"] h2{color:white;text-align:center}[data-theme="meme"] .pre-wrap{white-space:pre-wrap}[data-theme="meme"] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:CadetBlue}40%{color:yellow}50%{color:coral}60%{color:green}70%{color:cyan}80%{color:DeepPink}90%{color:DodgerBlue}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:CadetBlue}40%{color:yellow}50%{color:coral}60%{color:green}70%{color:cyan}80%{color:DeepPink}90%{color:DodgerBlue}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:CadetBlue}40%{color:yellow}50%{color:coral}60%{color:green}70%{color:cyan}80%{color:DeepPink}90%{color:DodgerBlue}100%{color:orange}}

View File

@ -12,6 +12,7 @@
<script src="assets/bootstrap-4.5.2.min.js"></script>
<link rel="stylesheet" href="css/dark-mode.min.css">
<link rel="stylesheet" href="css/light-mode.min.css">
<link rel="stylesheet" href="css/meme-mode.min.css">
<meta name="description" content="Online Reverse Shell generator with Local Storage functionality, URI & Base64 Encoding, MSFVenom Generator, and Raw Mode. Great for CTFs." />
<meta name="title" content="Online - Reverse Shell Generator">
<!-- Open Graph / Facebook -->
@ -49,17 +50,20 @@
<body class="bg-black">
<div class="container d-flex flex-column vh-100">
<div class="custom-control custom-switch float-right">
<input id="lightSwitch" type="checkbox" class="custom-control-input">
<label for="lightSwitch" class="custom-control-label small pr-2 pb-1" style="padding-top:2px"
data-toggle="tooltip" title="Toggle Light Mode">Light Mode 🌓
</label>
<div class="custom-control float-right" style="margin-left: -25px;">
<label for="theme-selector" class="card-title col-auto col-form-label float-left"
style="font-size:1rem">Theme</label>
<select class="custom-select" id="theme-selector">
<option class="os-item" value="dark">Dark</option>
<option class="os-item" value="light">Light</option>
<option class="os-item" value="meme">Meme</option>
</select>
</div>
<!-- Header -->
<div class="mb-auto row justify-content-center mt-3 mb-5">
<h2 class="rainbow">Reverse Shell Generator</h2>
</div>
<div class="row">
@ -448,7 +452,7 @@
<script src="js/raw-link.js"></script>
<!-- Light switch -->
<script src="js/light-mode-switch.min.js"></script>
<script src="js/light-mode-switch.js"></script>
<!-- Main js -->
<script src="js/script.js"></script>

View File

@ -1,9 +1,9 @@
var lightSwitch = document.getElementById("lightSwitch");
var themeSelector = $("#theme-selector");
window.addEventListener("load", function () {
if (lightSwitch) {
if (themeSelector) {
initTheme();
lightSwitch.addEventListener("change", function () {
resetTheme();
themeSelector.on('change', function() {
resetTheme(this.value);
});
}
});
@ -20,13 +20,14 @@ window.addEventListener("load", function () {
* @return {void}
*/
function initTheme() {
var lightThemeSelected =
localStorage.getItem("lightSwitch") !== null &&
localStorage.getItem("lightSwitch") === "light";
lightSwitch.checked = lightThemeSelected;
lightThemeSelected
? document.body.setAttribute("data-theme", "light")
: document.body.removeAttribute("data-theme");
var currentTheme = localStorage.getItem("currentTheme");
if (currentTheme === null) {
console.log("null")
document.body.removeAttribute("data-theme")
} else {
document.body.setAttribute("data-theme", currentTheme)
}
}
/**
@ -35,12 +36,13 @@ function initTheme() {
* applied.
* @return {void}
*/
function resetTheme() {
if (lightSwitch.checked) {
document.body.setAttribute("data-theme", "light");
localStorage.setItem("lightSwitch", "light");
function resetTheme(currentTheme) {
console.log(currentTheme)
if (currentTheme !== "dark") {
document.body.setAttribute("data-theme", currentTheme);
localStorage.setItem("currentTheme", currentTheme);
} else {
document.body.removeAttribute("data-theme");
localStorage.removeItem("lightSwitch");
localStorage.removeItem("currentTheme");
}
}

View File

@ -1 +0,0 @@
var lightSwitch=document.getElementById("lightSwitch");function initTheme(){var t=null!==localStorage.getItem("lightSwitch")&&"light"===localStorage.getItem("lightSwitch");lightSwitch.checked=t,t?document.body.setAttribute("data-theme","light"):document.body.removeAttribute("data-theme")}function resetTheme(){lightSwitch.checked?(document.body.setAttribute("data-theme","light"),localStorage.setItem("lightSwitch","light")):(document.body.removeAttribute("data-theme"),localStorage.removeItem("lightSwitch"))}window.addEventListener("load",function(){lightSwitch&&(initTheme(),lightSwitch.addEventListener("change",function(){resetTheme()}))});

View File

@ -1,25 +1,25 @@
'''
Use this when you modified any css in the css/ folder.
'''
import os
try:
from csscompressor import compress
except ModuleNotFoundError:
os.system("python -m pip install csscompressor")
from csscompressor import compress
def main():
not_minified = [f"./css/{f}" for f in os.listdir("./css") if not f.endswith(".min.css")]
for file in not_minified:
print(file)
with open(file, "r") as input_file:
css_minified = compress(input_file.read())
with open(f"{file.replace('.css', '')}.min.css", "w") as output_file:
output_file.write(css_minified)
if __name__ == "__main__":
main()
'''
Use this when you modified any css in the css/ folder.
'''
import os
try:
from csscompressor import compress
except ModuleNotFoundError:
os.system("python -m pip install csscompressor")
from csscompressor import compress
def main():
not_minified = [f"./css/{f}" for f in os.listdir("./css") if not f.endswith(".min.css")]
for file in not_minified:
print(file)
with open(file, "r") as input_file:
css_minified = compress(input_file.read())
with open(f"{file.replace('.css', '')}.min.css", "w") as output_file:
output_file.write(css_minified)
if __name__ == "__main__":
main()