commit 6caba289661d29015d6a6cd62cc2b44013ca5534 Author: ZyLacx Date: Tue Oct 25 00:40:27 2022 +0200 Ver 1.0 diff --git a/assets/brandejsMC.jpg b/assets/brandejsMC.jpg new file mode 100644 index 0000000..f5d6e97 Binary files /dev/null and b/assets/brandejsMC.jpg differ diff --git a/assets/brandejsMatrix.jpg b/assets/brandejsMatrix.jpg new file mode 100644 index 0000000..4a1c32a Binary files /dev/null and b/assets/brandejsMatrix.jpg differ diff --git a/assets/brandejsMucitel.jpg b/assets/brandejsMucitel.jpg new file mode 100644 index 0000000..b19a62e Binary files /dev/null and b/assets/brandejsMucitel.jpg differ diff --git a/assets/brandejsNeon.jpg b/assets/brandejsNeon.jpg new file mode 100644 index 0000000..e62bff7 Binary files /dev/null and b/assets/brandejsNeon.jpg differ diff --git a/assets/brandejsWine.jpg b/assets/brandejsWine.jpg new file mode 100644 index 0000000..5a16ce2 Binary files /dev/null and b/assets/brandejsWine.jpg differ diff --git a/content.js b/content.js new file mode 100644 index 0000000..83731b4 --- /dev/null +++ b/content.js @@ -0,0 +1,61 @@ +let brandejsMucitel = browser.runtime.getURL("assets/brandejsMucitel.jpg"); +let brandejsVino = browser.runtime.getURL("assets/brandejsWine.jpg"); +let brandejsMinecraft = browser.runtime.getURL("assets/brandejsMC.jpg"); +let brandejsMatrix = browser.runtime.getURL("assets/brandejsMatrix.jpg"); +let brandejsNeon = browser.runtime.getURL("assets/brandejsNeon.jpg"); + +let photos = [brandejsMucitel, brandejsVino, brandejsMinecraft, brandejsMatrix, brandejsNeon]; + +let rng = Math.floor(Math.random() * photos.length); + +let main_menu_css = ` + #content.motiv-titulka { + background-image: url('${photos[rng]}'); + background-repeat: no-repeat; + background-position: 75% 0; + background-size: 550px auto; + }` + +let app_css = ` + #app_header_image { + background-image: url('${photos[rng]}'); + background-size: auto 100%; + background-position: 462px; + display: block !important; + top: -195px; + } + #app_header_image::after { + background-image: none; + } + #app_menu.empty { background-color: transparent }` + +let other_css = ` + ul.is-switch { float: left; } + #prepinace > ul > li > a { text-align: left; } + #app_menu.empty { background-color: transparent; } + .zivot_column { margin-top: 120px; } + .motiv-titulka .app_header_motiv_switch { + float: none; + right: 0; + top: 0 !important; } + .ikony { + float: left; + padding-left: 25%; + background-color: rgba(255, 255, 255, 0.7); + border-radius: 20px; }` + +let style = document.getElementsByTagName("style"); +if (style.length == 0) { + document.head.innerHTML += ""; +} +else { + let main_page = document.getElementsByClassName("motiv-titulka"); + if (main_page.length == 0) { + style[0].innerHTML += app_css + other_css; + } + else { + style[0].innerHTML += main_menu_css + other_css; + } +} + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..14e3c34 --- /dev/null +++ b/manifest.json @@ -0,0 +1,26 @@ +{ + "manifest_version": 2, + + "name": "Custom Brandejs theme for IS", + "version": "1.0", + "description": "The only proper way to enjoy MUNI IS (shamelessly stolen)", + + "browser_specific_settings": { + "gecko": { + "id": "aaaaaa@aaaaa" + } + }, + "content_scripts": [ + { + "matches": ["https://is.muni.cz/auth/*"], + "js": ["content.js"] + } + ], + "web_accessible_resources": [ + "assets/brandejsMatrix.jpg", + "assets/brandejsMC.jpg", + "assets/brandejsWine.jpg", + "assets/brandejsMucitel.jpg", + "assets/brandejsNeon.jpg" + ] +}