diff --git a/fr/script.js b/fr/script.js index 83e72d7..f902047 100644 --- a/fr/script.js +++ b/fr/script.js @@ -10,29 +10,37 @@ function fonts() // go to the div "nav" let nav = document.getElementsByClassName("nav_left"); - // list the names of the fonts in fonts.css - let fontName = list_fonts(); - // add an anchor let anchor = document.createElement("a"); anchor.setAttribute('id', "fonts"); nav[0].appendChild(anchor); + /*---------------------------*/ + // manually write list of fonts anchor.innerHTML = `

fonts

- - + - - + + + - - + +
`; + /*-------------------------------------*/ + // or automatically write list of fonts : /* + + // list the names of the fonts in fonts.css + // first solution with a complicated function : + let fontName = list_fonts(); + // or with this really easy function : + let list_my_fonts = Array.from(document.fonts); + // add the buttons automatically let p_font = document.createElement("p"); p_font.innerHTML = "fonts"; @@ -58,6 +66,7 @@ function change_font() document.documentElement.style.cssText = "--font-texts: " + name; } +/* function list_fonts() { // get all style sheets @@ -72,5 +81,5 @@ function list_fonts() let fontName = Object.values(fontRules).map(val => val.cssText.match(/(?<=font-family: ").+?(?=")/)); return fontName; } - +*/ diff --git a/styles/global.css b/styles/global.css index 9a5ac4e..dcc3eeb 100644 --- a/styles/global.css +++ b/styles/global.css @@ -43,8 +43,8 @@ /*TEXTE*/ /* fonts */ --font-titles: 'paradroid'; - --font-texts: 'louisgeorge'; - --font-fallback: 'cabrion'; + --font-texts: 'ptroot'; + --font-fallback: 'louisgeorge'; /* colors texts */