diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css index 2b89bec..307fd43 100644 --- a/OpenBench/static/style.css +++ b/OpenBench/static/style.css @@ -33,6 +33,10 @@ body, html, main{ flex-basis: calc(min(300px, max(200px, 10%))); } +#sidebar-toggle { + display: none; +} + #content-parent{ flex-grow: 1; justify-content: left; @@ -50,26 +54,6 @@ body, html, main{ display: inline-block; } - -/* Styles for screen widths less than 600px */ -@media (max-width: 599px) { - #sidebar { - flex-basis: 100%; - padding: 16px; - } - - #content-parent { - height: auto; - flex-grow: 0; - flex-basis: 100%; - } - - body { - flex-direction: column; - } -} - - #sidebar ul { list-style-type: none; padding: 0px 16px 0px 8px; @@ -398,4 +382,106 @@ td pre { #content .active-highlight { border-left: 4px solid var(--color-font3); -} \ No newline at end of file +} + +/* Styles for screen widths less than 768px */ +@media (max-width: 767px) { + #sidebar { + flex-basis: 100%; + position: fixed; + top: 0; + bottom: 0; + width: 100%; + background-color: var(--color1); + overflow-y: auto; + transition: transform cubic-bezier(0.82, 0.08, 0.1, 0.93) 0.3s; + transform: translateX(-100%); + } + + body.sidebar-open #sidebar { + transform: none; + } + + #sidebar-toggle { + display: flex; + padding: 10px; + color: var(--color-font1); + background-color: transparent; + border: none; + position: relative; + z-index: 10; + font-size: 2.2rem; + } + + #content-parent { + height: auto; + flex-grow: 0; + flex-basis: 100%; + padding: 0 8px; + } + + #content { + overflow-x: hidden; + margin-top: 70px; + } + + #content-header { + display: flex; + align-items: center; + background-color: var(--color1); + position: absolute; + top: 0; + left: 0; + z-index: 10; + } + + #content-header h2 { + font-size: 1.4rem; + margin: 8px 0; + } + + #content-header .site-title { + white-space: break-spaces; + } + + body { + flex-direction: column; + } + + /* Disable vertical body scrolling when the sidebar is open */ + body.sidebar-open { + position: fixed; + overflow-y: hidden; + } + + /* Horizontally scrollable table */ + table { + display: block; + overflow-x: auto; + } + + /* Tables cannot break words to avoid issues such as single-letter lines */ + /* The only exception is the test config table */ + #content .wrappable:not(.workload-container .test-config) td { + word-break: normal; + } + + /* Test Views */ + .workload-container { + display: flex; + flex-direction: column; + } + + #content #actions { + order: -1; + margin: 0 0 1rem 0; + } + + #content #config { + float: none; + } + + #content .long-statblock { + overflow-x: auto; + } +} diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html index 3072a37..ea566fe 100644 --- a/Templates/OpenBench/base.html +++ b/Templates/OpenBench/base.html @@ -5,6 +5,8 @@ {% load static %} + + @@ -54,6 +56,10 @@ } }, false); + + function toggleSidebar() { + document.body.classList.toggle('sidebar-open') + } @@ -124,9 +130,14 @@
-

- OpenBench Testing Framework -

+ {% if request.session.error_message %}
diff --git a/Templates/OpenBench/workload.html b/Templates/OpenBench/workload.html index 0102f42..47bc2e3 100644 --- a/Templates/OpenBench/workload.html +++ b/Templates/OpenBench/workload.html @@ -9,6 +9,8 @@ {% block content %} +
+
@@ -233,4 +235,6 @@
+
+ {% endblock %}