Skip to content

Commit dd88c13

Browse files
committed
improved footer according to new design
1 parent fd0da2c commit dd88c13

4 files changed

Lines changed: 71 additions & 20 deletions

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,12 @@ I want the menu to have a tiny button on the bottom margin left with an arrow to
111111

112112
* Raptor mini: i want to imporve the left side menu on mobile. When the menu is visible it should be higher, the top part should be on top of the header, folding out and in with the rest of the menu. It should have an x close button and it should say menu. The locor of that top line of the header should be the color of the header 332746
113113

114-
* Raptor mini: the menu, on desktop, has a button to fold in or out. I want the same behavior to occur also when i simply click the folded in menu: it should expend. Not just when i click the dedicated button
114+
* Raptor mini: the menu, on desktop, has a button to fold in or out. I want the same behavior to occur also when i simply click the folded in menu: it should expend. Not just when i click the dedicated button
115+
116+
* Raprot mini: instead of this code (index.ts of footer), I want to make use of a new footer web component with the readme: # solid-ui-footer component
117+
118+
* Raptor mini: The footer created shoudl actually be part of the left side menu only. Should be displayed inside it and should collaps and expand as the menu.
119+
120+
* Raptor mini: the footer should completely dissapear when menu folded up.
121+
122+
* Raptor mini: Please always keep the footer at the bottom of the menu

src/mainPage/footer.ts

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
1-
import { LiveStore } from 'rdflib'
2-
import { initFooter } from 'solid-ui'
1+
import 'solid-ui/components/footer'
2+
import type { LiveStore } from 'rdflib'
33

4-
/**
5-
* links in the footer
6-
*/
7-
const SOLID_PROJECT_URL = 'https://solidproject.org'
8-
const SOLID_PROJECT_NAME = 'solidproject.org'
4+
declare module 'solid-ui/components/footer'
5+
import 'solid-ui/components/footer'
96

10-
export function createFooter (store: LiveStore) {
11-
// @ts-ignore
12-
initFooter(store, setFooterOptions())
7+
type FooterElement = HTMLElement & {
8+
store?: LiveStore | null
9+
position?: 'static' | 'absolute' | 'relative' | 'fixed' | 'sticky'
10+
top?: string
11+
right?: string
12+
bottom?: string
13+
left?: string
1314
}
1415

15-
function setFooterOptions () {
16-
return {
17-
solidProjectUrl: SOLID_PROJECT_URL,
18-
solidProjectName: SOLID_PROJECT_NAME
16+
export function createFooter (store: LiveStore) {
17+
let footer = document.querySelector('solid-ui-footer') as FooterElement | null
18+
19+
if (!footer) {
20+
footer = document.createElement('solid-ui-footer') as FooterElement
21+
footer.className = 'menu-footer'
22+
footer.style.position = 'static'
23+
footer.style.width = '100%'
24+
const navMenu = document.getElementById('NavMenu')
25+
if (navMenu) {
26+
navMenu.appendChild(footer)
27+
} else {
28+
document.body.appendChild(footer)
29+
}
30+
} else {
31+
const navMenu = document.getElementById('NavMenu')
32+
if (navMenu && footer.parentElement !== navMenu) {
33+
navMenu.appendChild(footer)
34+
}
1935
}
36+
37+
footer.store = store
38+
return footer
2039
}

src/mainPage/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function initMainPage (
3838

3939
const header = await createHeader(store, outliner)
4040
const menu = createLeftSideMenu(subject, outliner)
41-
const footer = createFooter(store)
41+
const footer = menu.then(() => createFooter(store))
4242
return Promise.all([header, menu, footer])
4343
}
4444

src/mainPage/menu.css

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
flex-direction: column;
44
gap: 0.5rem;
55
padding-top: 0.75rem;
6+
min-height: 0;
7+
overflow-y: auto;
8+
}
9+
10+
.menu-footer {
11+
width: 100%;
12+
padding: 1rem;
13+
border-top: 1px solid var(--color-border, #d1d1d1);
14+
font-size: 0.875rem;
15+
color: var(--color-text-muted, #555);
16+
line-height: 1.4;
17+
background: inherit;
18+
}
19+
20+
.app-nav.collapsed .menu-footer {
21+
display: none;
22+
text-align: center;
23+
padding: 0.75rem 0;
624
}
725

826
.menu-item {
@@ -68,10 +86,16 @@
6886
}
6987

7088
.app-nav {
71-
position: relative;
72-
display: flex;
73-
flex-direction: column;
89+
position: fixed;
90+
left: 0;
91+
top: 0;
92+
bottom: 0;
93+
width: min(18rem, 320px);
94+
display: grid;
95+
grid-template-rows: 1fr auto;
96+
overflow: hidden;
7497
background: var(--color-background);
98+
z-index: 10;
7599
}
76100

77101
.app-nav.mobile-hidden,
@@ -169,7 +193,7 @@
169193
.menu-collapse {
170194
position: fixed;
171195
left: 3rem;
172-
bottom: 5rem;
196+
bottom: 8rem;
173197
z-index: 320;
174198
width: 1.25rem;
175199
height: 1.25rem;

0 commit comments

Comments
 (0)