|
|
@ -3,7 +3,7 @@ var frameworks = "a11yana,bahunya,bare,base,bullframe,bulma,caiuss,caramel,cardi
|
|
|
|
add_switcher();
|
|
|
|
add_switcher();
|
|
|
|
|
|
|
|
|
|
|
|
function switch_css(css) {
|
|
|
|
function switch_css(css) {
|
|
|
|
document.getElementsByTagName("link")[0].href = "https://dohliam.github.io/dropin-minimal-css/min/" + css + ".min.css";
|
|
|
|
css_link.href = "https://dohliam.github.io/dropin-minimal-css/min/" + css + ".min.css";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function capitalize(s) {
|
|
|
|
function capitalize(s) {
|
|
|
@ -13,6 +13,12 @@ function capitalize(s) {
|
|
|
|
return u;
|
|
|
|
return u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function on_css_load() {
|
|
|
|
|
|
|
|
var bgColor = getComputedStyle(document.body).backgroundColor;
|
|
|
|
|
|
|
|
if (bgColor.match(/^rgba\(.*\)/) ) bgColor = 'white';
|
|
|
|
|
|
|
|
switcher.style.backgroundColor = bgColor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function inline_switcher() {
|
|
|
|
function inline_switcher() {
|
|
|
|
switcher = document.getElementById("switcher");
|
|
|
|
switcher = document.getElementById("switcher");
|
|
|
|
frameworks_array = frameworks.split(",");
|
|
|
|
frameworks_array = frameworks.split(",");
|
|
|
@ -30,20 +36,23 @@ function inline_switcher() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function add_switcher() {
|
|
|
|
function add_switcher() {
|
|
|
|
stylesheet = document.getElementsByTagName("link")[0];
|
|
|
|
css_link = document.getElementsByTagName("link")[0];
|
|
|
|
if (stylesheet == undefined) {
|
|
|
|
if (css_link == undefined) {
|
|
|
|
head = document.getElementsByTagName('head')[0];
|
|
|
|
head = document.getElementsByTagName('head')[0];
|
|
|
|
link = document.createElement('link');
|
|
|
|
css_link = document.createElement('link');
|
|
|
|
link.rel="stylesheet";
|
|
|
|
css_link.rel="stylesheet";
|
|
|
|
link.type="text/css";
|
|
|
|
css_link.type="text/css";
|
|
|
|
link.href="https://dohliam.github.io/dropin-minimal-css/min/" + frameworks.split(",")[0] + ".min.css";
|
|
|
|
css_link.href="https://dohliam.github.io/dropin-minimal-css/min/" + frameworks.split(",")[0] + ".min.css";
|
|
|
|
head.appendChild(link);
|
|
|
|
head.appendChild(css_link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var new_div = document.createElement("div");
|
|
|
|
var new_div = document.createElement('div');
|
|
|
|
new_div.innerHTML = ' <div id="switcher"> </div>\n <script type="text/javascript">inline_switcher();</script>';
|
|
|
|
new_div.id = 'switcher';
|
|
|
|
document.body.insertBefore(new_div, document.body.firstChild);
|
|
|
|
new_div.innerHTML = ' <div> </div>\n <script type="text/javascript">inline_switcher();</script>';
|
|
|
|
document.body.style.paddingLeft = "24px"
|
|
|
|
document.body.prepend(new_div);
|
|
|
|
|
|
|
|
document.body.style.paddingLeft = "24px";
|
|
|
|
|
|
|
|
|
|
|
|
inline_switcher();
|
|
|
|
inline_switcher();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css_link.onload = on_css_load;
|
|
|
|
}
|
|
|
|
}
|
|
|
|