Ver 1.0
This commit is contained in:
commit
6caba28966
7 changed files with 87 additions and 0 deletions
BIN
assets/brandejsMC.jpg
Normal file
BIN
assets/brandejsMC.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 215 KiB |
BIN
assets/brandejsMatrix.jpg
Normal file
BIN
assets/brandejsMatrix.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 522 KiB |
BIN
assets/brandejsMucitel.jpg
Normal file
BIN
assets/brandejsMucitel.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 466 KiB |
BIN
assets/brandejsNeon.jpg
Normal file
BIN
assets/brandejsNeon.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
BIN
assets/brandejsWine.jpg
Normal file
BIN
assets/brandejsWine.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 224 KiB |
61
content.js
Normal file
61
content.js
Normal file
|
@ -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 += "<style>" + app_css + other_css + "</style>";
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
26
manifest.json
Normal file
26
manifest.json
Normal file
|
@ -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"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue