Skip to content

Commit

Permalink
docs(js): swap logo and favicon object method color options
Browse files Browse the repository at this point in the history
this is not active yet
  • Loading branch information
mdsanima committed Apr 16, 2022
1 parent d666587 commit 9ff13ba
Showing 1 changed file with 42 additions and 10 deletions.
52 changes: 42 additions & 10 deletions docs/_static/mdsanima.js
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;

0 comments on commit 9ff13ba

Please sign in to comment.