ajout du script pour les fonts
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<link href="./styles/style.css" type="text/css" rel="stylesheet">
|
||||
<link href="./styles/actualites.css" type="text/css" rel="stylesheet">
|
||||
<style> html {visibility: hidden; opacity: 0;} </style>
|
||||
<script src="./fr/script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<link href="./styles/style.css" type="text/css" rel="stylesheet">
|
||||
<link href="./styles/lettres.css" type="text/css" rel="stylesheet">
|
||||
<style> html {visibility: hidden; opacity: 0;} </style>
|
||||
<script src="./fr/script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<link href="./styles/style.css" type="text/css" rel="stylesheet">
|
||||
<link href="./styles/lettres_2021.css" type="text/css" rel="stylesheet">
|
||||
<style> html {visibility: hidden; opacity: 0;} </style>
|
||||
<script src="./fr/script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<link href="./styles/litterall.css" type="text/css" rel="stylesheet">
|
||||
<link href="./styles/style.css" type="text/css" rel="stylesheet">
|
||||
<style> html {visibility: hidden; opacity: 0;} </style>
|
||||
<script src="./fr/script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
49
fr/script.js
49
fr/script.js
@@ -1,4 +1,45 @@
|
||||
let nav = document.getElementsByClassName("nav_left");
|
||||
let anchor = document.createElement("a");
|
||||
anchor.innerHTML = "test";
|
||||
nav[0].appendChild(anchor);
|
||||
|
||||
fonts();
|
||||
|
||||
function fonts()
|
||||
{
|
||||
let url = window.location.href.match(/\#.*/);
|
||||
|
||||
if (url == "#fonts")
|
||||
{
|
||||
// go to the div "nav"
|
||||
let nav = document.getElementsByClassName("nav_left");
|
||||
|
||||
// add an anchor
|
||||
let anchor = document.createElement("a");
|
||||
anchor.setAttribute('id', "fonts");
|
||||
anchor.innerHTML = `
|
||||
<p>fonts</p>
|
||||
<div id="fonts_dropdown">
|
||||
<button onclick="change_font()">louisgeorge (defaut)</button>
|
||||
<button onclick="change_font()">cabrion</button>
|
||||
<button onclick="change_font()">paradroid (titres)</button>
|
||||
<button onclick="change_font()">evolvanta</button>
|
||||
<button onclick="change_font()">ptroot</button>
|
||||
<button onclick="change_font()">tgalcefun</button>
|
||||
</div>
|
||||
`;
|
||||
nav[0].appendChild(anchor);
|
||||
}
|
||||
}
|
||||
|
||||
function change_font()
|
||||
{
|
||||
let name = event.target.textContent.split(' ')[0];
|
||||
console.log(name);
|
||||
document.documentElement.style.cssText = "--font-texts: " + name;
|
||||
/*
|
||||
let content = getComputedStyle(document.documentElement).getPropertyValue('font-family');
|
||||
let content = getComputedStyle(document.documentElement).getPropertyValue('@font-face');
|
||||
let content = Array.from(document.styleSheets);
|
||||
console.log(content);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,37 +19,6 @@
|
||||
url('../fonts/louisgeorge/louis_george_cafe.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'louisgeorge_bold';
|
||||
src: url('../fonts/louisgeorge/louis_george_cafe_bold.woff2') format('woff2'),
|
||||
url('../fonts/louisgeorge/louis_george_cafe_bold.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe_bold.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'louisgeorge_bolditalic';
|
||||
src: url('../fonts/louisgeorge/louis_george_cafe_bold_italic.woff2') format('woff2'),
|
||||
url('../fonts/louisgeorge/louis_george_cafe_bold_italic.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe_bold_italic.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'louisgeorge_italic';
|
||||
src: url('../fonts/louisgeorge/louis_george_cafe_italic.woff2') format('woff2'),
|
||||
url('../fonts/louisgeorge/louis_george_cafe_italic.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe_italic.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'louisgeorge_light';
|
||||
src: url('../fonts/louisgeorge/louis_george_cafe_light.woff2') format('woff2'),
|
||||
url('../fonts/louisgeorge/louis_george_cafe_light.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe_light.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'louisgeorge_lightitalic';
|
||||
src: url('../fonts/louisgeorge/louis_george_cafe_light_italic.woff2') format('woff2'),
|
||||
url('../fonts/louisgeorge/louis_george_cafe_light_italic.woff') format('woff');
|
||||
url('../fonts/louisgeorge/louis_george_cafe_light_italic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*test fonts*/
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
--font-titles: 'paradroid';
|
||||
--font-texts: 'louisgeorge';
|
||||
--font-fallback: 'cabrion';
|
||||
--font-fallback2: 'ptroot';
|
||||
|
||||
/* colors texts */
|
||||
|
||||
@@ -61,3 +60,4 @@
|
||||
--footer-height: 150px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
28
styles/skeleton.css
vendored
28
styles/skeleton.css
vendored
@@ -80,3 +80,31 @@ footer iframe {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*- - - - - - - - - - - - - - - - - - - - -*/
|
||||
/* test for fonts */
|
||||
/*- - - - - - - - - - - - - - - - - - - - -*/
|
||||
|
||||
.nav_left #fonts {
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav_left #fonts:hover #fonts_dropdown {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.nav_left #fonts #fonts_dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0px;
|
||||
flex-direction: column;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav_left #fonts #fonts_dropdown button {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ h1, h2, h3, h4, h5, h6, em {
|
||||
font-family: var(--font-titles), var(--font-fallback), sans-serif;
|
||||
}
|
||||
a, p, li {
|
||||
font-family: var(--font-texts), var(--font-fallback), var(--font-fallback2), sans-serif;
|
||||
font-family: var(--font-texts), var(--font-fallback), sans-serif;
|
||||
}
|
||||
code {
|
||||
font-family: monospace;
|
||||
|
||||
Reference in New Issue
Block a user