From 0607f2a69a7b341954e0e54a3f69998f797e32fe Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 31 Aug 2022 06:29:42 +0200 Subject: [PATCH] Feat: hamburger button for phonemode --- theme/static/stylesheet/style.less | 139 +++++++++++++++----------- theme/static/stylesheet/style.min.css | 2 +- theme/templates/base.html | 3 + 3 files changed, 86 insertions(+), 58 deletions(-) diff --git a/theme/static/stylesheet/style.less b/theme/static/stylesheet/style.less index c969fb0..fbb28d8 100644 --- a/theme/static/stylesheet/style.less +++ b/theme/static/stylesheet/style.less @@ -124,7 +124,7 @@ aside { .title { text-align: center; - padding-bottom: 20px; + //padding-bottom: 20px; padding-top: 20px; img { @@ -144,7 +144,83 @@ aside { } } nav { - display: none; + .toctree { + display: none; + } + #toggle { + display: none; + } + #toggle:checked + .toctree { + display: block; + } + label { + display: flex; + justify-content: center; + align-items: center; + font-size: 40px; + cursor: pointer; + } + ul.toctree { + display: none; + padding-inline-start: 0px; + h2 { + background-color: @navbar-bg; + margin-bottom: 0; + } + ul { + padding-inline-start: 0px; + display: block; + li { + padding: 0; + display: block; + } + a { + color: @navbar-text-color; + border: none; + } + } + li.toctree-l1 { + li.current{ + background-color: @navbar-toctree-l2-sel-bg; + color: @navbar-toctree-l2-sel-txt; + padding: 10px; + border-left: solid 2px @orange; + } + } + li.current{ + a { + background-color: @navbar-toctree-l1-sel-bg; + color: @navbar-toctree-l1-sel-txt; + border-top: solid 1px @light-grey; + border-bottom: solid 1px @light-grey; + border-left: solid 2px @orange; + } + a:hover { + color: @orange; + } + } + li.toctree-l2 { + a { + border: none; + background-color: @navbar-toctree-l2-bg; + color: @navbar-toctree-l2-txt; + } + } + a { + padding: 10px; + } + a:hover { + color: @orange; + } + } + ul.list { + li { + display: inline; + line-height: 1.6em; + font-size: 1.28em; + text-transform: lowercase; + } + } } .tagcloud { display: none; @@ -440,68 +516,17 @@ ul.social { padding-top: 50px; } nav { - display: block; background-color: @navbar-bg; - h2 { - background-color: @navbar-bg; - margin-bottom: 0; + label, #toggle + { + display: none; } ul { padding-inline-start: 0px; display: block; - li { - padding: 0; - display: block; - } } ul.toctree { - li { - a { - color: @navbar-text-color; - border: none; - } - } - li.toctree-l1 { - li.current{ - background-color: @navbar-toctree-l2-sel-bg; - color: @navbar-toctree-l2-sel-txt; - padding: 10px; - border-left: solid 2px @orange; - } - } - li.current{ - a { - background-color: @navbar-toctree-l1-sel-bg; - color: @navbar-toctree-l1-sel-txt; - border-top: solid 1px @light-grey; - border-bottom: solid 1px @light-grey; - border-left: solid 2px @orange; - } - a:hover { - color: @orange; - } - } - li.toctree-l2 { - a { - border: none; - background-color: @navbar-toctree-l2-bg; - color: @navbar-toctree-l2-txt; - } - } - a { - padding: 10px; - } - a:hover { - color: @orange; - } - } - ul.list { - li { - display: inline; - line-height: 1.6em; - font-size: 1.28em; - text-transform: lowercase; - } + display: block; } } diff --git a/theme/static/stylesheet/style.min.css b/theme/static/stylesheet/style.min.css index bb46b4c..ccca266 100644 --- a/theme/static/stylesheet/style.min.css +++ b/theme/static/stylesheet/style.min.css @@ -1 +1 @@ -html,body{width:100%;height:100%}h1,h2,h3,h4,h5,h6{font-weight:300;line-height:1.1}h1{font-size:2.4em}h2{font-size:2em;background-color:#eeeeee;padding:4px}h3{font-size:1.6em}h4{font-size:1.36em}h5{font-size:1.2em}h6{font-size:1.1em}body{margin:0;padding:0;background-color:#ffffff;color:#242121;font-family:'Source Sans Pro','Roboto','Open Sans','Liberation Sans','DejaVu Sans','Verdana','Helvetica','Arial',sans-serif;font-size:1.02em;line-height:1.2em}a{color:#D9411E;text-decoration:none}a:hover{color:#FF5A09}hr{color:#eeeeee;background-color:#eeeeee;height:1px;border:none;margin-top:40px;margin-bottom:40px}img{max-width:100%;border:2px solid #d9d8d8;box-shadow:0 0 10px #eeeeee}.button{margin:20px;border:3px solid #D9411E;width:250px;height:150px;border-radius:25px;display:inline-flex;vertical-align:top;padding:5px 15px}.button *{display:flex;justify-content:center;flex-direction:column;gap:10px}.button a{width:100%;height:100%}.button .nolink{width:100%;height:100%}.button h3{margin:0px}.button:hover{background-color:#eeeeee}aside{background-color:#242121;color:#ffffff}aside a{color:#ffffff;display:block}aside a:hover{color:#eeeeee}aside .title{text-align:center;padding-bottom:20px;padding-top:20px}aside .title img{padding:20px;border-radius:50%;max-width:140px}aside .title h1{margin:15px 0 5px 0}aside .title p{margin:0 0 15px 0;font-size:.92em}aside nav{display:none}aside .tagcloud{display:none}main nav{display:none}main article{margin:0 8% 2% 8%}main article header h1,main article header h2{margin-bottom:0}main article header p{color:#999999;font-size:.86em}main article header .translations{float:right}main article header .translations .active{font-weight:600}main article code,main article kbd,main article samp,main article pre{font-family:'Source Code Pro','Consolas','Liberation Mono','DejaVu Sans Mono',monospace}main article blockquote,main article pre{background-color:rgba(128,128,128,0.05);border-top-right-radius:5px;border-bottom-right-radius:5px;border-left:8px solid rgba(128,128,128,0.075);border-left-width:10px}main article blockquote{padding:10px 20px;font-weight:300;font-size:1.1em}main article pre{padding:4px;font-size:.9em;overflow-x:auto}main article samp{white-space:pre;display:block;overflow-x:auto}main article kbd{padding:.1em .6em;border:1px solid rgba(63,63,63,0.25);box-shadow:0 1px 0 rgba(63,63,63,0.25);background-color:#fff;color:#333;border-radius:3px;display:inline-block;margin:0 .1em;white-space:nowrap;font-size:.78em}main article *:not(pre)>code{font-size:.8em;white-space:nowrap;color:#c25;padding:1px 3px;background-color:#f7f7f9;border:1px solid #e1e1e8;border-radius:3px}main article .comment-count{font-size:.8em}main article table{border-collapse:collapse;border-spacing:0}main article table thead:first-child tr:first-child th{border-top:0}main article table th,main article table td{padding:8px;line-height:20px;vertical-align:top;border-top:1px solid #ddd}main footer{padding-top:4px;border-top:#eeeeee 1px solid}main footer p{margin:2px;text-align:center;padding:0 40px 0 40px;color:#999999;font-size:11px}.about{text-align:center;border-top:#eeeeee 1px solid;padding-top:1em}.tag-cloud{text-align:center}.tag-cloud a{background-color:#D9411E;padding:.2em .6em .2em;font-size:.74em;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.tag-cloud a:hover{background-color:#FF5A09}a.btn{background-color:#D9411E;padding:.6em .6em;font-size:.8em;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.btn:hover{background-color:#FF5A09}.center,.text-center{text-align:center}.img-center{margin-left:auto;margin-right:auto;display:block}.align-center{margin-left:auto;margin-right:auto;display:block}.float-left{float:left}.float-right{float:right}div.related-posts{margin:15px 0 15px 0;padding-bottom:20px;border-top:#eeeeee 1px solid;border-bottom:#eeeeee 1px solid}div.related-posts h4{margin:20px 0 25px 0}div.related-posts ul{font-size:1.1em;padding-left:12px}div.related-posts ul li{padding:4px 0 4px 0}ul.list,ul.social,ul.related-posts{list-style-type:none;margin:0;padding:0}ul.list{padding:1em 0 1em 0}ul.list li{padding:4px}ul.breadcrumb{padding:5px 10px;list-style:none;background-color:#eee;font-size:.9em}ul.breadcrumb li{display:inline;font-size:18px}ul.breadcrumb li a{color:#D9411E;text-decoration:none}ul.breadcrumb li a:hover{color:#FF5A09}ul.breadcrumb li+li:before{padding:8px;color:black;content:"/\00a0"}ul.social{font-size:1.6em;padding-top:20px}ul.social li{display:inline}ul.social a:hover{z-index:2;-webkit-transform:translateY(-5px);transform:translateY(-5px)}ul.social a{display:inline-block;width:36px;height:36px;border-radius:100%;text-align:center;font-size:.8em;line-height:36px}@media screen and (min-width:768px){aside{width:20%;max-width:250px;height:100%;position:fixed;top:0;left:0;overflow-y:auto}aside .title{padding-bottom:50px;padding-top:50px}aside nav{display:block;background-color:#242121}aside nav h2{background-color:#242121;margin-bottom:0}aside nav ul{padding-inline-start:0px;display:block}aside nav ul li{padding:0;display:block}aside nav ul.toctree li a{color:#ffffff;border:none}aside nav ul.toctree li.toctree-l1 li.current{background-color:#eeeeee;color:#333333;padding:10px;border-left:solid 2px #D9411E}aside nav ul.toctree li.current a{background-color:#d9d8d8;color:#333333;border-top:solid 1px #eeeeee;border-bottom:solid 1px #eeeeee;border-left:solid 2px #D9411E}aside nav ul.toctree li.current a:hover{color:#D9411E}aside nav ul.toctree li.toctree-l2 a{border:none;background-color:#999999;color:#333333}aside nav ul.toctree a{padding:10px}aside nav ul.toctree a:hover{color:#D9411E}aside nav ul.list li{display:inline;line-height:1.6em;font-size:1.28em;text-transform:lowercase}aside .tagcloud{display:block}aside .tagcloud h2{margin-bottom:0;background-color:#242121}aside .tagcloud ul{list-style:none;padding:0;margin:10px}aside .tagcloud ul li{display:inline-block}aside .tagcloud li.tag-0{font-size:170%}aside .tagcloud li.tag-1{font-size:150%}aside .tagcloud li.tag-2{font-size:120%}aside .tagcloud li.tag-3{font-size:100%}aside .tagcloud li.tag-4{font-size:80%}main{width:75%;height:100%;position:absolute;top:0;right:2.5%}main nav{display:block;text-align:center;text-transform:uppercase;font-size:.72em;padding:14px 0 14px 0;border-bottom:#eeeeee 1px solid}main nav a,main .translations a{padding:0 4px 0 4px;border-left:#eeeeee 1px solid;border-right:#eeeeee 1px solid}main nav :first-child,main .translations :first-child{border-left:none}main nav :last-child,main .translations :last-child{border-right:none}main article.single{min-height:80%}main article ul.list li{padding:2px}} \ No newline at end of file +html,body{width:100%;height:100%}h1,h2,h3,h4,h5,h6{font-weight:300;line-height:1.1}h1{font-size:2.4em}h2{font-size:2em;background-color:#eeeeee;padding:4px}h3{font-size:1.6em}h4{font-size:1.36em}h5{font-size:1.2em}h6{font-size:1.1em}body{margin:0;padding:0;background-color:#ffffff;color:#242121;font-family:'Source Sans Pro','Roboto','Open Sans','Liberation Sans','DejaVu Sans','Verdana','Helvetica','Arial',sans-serif;font-size:1.02em;line-height:1.2em}a{color:#D9411E;text-decoration:none}a:hover{color:#FF5A09}hr{color:#eeeeee;background-color:#eeeeee;height:1px;border:none;margin-top:40px;margin-bottom:40px}img{max-width:100%;border:2px solid #d9d8d8;box-shadow:0 0 10px #eeeeee}.button{margin:20px;border:3px solid #D9411E;width:250px;height:150px;border-radius:25px;display:inline-flex;vertical-align:top;padding:5px 15px}.button *{display:flex;justify-content:center;flex-direction:column;gap:10px}.button a{width:100%;height:100%}.button .nolink{width:100%;height:100%}.button h3{margin:0px}.button:hover{background-color:#eeeeee}aside{background-color:#242121;color:#ffffff}aside a{color:#ffffff;display:block}aside a:hover{color:#eeeeee}aside .title{text-align:center;padding-top:20px}aside .title img{padding:20px;border-radius:50%;max-width:140px}aside .title h1{margin:15px 0 5px 0}aside .title p{margin:0 0 15px 0;font-size:.92em}aside nav .toctree{display:none}aside nav #toggle{display:none}aside nav #toggle:checked+.toctree{display:block;transition-property:display;transition-duration:4s}aside nav label{display:flex;justify-content:center;align-items:center;font-size:40px;cursor:pointer}aside nav ul.toctree{display:none;padding-inline-start:0px}aside nav ul.toctree h2{background-color:#242121;margin-bottom:0}aside nav ul.toctree ul{padding-inline-start:0px;display:block}aside nav ul.toctree ul li{padding:0;display:block}aside nav ul.toctree ul a{color:#ffffff;border:none}aside nav ul.toctree li.toctree-l1 li.current{background-color:#eeeeee;color:#333333;padding:10px;border-left:solid 2px #D9411E}aside nav ul.toctree li.current a{background-color:#d9d8d8;color:#333333;border-top:solid 1px #eeeeee;border-bottom:solid 1px #eeeeee;border-left:solid 2px #D9411E}aside nav ul.toctree li.current a:hover{color:#D9411E}aside nav ul.toctree li.toctree-l2 a{border:none;background-color:#999999;color:#333333}aside nav ul.toctree a{padding:10px}aside nav ul.toctree a:hover{color:#D9411E}aside nav ul.list li{display:inline;line-height:1.6em;font-size:1.28em;text-transform:lowercase}aside .tagcloud{display:none}main nav{display:none}main article{margin:0 8% 2% 8%}main article header h1,main article header h2{margin-bottom:0}main article header p{color:#999999;font-size:.86em}main article header .translations{float:right}main article header .translations .active{font-weight:600}main article code,main article kbd,main article samp,main article pre{font-family:'Source Code Pro','Consolas','Liberation Mono','DejaVu Sans Mono',monospace}main article blockquote,main article pre{background-color:rgba(128,128,128,0.05);border-top-right-radius:5px;border-bottom-right-radius:5px;border-left:8px solid rgba(128,128,128,0.075);border-left-width:10px}main article blockquote{padding:10px 20px;font-weight:300;font-size:1.1em}main article pre{padding:4px;font-size:.9em;overflow-x:auto}main article samp{white-space:pre;display:block;overflow-x:auto}main article kbd{padding:.1em .6em;border:1px solid rgba(63,63,63,0.25);box-shadow:0 1px 0 rgba(63,63,63,0.25);background-color:#fff;color:#333;border-radius:3px;display:inline-block;margin:0 .1em;white-space:nowrap;font-size:.78em}main article *:not(pre)>code{font-size:.8em;white-space:nowrap;color:#c25;padding:1px 3px;background-color:#f7f7f9;border:1px solid #e1e1e8;border-radius:3px}main article .comment-count{font-size:.8em}main article table{border-collapse:collapse;border-spacing:0}main article table thead:first-child tr:first-child th{border-top:0}main article table th,main article table td{padding:8px;line-height:20px;vertical-align:top;border-top:1px solid #ddd}main footer{padding-top:4px;border-top:#eeeeee 1px solid}main footer p{margin:2px;text-align:center;padding:0 40px 0 40px;color:#999999;font-size:11px}.about{text-align:center;border-top:#eeeeee 1px solid;padding-top:1em}.tag-cloud{text-align:center}.tag-cloud a{background-color:#D9411E;padding:.2em .6em .2em;font-size:.74em;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.tag-cloud a:hover{background-color:#FF5A09}a.btn{background-color:#D9411E;padding:.6em .6em;font-size:.8em;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.btn:hover{background-color:#FF5A09}.center,.text-center{text-align:center}.img-center{margin-left:auto;margin-right:auto;display:block}.align-center{margin-left:auto;margin-right:auto;display:block}.float-left{float:left}.float-right{float:right}div.related-posts{margin:15px 0 15px 0;padding-bottom:20px;border-top:#eeeeee 1px solid;border-bottom:#eeeeee 1px solid}div.related-posts h4{margin:20px 0 25px 0}div.related-posts ul{font-size:1.1em;padding-left:12px}div.related-posts ul li{padding:4px 0 4px 0}ul.list,ul.social,ul.related-posts{list-style-type:none;margin:0;padding:0}ul.list{padding:1em 0 1em 0}ul.list li{padding:4px}ul.breadcrumb{padding:5px 10px;list-style:none;background-color:#eee;font-size:.9em}ul.breadcrumb li{display:inline;font-size:18px}ul.breadcrumb li a{color:#D9411E;text-decoration:none}ul.breadcrumb li a:hover{color:#FF5A09}ul.breadcrumb li+li:before{padding:8px;color:black;content:"/\00a0"}ul.social{font-size:1.6em;padding-top:20px}ul.social li{display:inline}ul.social a:hover{z-index:2;-webkit-transform:translateY(-5px);transform:translateY(-5px)}ul.social a{display:inline-block;width:36px;height:36px;border-radius:100%;text-align:center;font-size:.8em;line-height:36px}@media screen and (min-width:768px){aside{width:20%;max-width:250px;height:100%;position:fixed;top:0;left:0;overflow-y:auto}aside .title{padding-bottom:50px;padding-top:50px}aside nav{background-color:#242121}aside nav label,aside nav #toggle{display:none}aside nav ul{padding-inline-start:0px;display:block}aside nav ul.toctree{display:block}aside .tagcloud{display:block}aside .tagcloud h2{margin-bottom:0;background-color:#242121}aside .tagcloud ul{list-style:none;padding:0;margin:10px}aside .tagcloud ul li{display:inline-block}aside .tagcloud li.tag-0{font-size:170%}aside .tagcloud li.tag-1{font-size:150%}aside .tagcloud li.tag-2{font-size:120%}aside .tagcloud li.tag-3{font-size:100%}aside .tagcloud li.tag-4{font-size:80%}main{width:75%;height:100%;position:absolute;top:0;right:2.5%}main nav{display:block;text-align:center;text-transform:uppercase;font-size:.72em;padding:14px 0 14px 0;border-bottom:#eeeeee 1px solid}main nav a,main .translations a{padding:0 4px 0 4px;border-left:#eeeeee 1px solid;border-right:#eeeeee 1px solid}main nav :first-child,main .translations :first-child{border-left:none}main nav :last-child,main .translations :last-child{border-right:none}main article.single{min-height:80%}main article ul.list li{padding:2px}} \ No newline at end of file diff --git a/theme/templates/base.html b/theme/templates/base.html index 41d9aad..e307630 100644 --- a/theme/templates/base.html +++ b/theme/templates/base.html @@ -86,6 +86,9 @@