forked from CollectionBuilder/collectionbuilder-csv
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subpage Navigation via Buttons (#170)
* feat: add switch-view button * feat: remove dropdowns from navbar * feat: add zenodo link to data page * feat: add switch-view button to list * style: format code * feat: remove single year dropdown * feat: add switch-view button to timeline-edtf * feat: add switch-view button to cloud * feat: improve search box styling * style: format code * feat: implement consistent btn-group layout * feat: improve hyperlinking * Revert "feat: update navbar elements" This reverts commit 9d939e094ef654cc9507a7b098f7488581bd4fd5. * feat: restructure data.html * feat: improve css styling * fix: make btn-group work on small screens * Update reset button event handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: update heading and translation * feat: align btn-group-toggle styling * feat: improve btn-group CSS * feat: add view toggle for small screens * feat: update translations * fix: improve localization * style: run prettier * fix: fix typo * fix: improve resize handling * fix: remove duplicate line --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Moritz Mähr <maehr@users.noreply.github.com>
- Loading branch information
1 parent
a62bf3a
commit 6fd1525
Showing
13 changed files
with
486 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
display_name,stub,dropdown_parent,external_link | ||
Sammlung,,, | ||
Durchsuchen,/browse.html,Sammlung, | ||
Themen,/subjects.html,Sammlung, | ||
Zeitachse,/timeline.html,Sammlung, | ||
Epochen,/eras.html,Sammlung, | ||
Sammlung,/browse.html,, | ||
Bibliografie,https://www.zotero.org/groups/5004193/stadt.geschichte.basel/library,,true | ||
Daten,,, | ||
Metadaten,/data.html,Daten, | ||
Datenarchiv,https://zenodo.org/communities/stadt-geschichte-basel/,Daten,true | ||
Quellcode,https://github.com/Stadt-Geschichte-Basel/,Daten,true | ||
Daten,/data.html,, | ||
Portal,https://stadtgeschichtebasel.ch/,,true | ||
Über,/about.html,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script> | ||
const switchView = document.getElementById('switch-view'); | ||
const buttons = Array.from(switchView ? switchView.children : []); | ||
|
||
function toggleButtonView() { | ||
if (!switchView) return; | ||
|
||
switchView.classList.add('btn-group-vertical'); | ||
switchView.classList.remove('btn-group'); | ||
|
||
// Hide last button (toggle) from vertical display | ||
buttons.forEach((button, index) => { | ||
button.style.display = index === buttons.length - 1 ? 'none' : 'block'; | ||
}); | ||
} | ||
|
||
// Resizing with debounce | ||
const debounce = (fn, delay) => { | ||
let timeoutId; | ||
return (...args) => { | ||
clearTimeout(timeoutId); | ||
timeoutId = setTimeout(() => fn(...args), delay); | ||
}; | ||
}; | ||
|
||
const handleResize = () => { | ||
if (!switchView) return; | ||
|
||
if (window.innerWidth > 576) { | ||
switchView.classList.add('btn-group', 'btn-group-toggle', 'd-flex'); | ||
switchView.classList.remove('btn-group-vertical'); | ||
|
||
buttons.forEach((button) => (button.style.display = '')); | ||
} | ||
}; | ||
|
||
window.addEventListener('resize', debounce(handleResize, 250)); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.