-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(js): swap logo and favicon object method color options
this is not active yet
- Loading branch information
Showing
1 changed file
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,47 @@ | ||
// Copyritht © 2022 Marcin Różewski MDSANIMA | ||
|
||
// change logo and favicon dynamically | ||
// const changeLogoFavicon = () => { | ||
// var svgPath = "/_static/logo/filled/svg/"; | ||
// var pngPath = "/_static/logo/squere/png/"; | ||
// swap logo | ||
function swapLogo(color) { | ||
var svgPath = "/_static/logo/filled/svg/"; | ||
let logo = document.images[0]; | ||
logo.src = svgPath + "logo_mdsanima_default_" + color + ".svg"; | ||
} | ||
|
||
// let logo = document.images[0]; | ||
// let favicon = document.querySelector("link[rel~='icon']"); | ||
// swap favicon | ||
function swapFavicon(color) { | ||
var pngPath = "/_static/logo/squere/png/"; | ||
let favicon = document.querySelector("link[rel~='icon']"); | ||
favicon.href = pngPath + "logo_mdsanima_default_" + color + "_1x.png"; | ||
} | ||
|
||
// logo.src = svgPath + "logo_mdsanima_default_18-stone.svg"; | ||
// favicon.href = pngPath + "logo_mdsanima_default_18-stone_1x.png"; | ||
// }; | ||
// object method color options | ||
const logo = { | ||
colorSky: (swapColor = () => { | ||
color = "02-sky"; | ||
swapLogo(color); | ||
}), | ||
colorTeal: (swapColor = () => { | ||
color = "17-teal"; | ||
swapLogo(color); | ||
}), | ||
colorLime: (swapColor = () => { | ||
color = "14-lime"; | ||
swapLogo(color); | ||
}), | ||
colorOrange: (swapColor = () => { | ||
color = "11-orange"; | ||
swapLogo(color); | ||
}), | ||
colorRed: (swapColor = () => { | ||
color = "10-red"; | ||
swapLogo(color); | ||
}), | ||
}; | ||
|
||
// setTimeout(() => changeLogoFavicon(), 2000); | ||
// const test = document.getElementById("bdg-info-line"); | ||
// const test = document.querySelector("svg[class~='sd-octicon-desktop-download']"); | ||
// const test = document.querySelector(".sd-octicon-file-code"); | ||
// const test = document.querySelector(".sidebar-tree .current-page>.reference"); | ||
// const test = document.querySelector(".sidebar-tree .current>.current-page"); | ||
// const test = document.querySelector(".sidebar-tree .toctree-l1> .reference"); | ||
// test.onclick = logo.colorOrange; |