Compare commits

..

No commits in common. "1eeb19358f5e75241ca85e94a141611ed639c6bd" and "998fb22715cf355b82a5883c80b27b96f5dc8ad2" have entirely different histories.

3 changed files with 50 additions and 1924 deletions

View file

@ -1,3 +1,4 @@
//
// Show/hide some sections by clicking on the title.
//
@ -21,25 +22,18 @@ function setStatus(id, shown, content, record) {
content.classList.remove("anim-hide") ;
content.classList.remove("hidden") ;
span.innerHTML = "▾" ;
if (record) {
content.classList.add("anim-show");
} else {
content.classList.add("shown");
if (record) { content.classList.add("anim-show") ; }
else { content.classList.add("shown") ; }
}
} else {
else {
content.classList.remove("anim-show") ;
content.classList.remove("shown") ;
span.innerHTML = "▸" ;
if (record) {
content.classList.add("anim-hide");
} else {
content.classList.add("hidden");
}
if (record) { content.classList.add("anim-hide") ; }
else { content.classList.add("hidden") ; }
}
if (record) {
saveStatus(id, shown);
}
if (record) { saveStatus(id, shown) ; }
}
// Invoked at load-time once for every yfold section.
@ -59,9 +53,11 @@ function initYfold(id) {
if (local === 'true') {
shown = true ;
} else if (local === 'false') {
}
else if (local === 'false') {
shown = false ;
} else {
}
else {
// Get default value
var defv = content.getAttribute("data-yfold-default") ;
if (defv === 'hide') {
@ -125,64 +121,10 @@ window.onload = function() {
}
});
snippet.appendChild(img)
snippet.appendChild(theme)
} else {
console.log(snippet.classList);
}
if (typeof(Storage) !== "undefined") {
var theme = localStorage.getItem("theme");
console.log("theme : " + theme)
if (theme === "/Y/ystyle.css") {
css_url = "/Y/ystyle.css";
} else if (theme === "/Y/ystyle2.css") {
css_url = "/Y/ystyle2.css";
changeCSS(css_url, 0)
} else {
// Get default value
css_url = "/Y/ystyle.css";
}
}
var toggler = document.createElement("a")
toggler.setAttribute("id", "toggler")
toggler.style.position = "absolute"
toggler.style.top = "12px"
toggler.style.right = "12px"
toggler.style.padding = "10px"
toggler.style.borderRadius = "7px"
toggler.style.background = "#335"
toggler.style.color = "#eee"
toggler.style.zIndex = "12"
toggler.innerHTML = "theme"
toggler.style.cursor = "pointer"
toggler.addEventListener("click", function() {
if (css_url == "/Y/ystyle.css") {
css_url = "/Y/ystyle2.css";
} else {
css_url = "/Y/ystyle.css";
}
changeCSS(css_url, 0)
})
document.body.appendChild(toggler)
}
function changeCSS(css_file, cssLinkIndex) {
if (typeof(Storage) !== "undefined") {
localStorage.setItem("theme", css_file);
}
console.log("changing css")
var oldlink = document.getElementsByTagName("link").item(cssLinkIndex);
var newlink = document.createElement("link");
newlink.setAttribute("rel", "stylesheet");
newlink.setAttribute("type", "text/css");
newlink.setAttribute("href", css_file);
document.getElementsByTagName("head").item(cssLinkIndex).replaceChild(newlink, oldlink);
}
};

View file

@ -1,8 +1,8 @@
/* POLICES */
/* @font-face {
@font-face {
font-family: 'Poppins';
src: url('https://fontlibrary.org//assets/fonts/poppins/fed70e8826194d3ab847c777f43c10ea/3352653dedd571bbc490c8be132b38cd/PoppinsLight.ttf') format('truetype');
} */
}
/* règles generéales */
* {

File diff suppressed because it is too large Load diff