Skip to content
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

Unified devices title widget #130

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"**/node_modules/**"
],
"redirects": [
{
"source": "/devices",
"destination": "/alpakka",
"type": 301
},
{
"source": "/devices/alpakka/manual",
"destination": "/devices/alpakka/manual/mouse",
Expand Down
3 changes: 2 additions & 1 deletion src/pug/_mixins.pug
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
db: '/db/stats',
contribute: '/contribute/open_source',
blog: '/blog/report_24',
devices: '/alpakka',
alpakkaManual: '/alpakka/manual/mouse',
}

Expand All @@ -48,7 +49,7 @@ mixin nav
if (name=='devices' && devices.includes(SECTION)) return 'active'
return ''
}
div.tab(class=active('devices')): +a('/devices') Devices
div.tab(class=active('devices')): +a('/alpakka') Devices
div.tab(class=active('contribute')): +a(redirect.contribute) Contribute
div.tab(class=active('db')): +a(redirect.db) Accessibility DB
div.tab(class=active('blog')): +a(redirect.blog) Blog
Expand Down
8 changes: 6 additions & 2 deletions src/pug/alpakka/_title.pug
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
-
const active = (bool) => bool ? 'active' : 'inactive'

h1.dynamic
a(class=active(PAGE=='alpakka') href='/alpakka') Alpakka
h1.primary
a(class=active(SECTION=='alpakka') href='/alpakka') Alpakka
a(class=active(SECTION=='kapybara') href='/kapybara') Kapybara

h1.secondary
a.sub(class=active(PAGE=='alpakka') href='/alpakka') Overview
a.sub(class=active(SECTION_2=='manual') href=redirect.alpakkaManual) Manual
a.sub(class=active(PAGE=='gallery') href='/alpakka/gallery') Gallery
a.sub(class=active(PAGE=='components') href='/alpakka/components') Components
18 changes: 0 additions & 18 deletions src/pug/devices.pug

This file was deleted.

4 changes: 2 additions & 2 deletions src/pug/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ block page
div.box
h2 Open source
p Input Labs does public research on videogame controllers, and make open source (software) and Creative Commons (hardware) designs available for everyone.
p Use the #[+a('/devices') Reference Designs] to build your own controller, or modify them for your special needs, preferences, or competitive requirements.
p Use the #[+a('/alpakka') Reference Designs] to build your own controller, or modify them for your special needs, preferences, or competitive requirements.

div.box.image.colored.blend
a.img(href='/devices')
a.img(href='/alpakka')
img(src='/static/img/index.jpg' width='100%' style='filter:grayscale(1)')

div.box
Expand Down
2 changes: 1 addition & 1 deletion src/pug/kapybara.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ block title
| Kapybara controller

block page
h1 Kapybara
include kapybara/_title.pug

div.boxes.grid
div.box
Expand Down
12 changes: 12 additions & 0 deletions src/pug/kapybara/_title.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-
const active = (bool) => bool ? 'active' : 'inactive'

h1.primary
a(class=active(SECTION=='alpakka') href='/alpakka') Alpakka
a(class=active(SECTION=='kapybara') href='/kapybara') Kapybara

h1.secondary
a(class=active(PAGE=='kapybara') href='/kapybara') Overview
a.notfound Manual
a.notfound Gallery
a.notfound Components
23 changes: 19 additions & 4 deletions src/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,26 @@ h1 {
margin: 30px 20px;
}
h1.dynamic {
margin-top: 20px;
margin-bottom: 25px;
font-size: 24px;
}
h1.primary {
margin-top: 15px;
margin-bottom: 10px;
font-size: 28px;
}
h1.secondary {
margin-top: 0px;
margin-bottom: 15px;
font-size: 24px;
}
h1 a {
color: white;
text-decoration: none;
border-radius: 5px;
margin: 0 10px;
margin: 0 5px;
padding: 5px;
}
h1 a.sub {
font-size: 24px;
margin-top: 8px;
}
h1 a.active {
Expand All @@ -183,6 +192,12 @@ h1 a.active {
animation-delay: var(--seed);
box-shadow: 2px 2px 8px 0px hsla(0, 0%, 0%, 0.1);
}
h1 a.notfound {
color: hsl( 0, 0%, 30%);
cursor: not-allowed;
text-decoration: line-through;
text-decoration-thickness: 4px;
}

/* MAIN ==================================================================== */
main {
Expand Down
Loading