Commit 756d9010 authored by ROBERT PATRICK CAREY III's avatar ROBERT PATRICK CAREY III 🗿

Added support for sidebar_second + updated build routine

parent 037cfa57
:root{--font-family-sans-serif:"Open Sans",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--font-family-serif:"Apple Garamond",Garamond,Georgia,"Times New Roman",Times,serif;--font-family-dyslexic:"Open Dyslexic","Lexia Readable","Dyslexie",sans-serif}@font-face{font-family:Open Dyslexic;src:url(https://cdn.jsdelivr.net/gh/antijingoist/open-dyslexic@20160623-Stable/woff/OpenDyslexic-Regular.woff) format("woff")}#sidebar_first{transition:all .3s ease}#font-sans{font-size:20px;padding:0 1rem}#font-dyslexic{font-size:20px;padding:3px 1rem 0}.sidebar.collapsed{display:none}.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:.25rem}.modal-content kbd{cursor:help}.dark-mode{opacity:.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{box-shadow:none}.dark-mode .breadcrumb,.dark-mode .card,.dark-mode .jumbotron{background-color:#283340}.dark-mode .paragraph-title{color:#99adc5!important;border-bottom:1px solid rgba(190,203,218,.45)!important}.dark-mode svg.svg-inline--fa path{fill:#99adc5!important}.dark-mode .glossary-term{color:#99adc5}.dark-mode .nav-item a,.dark-mode .nav-link,.dark-mode a{color:#48b1ce}.dark-mode .nav-pills .nav-link:active,.dark-mode .nav-pills .nav-link:focus,.dark-mode .nav-pills .nav-link:hover{background-color:#3b444f}.dark-mode .btn-secondary{color:#becbda}.dark-mode .btn-outline-secondary:hover,.dark-mode .btn-secondary{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:#fff}.reading-mode .breadcrumb{box-shadow:none;background-color:transparent;padding:.75rem 1rem .75rem 0}.reading-mode .card{box-shadow:none;border-radius:0;background-color:transparent}.reading-mode .paragraph{border:none!important}.reading-mode .paragraph,.reading-mode .paragraph-title{background-color:transparent!important}.reading-mode .card-block,.reading-mode .card-body,.reading-mode .field__item>.card-block{padding:1rem 0}.reading-mode .jumbotron{box-shadow:none;border-radius:0;padding:0;background-color:transparent}.reading-mode iframe{border-radius:0}.reading-mode .paragraph--type-minitab-example .thumbnail{margin:0 .65rem 0 0}.font-sans,.font-sans body{font-family:Open Sans,-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif;font-family:var(--font-family-sans-serif)}.font-serif,.font-serif body{font-family:Apple Garamond,Garamond,Georgia,Times New Roman,Times,serif;font-family:var(--font-family-serif)}.font-dyslexic,.font-dyslexic body{font-family:Open Dyslexic,Lexia Readable,Dyslexie,sans-serif;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;border-color:#adb5bd}@media (min-width:768px){.sidebar.collapsed{display:block;opacity:0;margin-left:-25%}}@media (max-width:768px){.togglesidebar{margin-left:-.75rem}}
\ No newline at end of file
:root{--font-family-sans-serif:"Open Sans",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--font-family-serif:"Apple Garamond",Garamond,Georgia,"Times New Roman",Times,serif;--font-family-dyslexic:"Open Dyslexic","Lexia Readable","Dyslexie",sans-serif}@font-face{font-family:Open Dyslexic;src:url(https://cdn.jsdelivr.net/gh/antijingoist/open-dyslexic@20160623-Stable/woff/OpenDyslexic-Regular.woff) format("woff")}#sidebar_first{transition:all .3s ease}#font-sans{font-size:20px;padding:0 1rem}#font-dyslexic{font-size:20px;padding:3px 1rem 0}.sidebar.collapsed{display:none}.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:.25rem}.modal-content kbd{cursor:help}.dark-mode{opacity:.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{box-shadow:none}.dark-mode .breadcrumb,.dark-mode .card,.dark-mode .jumbotron{background-color:#283340}.dark-mode .paragraph-title{color:#99adc5!important;border-bottom:1px solid rgba(190,203,218,.45)!important}.dark-mode svg.svg-inline--fa path{fill:#99adc5!important}.dark-mode .glossary-term{color:#99adc5}.dark-mode .nav-item a,.dark-mode .nav-link,.dark-mode a{color:#48b1ce}.dark-mode .nav-pills .nav-link:active,.dark-mode .nav-pills .nav-link:focus,.dark-mode .nav-pills .nav-link:hover{background-color:#3b444f}.dark-mode .btn-secondary{color:#becbda}.dark-mode .btn-outline-secondary:hover,.dark-mode .btn-secondary{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:#fff}.reading-mode .breadcrumb{box-shadow:none;background-color:transparent;padding:.75rem 1rem .75rem 0}.reading-mode .card{box-shadow:none;border-radius:0;background-color:transparent}.reading-mode .paragraph{border:none!important}.reading-mode .paragraph,.reading-mode .paragraph-title{background-color:transparent!important}.reading-mode .card-block,.reading-mode .card-body,.reading-mode .field__item>.card-block{padding:1rem 0}.reading-mode .jumbotron{box-shadow:none;border-radius:0;padding:0;background-color:transparent}.reading-mode iframe{border-radius:0}.reading-mode .paragraph--type-minitab-example .thumbnail{margin:0 .65rem 0 0}.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 body{font-family:Apple Garamond,Garamond,Georgia,Times New Roman,Times,serif;font-family:var(--font-family-serif)}.font-dyslexic,.font-dyslexic body{font-family:Open Dyslexic,Lexia Readable,Dyslexie,sans-serif;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;border-color:#adb5bd}@media (min-width:768px){.sidebar.collapsed{display:block;opacity:0;margin-left:-25%}}@media (max-width:768px){.togglesidebar{margin-left:-.75rem}}
\ No newline at end of file
......@@ -201,18 +201,26 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
preferences.setSelected();
window.addEventListener("resize", debounce(function(){
if(window.innerWidth <= 767){
set_sidebar_visibility(true);
}
}, 100));
let main_content = document.querySelector('.main-content');
let sidebar_collapse = document.getElementById('sidebar_collapse');
let sidebar_first = document.getElementById('sidebar_first');
let sidebar_second = document.getElementById('sidebar_second');
if (sidebar_collapse !== null) {
sidebar_collapse.onclick = function () {
set_sidebar_visibility(document.getElementById('sidebar_first').classList.contains('collapsed'));
if(sidebar_first){
set_sidebar_visibility(sidebar_first.classList.contains('collapsed'));
}
if(sidebar_second){
set_sidebar_visibility(sidebar_second.classList.contains('collapsed'));
}
}
}
......@@ -228,22 +236,37 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
});
collapseObserver.observe(document.getElementById("sidebar_first"), {
attributes: true,
attributeFilter: ["class"],
childList: false,
characterData: false
});
if(sidebar_first || sidebar_second){
let obj = sidebar_first ? sidebar_first : sidebar_second;
if(obj) {
collapseObserver.observe(obj, {
attributes: true,
attributeFilter: ["class"],
childList: false,
characterData: false
});
}
}
function set_sidebar_visibility(visible = true){
if(visible){
document.getElementById('sidebar_first').classList.remove('collapsed');
setTimeout(function(){
document.querySelector('.main-content').classList.add('col-md-9');
if(sidebar_first) {
sidebar_first.classList.remove('collapsed');
}
if(sidebar_second) {
sidebar_second.classList.remove('collapsed');
}
setTimeout(function () {
main_content.classList.add('col-md-9');
}, 500);
} else {
document.querySelector('.main-content').classList.remove('col-md-9');
document.getElementById('sidebar_first').classList.add('collapsed');
main_content.classList.remove('col-md-9');
if(sidebar_first){
sidebar_first.classList.add('collapsed');
}
if(sidebar_second){
sidebar_second.classList.add('collapsed');
}
}
}
......
This diff is collapsed.
......@@ -18,37 +18,37 @@
"email": "rpc5102@psu.edu",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@fortawesome/fontawesome-pro": "^5.7.2",
"babel-loader": "^8.0.4",
"css-loader": "^0.28.11",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"babel-loader": "^8.0.6",
"css-loader": "^3.4.2",
"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",
"cssnano": "^4.1.10",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.3",
"mini-css-extract-plugin": "^0.9.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss": "^7.0.27",
"postcss-calc": "^7.0.2",
"postcss-cli": "^7.1.0",
"postcss-combine-duplicated-selectors": "^8.1.0",
"postcss-css-variables": "^0.14.0",
"postcss-custom-selectors": "^5.1.2",
"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",
"postcss-preset-env": "^6.7.0",
"precss": "^4.0.0",
"style-loader": "^1.1.3",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.42.0",
"webpack-command": "^0.5.0",
"webpack-glob-entries": "^1.0.1"
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@babel/polyfill": "^7.8.7",
"core-js": "^3.6.4",
"fontfaceobserver": "^2.1.0"
}
}
......@@ -21,16 +21,17 @@ const config = {
["@babel/env", {
"targets": {
"browsers": [
"Chrome >= 52",
"FireFox >= 44",
"Safari >= 7",
"Explorer 11",
"last 4 Edge versions"
"Chrome >= 78",
"FireFox >= 71",
"Safari >= 12",
"Edge >= 79"
]
},
useBuiltIns: "usage"
useBuiltIns: "usage",
corejs: 3
}],
],
"sourceType": "script"
}
}
}
......
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