Commit 48c3a2b4 authored by Roberto Bochet's avatar Roberto Bochet

Fix storto cit

parent 30e75806
Pipeline #433 passed with stage
in 1 minute and 18 seconds
// A $( document ).ready() block.
$( document ).ready(function() {
$(document).ready(function () {
// DropCap.js
var dropcaps = document.querySelectorAll(".dropcap");
......@@ -9,53 +9,53 @@ $( document ).ready(function() {
var nav = responsiveNav(".nav-collapse");
// Round Reading Time
$(".post .meta .time").text(function (index, value) {
return Math.round(parseFloat(value));
});
$(".post .meta .time").text(function (index, value) {
return Math.round(parseFloat(value));
});
});
function fixSottoStortoCit() {
var body = document.querySelector('body');
var link = document.getElementById('fix-sotto-storto-link');
if (body.className.includes("sotto-dritto")) {
body.className = "";
link.text = "Fix rotation";
} else {
body.className = "sotto-dritto";
link.text = "Lol no, put it back";
}
if (document.body.classList.contains("sotto-dritto")) {
document.body.classList.remove("sotto-dritto");
document.getElementById('fix-sotto-storto-link').text = "Fix rotation";
} else {
document.body.classList.add("sotto-dritto");
document.getElementById('fix-sotto-storto-link').text = "Lol no, put it back";
}
}
// opendyslexic mod
var __opendyslexic_loaded = false
var __opendyslexic_loaded = false;
function fixOpenDyslexic() {
if(!__opendyslexic_loaded){
var od_font = document.createElement('style');
const font_path_regular = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Regular.otf';
const font_path_bold = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Bold.otf';
const font_path_italic = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Italic.otf';
od_font.appendChild(document.createTextNode(
// font-face
`@font-face { font-family: OpenDyslexic; src: url('${font_path_regular}') format('opentype'); }\n`
+ `@font-face { font-family: OpenDyslexic; font-weight: bold; src: url('${font_path_bold}') format('opentype'); }\n`
+ `@font-face { font-family: OpenDyslexic; font-style: italic; src: url('${font_path_italic}') format('opentype'); }\n`
// class rule
+ ".opendyslexic, .opendyslexic p, .opendyslexic a, .opendyslexic span, .opendyslexic div" +
".opendyslexic h1, .opendyslexic h2 , .opendyslexic h3 { font-family: 'OpenDyslexic' !important }"
));
document.getElementsByTagName( "head" )[0].appendChild( od_font );
__opendyslexic_loaded = true
}
if(document.body.classList.contains("opendyslexic")){
document.body.classList.remove("opendyslexic");
document.getElementById('fix-open-dyslexic-link').innerHTML = 'Enable futuristic font'
}else{
document.body.classList.add("opendyslexic");
document.getElementById('fix-open-dyslexic-link').innerHTML = 'Disable futuristic font'
}
if (!__opendyslexic_loaded) {
var od_font = document.createElement('style');
const font_path_regular = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Regular.otf';
const font_path_bold = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Bold.otf';
const font_path_italic = static_url + 'site/assets/fonts/opendyslexic/compiled/OpenDyslexic-Italic.otf';
od_font.appendChild(document.createTextNode(
// font-face
`@font-face { font-family: OpenDyslexic; src: url('${font_path_regular}') format('opentype'); }\n`
+ `@font-face { font-family: OpenDyslexic; font-weight: bold; src: url('${font_path_bold}') format('opentype'); }\n`
+ `@font-face { font-family: OpenDyslexic; font-style: italic; src: url('${font_path_italic}') format('opentype'); }\n`
// class rule
+ ".opendyslexic, .opendyslexic p, .opendyslexic a, .opendyslexic span, .opendyslexic div" +
".opendyslexic h1, .opendyslexic h2 , .opendyslexic h3 { font-family: 'OpenDyslexic' !important }"
));
document.getElementsByTagName("head")[0].appendChild(od_font);
__opendyslexic_loaded = true
}
if (document.body.classList.contains("opendyslexic")) {
document.body.classList.remove("opendyslexic");
document.getElementById('fix-open-dyslexic-link').innerHTML = 'Enable futuristic font'
} else {
document.body.classList.add("opendyslexic");
document.getElementById('fix-open-dyslexic-link').innerHTML = 'Disable futuristic font'
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment