-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for mobile screen sizes on Darkfish #1025
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<button id="navigation-toggle" class="navigation-toggle" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation"> | ||
<!-- | ||
Copyright (c) 2021 Luca Burgio | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--> | ||
<svg width="20px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#000000"> | ||
<path d="M3 5h18M3 12h18M3 19h18" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> | ||
</svg> | ||
</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ body { | |
font-weight: 300; | ||
|
||
/* Layout */ | ||
display: grid; | ||
grid-template-columns: auto 1fr; | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
body > :last-child { | ||
grid-column: 1 / 3; | ||
width: 100%; | ||
} | ||
|
||
h1 span, | ||
|
@@ -203,24 +203,38 @@ nav { | |
font-family: Helvetica, sans-serif; | ||
font-size: 14px; | ||
border-right: 1px solid #ccc; | ||
position: sticky; | ||
position: fixed; | ||
top: 0; | ||
overflow: auto; | ||
z-index: 10; | ||
|
||
/* Layout */ | ||
width: 260px; /* fallback */ | ||
width: max(50px, 20vw); | ||
min-width: 50px; | ||
max-width: 80vw; | ||
height: calc(100vh - 100px); /* reduce the footer height */ | ||
resize: horizontal; | ||
width: 300px; | ||
min-height: 100vh; | ||
background: white; | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
nav { | ||
min-height: unset; | ||
height: calc(100vh - 100px); /* reduce the footer height */ | ||
} | ||
} | ||
|
||
main { | ||
display: block; | ||
margin: 1em; | ||
margin: 3em 1em 1em; | ||
min-width: 340px; | ||
font-size: 16px; | ||
width: 100%; | ||
max-width: 64em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, this could be even smaller. |
||
} | ||
|
||
@media (min-width: 1024px) { | ||
main { | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
} | ||
|
||
main h1, | ||
|
@@ -232,8 +246,10 @@ main h6 { | |
font-family: Helvetica, sans-serif; | ||
} | ||
|
||
.table-of-contents main { | ||
margin-left: 2em; | ||
@media (min-width: 1024px) { | ||
.table-of-contents main { | ||
margin-left: 20em; | ||
} | ||
} | ||
|
||
#validator-badges { | ||
|
@@ -280,6 +296,39 @@ nav p { | |
list-style: none; | ||
} | ||
|
||
.navigation-toggle { | ||
position: fixed; | ||
left: 4px; | ||
top: 6px; | ||
z-index: 100; | ||
|
||
background: transparent; | ||
border: none; | ||
cursor: pointer; | ||
margin-left: 7px; | ||
padding: 4px; | ||
} | ||
.navigation-toggle[aria-expanded="true"] { | ||
left: 260px; | ||
} | ||
|
||
/* Adds a suble gradient to help the toggle stand out from the background */ | ||
.navigation-toggle::before { | ||
content: ""; | ||
background: linear-gradient(180deg, rgba(250,250,250,1) 40%, rgba(250,250,250,0.8) 70%, rgba(250,250,250,0) 100%); | ||
display: block; | ||
z-index: -1; | ||
pointer-events: none; | ||
position: fixed; | ||
top: 0; | ||
height: 50px; | ||
width: 100vw; | ||
} | ||
|
||
.navigation-toggle[aria-expanded="true"]::before { | ||
height: 0; | ||
} | ||
|
||
#project-navigation .nav-section { | ||
margin: 0; | ||
border-top: 0; | ||
|
@@ -684,4 +733,3 @@ pre { | |
} | ||
|
||
/* @end */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<body id="top" class="table-of-contents"> | ||
<%= render '_sidebar_toggle.rhtml' %> | ||
|
||
<nav id="navigation" role="navigation"> | ||
<div id="project-navigation"> | ||
<%= render '_sidebar_navigation.rhtml' %> | ||
|
||
<%= render '_sidebar_search.rhtml' %> | ||
</div> | ||
</nav> | ||
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this needs more content, but I needed a sidebar on this page. Otherwise, it's harder to return to the Home page. |
||
<main role="main"> | ||
<h1 class="class"><%= h @title %></h1> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the right way to attach the license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, maybe we could use U+2630 (☰) as an icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or U+2261(≡)?