Commit b52895bc authored by ROBERT PATRICK CAREY III's avatar ROBERT PATRICK CAREY III 🗿
Browse files

Updates

parent 297148a6
......@@ -3,18 +3,22 @@
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
}
#font-sans {
font-size: 20px;
padding: 0 1rem;
}
#font-dyslexic {
font-size: 20px;
padding: 3px 1rem 0 1rem;
}
.sidebar.collapsed {
/* hide it for small displays*/
display: none;
}
@media (min-width: 768px) {
.sidebar.collapsed {
display: block;
......@@ -22,122 +26,149 @@
margin-left: -25%;
}
}
@font-face {
font-family: open-dyslexic;
src: url("../fonts/OpenDyslexic-Regular.woff");
}
.links .nav-link {
padding: 0;
}
.links .nav-link a {
padding: 0 .75rem;
}
.links .nav-link:first-child a {
padding-left: 0;
}
.links .nav-link:last-child a {
padding-right: 0;
}
.modal-content {
background-color: #f5f5f3;
}
.modal-content dt {
margin-bottom: 0.25rem;
}
.modal-content kbd {
cursor: help;
}
.dark-mode {
opacity: 0.75;
}
.dark-mode .modal-content {
color: #becbda;
background-color: #1e2631 !important;
}
.dark-mode .modal-header {
border-bottom: 1px solid #283340;
}
.dark-mode .modal-footer {
border-top: 1px solid #283340;
}
.dark-mode .breadcrumb {
background-color: #283340;
-webkit-box-shadow: none;
box-shadow: none;
}
.dark-mode .jumbotron {
background-color: #283340;
}
.dark-mode .card {
background-color: #283340;
}
.dark-mode .paragraph-title {
color: #99adc5 !important;
border-bottom: 1px solid rgba(190,203,218,0.45) !important;
}
.dark-mode svg.svg-inline--fa path {
fill: #99adc5 !important;
}
.dark-mode .glossary-term {
color: #99adc5;
}
.dark-mode .nav-link,
.dark-mode .nav-item a,
.dark-mode a {
color: #48b1ce;
}
.dark-mode .nav-pills .nav-link:hover,
.dark-mode .nav-pills .nav-link:focus,
.dark-mode .nav-pills .nav-link:active {
background-color: #3b444f;
}
.dark-mode .btn-secondary {
color: #becbda;
background-color: #3b4c60;
border-color: #3b4c60;
}
.dark-mode .btn-outline-secondary:hover {
background-color: #3b4c60;
border-color: #3b4c60;
}
.dark-mode.reading-mode .card {
color: #becbda;
background-color: transparent;
}
.dark-mode.reading-mode .breadcrumb {
background-color: transparent;
padding-left: 0;
}
.dark-mode body {
color: #becbda;
background-color: #1e2631 !important;
}
.reading-mode body {
background-color: white;
}
.reading-mode .breadcrumb {
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
padding: .75rem 1rem .75rem 0;
}
.reading-mode .card {
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0;
background-color: transparent;
}
.reading-mode .paragraph {
border: none !important;
background-color: transparent !important;
}
.reading-mode .paragraph-title {
background-color: transparent !important;
}
.reading-mode .card-body,
.reading-mode .card-block, .reading-mode .field__item > .card-block {
padding: 1rem 0;
}
.reading-mode .jumbotron {
-webkit-box-shadow: none;
box-shadow: none;
......@@ -145,31 +176,42 @@
padding: 0;
background-color: transparent;
}
.reading-mode iframe {
border-radius: 0;
}
.reading-mode .paragraph--type-minitab-example .thumbnail {
margin: 0 0.65rem 0 0rem;
}
.font-sans {
font-family: "Open Sans", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
.font-sans, .font-sans body {
font-family: 'Open Sans', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-family: var(--font-family-sans-serif);
}
.font-serif {
.font-serif, .font-serif body {
font-family: 'Apple Garamond', Garamond, Georgia, 'Times New Roman', Times, serif;
font-family: var(--font-family-sans-serif);
}
.font-dyslexic {
.font-dyslexic, .font-dyslexic body {
font-family: open-dyslexic;
font-family: var(--font-family-dyslexic);
}
.col-form-label {
display: block;
font-size: 80%;
}
.btn-outline-secondary {
color: #adb5bd;
background-color: transparent;
background-image: none;
border-color: #adb5bd;
}
.btn-outline-secondary:hover {
color: #fff;
background-color: #adb5bd;
......
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var o={fontSize:{base:1.1,max:1.5,min:.75,increment:.5},fontFamily:"sans",viewingMode:"light",readingMode:"enable"},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fontSize,n=void 0===t?o.fontSize.base:t,i=e.fontFamily,r=void 0===i?o.fontFamily:i,s=e.viewingMode,l=void 0===s?o.viewingMode:s,a=e.readingMode;return{fontSize:n,fontFamily:r,viewingMode:l,readingMode:void 0===a?o.readingMode:a,setFontSize:function(e){e=e||o.fontSize.base;try{e<o.fontSize.min?e=o.fontSize.min:e>o.fontSize.max&&(e=o.fontSize.max),document.body.style.fontSize=e+"rem",this.fontSize=e}catch(e){console.warn(e)}return this},setFontFamily:function(e){e=e||o.fontFamily;try{"serif"==e?(document.documentElement.classList.remove("font-sans","font-dyslexic"),document.documentElement.classList.add("font-serif")):"dyslexic"==e?(document.documentElement.classList.remove("font-sans","font-serif"),document.documentElement.classList.add("font-dyslexic")):(e="sans",document.documentElement.classList.remove("font-dyslexic","font-serif"),document.documentElement.classList.add("font-sans")),this.fontFamily=e}catch(e){console.warn(e)}return this},setViewingMode:function(e){e=e||o.viewingMode;try{if("dark"==e)document.documentElement.classList.remove("light-mode"),document.documentElement.classList.add("dark-mode");else{if("light"!=e)throw"Unsupported viewing mode: "+e;document.documentElement.classList.remove("dark-mode"),document.documentElement.classList.add("light-mode")}this.viewingMode=e}catch(e){console.warn(e)}return this},setReadingMode:function(e){e=e||o.readingMode;try{"disable"==e?document.documentElement.classList.add("reading-mode"):(e="enable",document.documentElement.classList.remove("reading-mode")),this.readingMode=e}catch(e){console.warn(e)}return this},setSelected:function(){this.setFontSize(this.fontSize),this.setFontFamily(this.fontFamily),this.setViewingMode(this.viewingMode),this.setReadingMode(this.readingMode);var e=document.querySelectorAll(".fontSlider"),t=!0,n=!1,o=void 0;try{for(var i,r=e[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){i.value.value=this.fontSize}}catch(e){n=!0,o=e}finally{try{!t&&r.return&&r.return()}finally{if(n)throw o}}var s=document.querySelectorAll(".toggle-font-"+this.fontFamily),l=!0,a=!1,c=void 0;try{for(var d,u=s[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){d.value.classList.add("active")}}catch(e){a=!0,c=e}finally{try{!l&&u.return&&u.return()}finally{if(a)throw c}}var f=document.querySelectorAll(".toggle-"+this.viewingMode+"-mode"),m=!0,g=!1,v=void 0;try{for(var y,h=f[Symbol.iterator]();!(m=(y=h.next()).done);m=!0){y.value.classList.add("active")}}catch(e){g=!0,v=e}finally{try{!m&&h.return&&h.return()}finally{if(g)throw v}}var S=document.querySelectorAll("."+this.readingMode+"-cards"),b=!0,p=!1,w=void 0;try{for(var F,M=S[Symbol.iterator]();!(b=(F=M.next()).done);b=!0){F.value.classList.add("active")}}catch(e){p=!0,w=e}finally{try{!b&&M.return&&M.return()}finally{if(p)throw w}}}}};document.addEventListener("DOMContentLoaded",function(e){!function(e){var t=void 0,n=function(){if("undefined"!=typeof Storage)return JSON.parse(localStorage.getItem("userPreferences"));console.warn("Unable to retrieve settings. This browser may not support local storage.")}();(t=n?i({fontSize:n.fontSize,fontFamily:n.fontFamily,viewingMode:n.viewingMode,readingMode:n.readingMode}):i()).setSelected(),e("body").fadeIn(100),window.addEventListener("resize",function(e,t,n){var o;return function(){var i=this,r=arguments,s=n&&!o;clearTimeout(o),o=setTimeout(function(){o=null,n||e.apply(i,r)},t),s&&e.apply(i,r)}}(function(){window.innerWidth<=767&&s(!0)},100));var r=document.getElementById("sidebar_collapse");function s(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?(document.getElementById("sidebar_first").classList.remove("collapsed"),setTimeout(function(){document.querySelector(".main-content").classList.add("col-md-9")},500)):(document.querySelector(".main-content").classList.remove("col-md-9"),document.getElementById("sidebar_first").classList.add("collapsed"))}function l(){e(".toggle-fullscreen").find("[data-fa-processed]").toggleClass("fa-expand").toggleClass("fa-compress"),"Enter Fullscreen"===e(".toggle-fullscreen").attr("data-original-title")?e(".toggle-fullscreen").attr("title","Exit Fullscreen"):e(".toggle-fullscreen").attr("title","Enter Fullscreen")}null!==r&&(r.onclick=function(){s(document.getElementById("sidebar_first").classList.contains("collapsed"))}),new MutationObserver(function(e){1==e[0].target.classList.contains("collapsed")?(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse").setAttribute("title","Show sidebar")):(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse").setAttribute("title","Hide sidebar"))}).observe(document.getElementById("sidebar_first"),{attributes:!0,attributeFilter:["class"],childList:!1,characterData:!1}),e(".toggle-font-serif").on("click touchstart",function(){e(".toggle-font-sans").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("serif")}),e(".toggle-font-sans").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("sans")}),e(".toggle-font-dyslexic").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-sans").removeClass("active"),t.setFontFamily("dyslexic")}),e(".toggle-dark-mode").on("click touchstart",function(){e(".toggle-light-mode").removeClass("active"),t.setViewingMode("dark")}),e(".toggle-light-mode").on("click touchstart",function(){e(".toggle-dark-mode").removeClass("active"),t.setViewingMode("light")}),e(".disable-cards").on("click touchstart",function(){e(".enable-cards").removeClass("active"),t.setReadingMode("disable")}),e(".enable-cards").on("click touchstart",function(){e(".disable-cards").removeClass("active"),t.setReadingMode("enable")}),e(".reset-mode").on("click touchstart",function(){e("#userPreferences button").removeClass("active"),function(e){e.setFontSize(o.fontSize.base),e.setFontFamily(o.fontFamily),e.setViewingMode(o.viewingMode),e.setReadingMode(o.readingMode),e.setSelected(),"undefined"!=typeof Storage?localStorage.removeItem("userPreferences"):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".save-user-preferences").on("click touchstart",function(){e("#userPreferences").modal("toggle"),function(e){"undefined"!=typeof Storage?localStorage.setItem("userPreferences",JSON.stringify(e)):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".toggle-fullscreen").on("click touchstart",function(){document.fullscreen?document.exitFullscreen():document.mozFullScreen?document.mozCancelFullScreen():document.webkitIsFullScreen?document.webkitCancelFullScreen():document.msFullscreenElement?document.msExitFullscreen():function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}()}),e(".fontSlider").on("input change",function(){t.setFontSize(this.value)}),document.addEventListener("webkitfullscreenchange",l,!1),document.addEventListener("mozfullscreenchange",l,!1),document.addEventListener("fullscreenchange",l,!1),document.addEventListener("MSFullscreenChange",l,!1)}(jQuery)})}]);
\ No newline at end of file
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var o={fontSize:{base:1.1,max:1.5,min:.75,increment:.5},fontFamily:"sans",viewingMode:"light",readingMode:"enable",dyslexiaFont:["OpenDyslexic-Regular","url(https://cdn.jsdelivr.net/gh/antijingoist/open-dyslexic@20160623-Stable/woff/OpenDyslexic-Regular.woff)"]},r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fontSize,n=void 0===t?o.fontSize.base:t,r=e.fontFamily,i=void 0===r?o.fontFamily:r,s=e.viewingMode,l=void 0===s?o.viewingMode:s,a=e.readingMode;return{fontSize:n,fontFamily:i,viewingMode:l,readingMode:void 0===a?o.readingMode:a,setFontSize:function(e){e=e||o.fontSize.base;try{e<o.fontSize.min?e=o.fontSize.min:e>o.fontSize.max&&(e=o.fontSize.max),document.body.style.fontSize=e+"rem",this.fontSize=e}catch(e){console.warn(e)}return this},setFontFamily:function(e){e=e||o.fontFamily;try{"serif"==e?(document.documentElement.classList.remove("font-sans","font-dyslexic"),document.documentElement.classList.add("font-serif")):"dyslexic"==e?(document.documentElement.classList.remove("font-sans","font-serif"),document.documentElement.classList.add("font-dyslexic")):(e="sans",document.documentElement.classList.remove("font-dyslexic","font-serif"),document.documentElement.classList.add("font-sans")),this.fontFamily=e}catch(e){console.warn(e)}return this},fetchFontFace:function(e){var t=new(Function.prototype.bind.apply(FontFace,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))));t.load().then(function(){document.fonts.add(t)})},setViewingMode:function(e){e=e||o.viewingMode;try{if("dark"==e)document.documentElement.classList.remove("light-mode"),document.documentElement.classList.add("dark-mode");else{if("light"!=e)throw"Unsupported viewing mode: "+e;document.documentElement.classList.remove("dark-mode"),document.documentElement.classList.add("light-mode")}this.viewingMode=e}catch(e){console.warn(e)}return this},setReadingMode:function(e){e=e||o.readingMode;try{"disable"==e?document.documentElement.classList.add("reading-mode"):(e="enable",document.documentElement.classList.remove("reading-mode")),this.readingMode=e}catch(e){console.warn(e)}return this},setSelected:function(){this.setFontSize(this.fontSize),this.setFontFamily(this.fontFamily),this.setViewingMode(this.viewingMode),this.setReadingMode(this.readingMode);var e=document.querySelectorAll(".fontSlider"),t=!0,n=!1,o=void 0;try{for(var r,i=e[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){r.value.value=this.fontSize}}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}var s=document.querySelectorAll(".toggle-font-"+this.fontFamily),l=!0,a=!1,c=void 0;try{for(var d,u=s[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){d.value.classList.add("active")}}catch(e){a=!0,c=e}finally{try{!l&&u.return&&u.return()}finally{if(a)throw c}}var f=document.querySelectorAll(".toggle-"+this.viewingMode+"-mode"),m=!0,g=!1,v=void 0;try{for(var y,h=f[Symbol.iterator]();!(m=(y=h.next()).done);m=!0){y.value.classList.add("active")}}catch(e){g=!0,v=e}finally{try{!m&&h.return&&h.return()}finally{if(g)throw v}}var b=document.querySelectorAll("."+this.readingMode+"-cards"),S=!0,p=!1,F=void 0;try{for(var w,M=b[Symbol.iterator]();!(S=(w=M.next()).done);S=!0){w.value.classList.add("active")}}catch(e){p=!0,F=e}finally{try{!S&&M.return&&M.return()}finally{if(p)throw F}}}}};document.addEventListener("DOMContentLoaded",function(e){!function(e){var t=void 0,n=function(){if("undefined"!=typeof Storage)return JSON.parse(localStorage.getItem("userPreferences"));console.warn("Unable to retrieve settings. This browser may not support local storage.")}();(t=n?r({fontSize:n.fontSize,fontFamily:n.fontFamily,viewingMode:n.viewingMode,readingMode:n.readingMode}):r()).setSelected(),e("body").fadeIn(100),window.addEventListener("resize",function(e,t,n){var o;return function(){var r=this,i=arguments,s=n&&!o;clearTimeout(o),o=setTimeout(function(){o=null,n||e.apply(r,i)},t),s&&e.apply(r,i)}}(function(){window.innerWidth<=767&&s(!0)},100));var i=document.getElementById("sidebar_collapse");function s(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?(document.getElementById("sidebar_first").classList.remove("collapsed"),setTimeout(function(){document.querySelector(".main-content").classList.add("col-md-9")},500)):(document.querySelector(".main-content").classList.remove("col-md-9"),document.getElementById("sidebar_first").classList.add("collapsed"))}function l(){e(".toggle-fullscreen").find("[data-fa-processed]").toggleClass("fa-expand").toggleClass("fa-compress"),"Enter Fullscreen"===e(".toggle-fullscreen").attr("data-original-title")?e(".toggle-fullscreen").attr("title","Exit Fullscreen"):e(".toggle-fullscreen").attr("title","Enter Fullscreen")}null!==i&&(i.onclick=function(){s(document.getElementById("sidebar_first").classList.contains("collapsed"))}),new MutationObserver(function(e){1==e[0].target.classList.contains("collapsed")?(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse").setAttribute("title","Show sidebar")):(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse").setAttribute("title","Hide sidebar"))}).observe(document.getElementById("sidebar_first"),{attributes:!0,attributeFilter:["class"],childList:!1,characterData:!1}),e(".toggle-font-serif").on("click touchstart",function(){e(".toggle-font-sans").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("serif")}),e(".toggle-font-sans").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("sans")}),e(".toggle-font-dyslexic").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-sans").removeClass("active"),t.fetchFontFace(o.dyslexiaFont),t.setFontFamily("dyslexic")}),e(".toggle-dark-mode").on("click touchstart",function(){e(".toggle-light-mode").removeClass("active"),t.setViewingMode("dark")}),e(".toggle-light-mode").on("click touchstart",function(){e(".toggle-dark-mode").removeClass("active"),t.setViewingMode("light")}),e(".disable-cards").on("click touchstart",function(){e(".enable-cards").removeClass("active"),t.setReadingMode("disable")}),e(".enable-cards").on("click touchstart",function(){e(".disable-cards").removeClass("active"),t.setReadingMode("enable")}),e(".reset-mode").on("click touchstart",function(){e("#userPreferences button").removeClass("active"),function(e){e.setFontSize(o.fontSize.base),e.setFontFamily(o.fontFamily),e.setViewingMode(o.viewingMode),e.setReadingMode(o.readingMode),e.setSelected(),"undefined"!=typeof Storage?localStorage.removeItem("userPreferences"):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".save-user-preferences").on("click touchstart",function(){e("#userPreferences").modal("toggle"),function(e){"undefined"!=typeof Storage?localStorage.setItem("userPreferences",JSON.stringify(e)):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".toggle-fullscreen").on("click touchstart",function(){document.fullscreen?document.exitFullscreen():document.mozFullScreen?document.mozCancelFullScreen():document.webkitIsFullScreen?document.webkitCancelFullScreen():document.msFullscreenElement?document.msExitFullscreen():function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}()}),e(".fontSlider").on("input change",function(){t.setFontSize(this.value)}),document.addEventListener("webkitfullscreenchange",l,!1),document.addEventListener("mozfullscreenchange",l,!1),document.addEventListener("fullscreenchange",l,!1),document.addEventListener("MSFullscreenChange",l,!1)}(jQuery)})}]);
\ No newline at end of file
......@@ -7,7 +7,8 @@ const defaults = {
},
fontFamily: "sans",
viewingMode: "light",
readingMode: "enable"
readingMode: "enable",
dyslexiaFont: ["OpenDyslexic-Regular", "url(https://cdn.jsdelivr.net/gh/antijingoist/open-dyslexic@20160623-Stable/woff/OpenDyslexic-Regular.woff)"]
};
const Citation = ({ format = "APA" } = {}) => ({ format,
......@@ -66,6 +67,13 @@ const userPreferences = ({
return this;
},
fetchFontFace(params){
var font = new FontFace(...params);
font.load().then(function() {
document.fonts.add(font);
});
},
setViewingMode(mode) {
mode = mode ? mode : defaults.viewingMode;
......@@ -142,6 +150,7 @@ function store_user_preferences(preferences) {
console.warn("Unable to store settings. This browser may not support local storage.");
}
}
function retreive_user_preferences() {
if (typeof Storage !== "undefined") {
return JSON.parse(localStorage.getItem("userPreferences"));
......@@ -149,6 +158,7 @@ function retreive_user_preferences() {
console.warn("Unable to retrieve settings. This browser may not support local storage.");
}
}
function clear_user_preferences(preferences) {
preferences.setFontSize(defaults.fontSize.base);
preferences.setFontFamily(defaults.fontFamily);
......@@ -234,43 +244,54 @@ document.addEventListener("DOMContentLoaded", function(event) {
$(".toggle-font-dyslexic").removeClass("active");
preferences.setFontFamily("serif");
});
$(".toggle-font-sans").on("click touchstart", function() {
$(".toggle-font-serif").removeClass("active");
$(".toggle-font-dyslexic").removeClass("active");
preferences.setFontFamily("sans");
});
$(".toggle-font-dyslexic").on("click touchstart", function() {
$(".toggle-font-serif").removeClass("active");
$(".toggle-font-sans").removeClass("active");
preferences.fetchFontFace(defaults.dyslexiaFont);
preferences.setFontFamily("dyslexic");
});
$(".toggle-dark-mode").on("click touchstart", function() {
$(".toggle-light-mode").removeClass("active");
preferences.setViewingMode("dark");
});
$(".toggle-light-mode").on("click touchstart", function() {
$(".toggle-dark-mode").removeClass("active");
preferences.setViewingMode("light");
});
$(".disable-cards").on("click touchstart", function() {
$(".enable-cards").removeClass("active");
preferences.setReadingMode("disable");
});
$(".enable-cards").on("click touchstart", function() {
$(".disable-cards").removeClass("active");
preferences.setReadingMode("enable");
});
$(".reset-mode").on("click touchstart", function() {
$("#userPreferences button").removeClass("active");
clear_user_preferences(preferences);
});
$(".save-user-preferences").on("click touchstart", function() {
$("#userPreferences").modal("toggle");
store_user_preferences(preferences);
});
$(".toggle-fullscreen").on("click touchstart", function() {
toggleFullscreen();
});
$(".fontSlider").on("input change", function() {
preferences.setFontSize(this.value);
});
......@@ -287,6 +308,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
else if (document.msFullscreenElement) document.msExitFullscreen();
else enterFullscreen();
}
function enterFullscreen() {
var d = document.documentElement;
if (d.requestFullscreen) d.requestFullscreen();
......@@ -294,6 +316,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
else if (d.webkitRequestFullScreen) d.webkitRequestFullScreen();
else if (d.msRequestFullscreen) d.msRequestFullscreen();
}
function changeHandler() {
/* Swap icons for fullscreen / exit fullscreen */
$(".toggle-fullscreen")
......@@ -309,6 +332,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
$(".toggle-fullscreen").attr("title", "Enter Fullscreen");
}
}
/* * *
* Returns a function, that, as long as it continues to be invoked, will not
* be triggered. The function will be called after it stops being called for
......
This diff is collapsed.
......@@ -6,7 +6,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack --mode development",
"build": "webpack --mode production"
"compile-src": "webpack --mode production",
"process-theme": "postcss css/user-preferences.css -o css/user-preferences.min.css",
"build": "npm run compile-src && npm run process-theme"
},
"repository": {
"type": "git",
......@@ -19,7 +21,28 @@
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"webpack": "^4.17.2",
"webpack-command": "^0.4.1"
"css-loader": "^0.28.11",
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.7",
"eslint": "^5.10.0",
"eslint-loader": "^2.1.1",
"mini-css-extract-plugin": "^0.4.5",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss": "^6.0.23",
"postcss-calc": "^6.0.2",
"postcss-cli": "^5.0.1",
"postcss-combine-duplicated-selectors": "^6.1.0",
"postcss-css-variables": "^0.9.0",
"postcss-custom-selectors": "^4.0.1",
"postcss-discard-duplicates": "^4.0.2",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^3.5.0",
"precss": "^3.1.2",
"style-loader": "^0.20.3",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^4.27.1",
"webpack-command": "^0.4.2",
"webpack-glob-entries": "^1.0.1"
}
}
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