Skip to content

Commit 72e8a46

Browse files
Adding Javascript to the pages when the Dyslexic font is button is pressed. This will allow it to retain the setting between pages and refreshes
1 parent e114f90 commit 72e8a46

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

js/change-font.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
"use strict"
22

3-
$(function() {
3+
$(function () {
4+
$(document).ready(function () {
5+
if (localStorage.getItem("CodeWithOpenDyslexic") === "1") {
6+
$('body').toggleClass('open-dyslexic');
7+
}
8+
});
9+
410
$('#change-font').click(function () {
11+
if (localStorage.getItem("CodeWithOpenDyslexic") === "1") {
12+
localStorage.setItem("CodeWithOpenDyslexic", 0);
13+
} else {
14+
localStorage.setItem("CodeWithOpenDyslexic", 1);
15+
}
16+
517
$('body').toggleClass('open-dyslexic');
618
});
719
})

0 commit comments

Comments
 (0)