Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
d888ed4
feat: added existing ideas for mobile content navigation menu
therobrob Apr 27, 2025
051b73e
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Jul 15, 2025
a823843
feat: first draft for mobile content navigation menu
therobrob Jul 15, 2025
f258041
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Sep 11, 2025
2177f2f
feat: positioning
therobrob Sep 11, 2025
a1e9c16
feat: added current value in mobile content navigation menu
therobrob Sep 12, 2025
6b665b5
feat: adjusted rootMargin for mobile
therobrob Sep 12, 2025
143eeb4
feat: add current chapter
therobrob Sep 12, 2025
47e8a40
feat: add current chapter
therobrob Sep 12, 2025
0316c76
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Sep 12, 2025
aa7aef4
feat: merge highlightHeadline.js
therobrob Sep 12, 2025
825816d
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Sep 29, 2025
06bbc29
space for footer
therobrob Sep 29, 2025
feec84a
Remove the "current chapter" text
therobrob Sep 29, 2025
3d69b89
Remove the "current chapter" text
therobrob Sep 29, 2025
d2355fd
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Sep 29, 2025
43e1836
styling
therobrob Sep 29, 2025
64771a7
added country/operator title
therobrob Sep 29, 2025
bcf6028
Merge remote-tracking branch 'origin/main' into feat/mobile-content-n…
MoritzWeber0 Sep 30, 2025
7bdce38
styling
therobrob Oct 3, 2025
0daa1f3
dragging
therobrob Oct 3, 2025
21b03a0
dragging
therobrob Oct 3, 2025
4ad6a55
dragging
therobrob Oct 3, 2025
92c9835
tidy up
therobrob Oct 3, 2025
1487443
tidy up
therobrob Oct 3, 2025
7185799
tidy up
therobrob Oct 3, 2025
31a7351
tidy up
therobrob Oct 3, 2025
17b56df
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 3, 2025
5bbc12e
prettier
therobrob Oct 3, 2025
b604437
tidy up
therobrob Oct 3, 2025
7153747
touch-friendly
therobrob Oct 3, 2025
5e4695a
touch-friendly
therobrob Oct 3, 2025
ab9adf3
reorganising again
therobrob Oct 3, 2025
21e6c28
prettier
therobrob Oct 3, 2025
bc79c78
fix link-click
therobrob Oct 3, 2025
63774d5
fix lockScroll
therobrob Oct 3, 2025
9c6bf6a
tidy up
therobrob Oct 3, 2025
511fd06
tidy up
therobrob Oct 3, 2025
38837e7
tidy up
therobrob Oct 4, 2025
2598a60
renaming
therobrob Oct 4, 2025
76a9b35
renaming
therobrob Oct 4, 2025
fb4f252
renaming
therobrob Oct 4, 2025
fba3c73
fixing scroll-indicator
therobrob Oct 4, 2025
27958d8
tidy up
therobrob Oct 4, 2025
bed3a16
breakpoint-adjustment
therobrob Oct 4, 2025
d92291a
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 4, 2025
fa3f986
remove unused css-properties
therobrob Oct 4, 2025
1ba8b0e
a11y
therobrob Oct 4, 2025
843c33e
a11y
therobrob Oct 4, 2025
e3783cd
code-styling-fix
therobrob Oct 4, 2025
39664f4
code-styling-fix
therobrob Oct 4, 2025
404efb5
optimizing lockScroll
therobrob Oct 6, 2025
baed251
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 6, 2025
ba4a8eb
bugfixing review comments
therobrob Oct 6, 2025
a2b8520
bugfixing review comments
therobrob Oct 6, 2025
c4d5f94
bugfixing review comments
therobrob Oct 6, 2025
7a8a0a7
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 7, 2025
d6e7798
resolve merge conflict
therobrob Oct 7, 2025
bcda49c
removed half-opened-option
therobrob Oct 7, 2025
78b4864
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 7, 2025
891d8b8
added border for content element
therobrob Oct 8, 2025
2a1d9c4
renamed bottomSheet to aside
therobrob Oct 8, 2025
e3bc496
apply extra-margin only on mobile and when the content-navigation is …
therobrob Oct 8, 2025
250d664
changed border-radius values to css-variable
therobrob Oct 8, 2025
1f97306
prettier
therobrob Oct 8, 2025
fcaab9a
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 8, 2025
9f02259
fix: Show right-border in mobile navigation by removing width
MoritzWeber0 Oct 9, 2025
cde6254
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 9, 2025
669f6ac
fix: Provide space for gesture bar on Chrome Android
MoritzWeber0 Oct 9, 2025
2cb5546
refactor: Use if/else instead of switch to reduce nesting
MoritzWeber0 Oct 9, 2025
7646969
refactor: Use arrow-functions
MoritzWeber0 Oct 9, 2025
b45705a
refactor: Reuse showSheet and closeSheet operations
MoritzWeber0 Oct 9, 2025
aa71ca4
fixed css-selector
therobrob Oct 9, 2025
dda17e1
refactor: Use boolean isClosed instead of string currentState
MoritzWeber0 Oct 9, 2025
3e44853
fixed resizeObserver.js
therobrob Oct 9, 2025
a0d35de
refactor: Move A11Y settings into openSheet / closeSheet functions
MoritzWeber0 Oct 9, 2025
ea849f7
fix: Replace lockScroll with preventDefault()
MoritzWeber0 Oct 9, 2025
9af7ebc
fixed css-selector
therobrob Oct 9, 2025
35d8949
refactor: move resize observer into contentNavigation
MoritzWeber0 Oct 9, 2025
3d06472
Merge branch 'main' into feat/mobile-content-navigation-menu
MoritzWeber0 Oct 9, 2025
576c8e8
fix: Add back overflow: hidden to prevent scrolling
MoritzWeber0 Oct 10, 2025
2160afe
refactor: Add event listeners on link element directly
MoritzWeber0 Oct 10, 2025
91f5c1a
refactor: Move max-height from JS to CSS
MoritzWeber0 Oct 10, 2025
072e90a
fix: Hide content in safe-area-inset-bottom area
MoritzWeber0 Oct 10, 2025
57a1433
fix: Preserve background color in safe-area-inset-bottom
MoritzWeber0 Oct 10, 2025
839e56c
feat: Add animation for opacity
MoritzWeber0 Oct 10, 2025
cefcc7f
Merge branch 'main' into feat/mobile-content-navigation-menu
MoritzWeber0 Oct 10, 2025
83e6dc6
feat: Close sheet on overlay click
MoritzWeber0 Oct 10, 2025
80a6afa
fix: Support expanding on tap again
MoritzWeber0 Oct 10, 2025
cee11a7
fix: Hide border-bottom of header in closed state
MoritzWeber0 Oct 10, 2025
3a71cec
fix: Add safe-area-inset-bottom to main margin
MoritzWeber0 Oct 10, 2025
702d9b3
some changes
therobrob Oct 10, 2025
60a5e7d
added safe-area-inset-bottom to max-height
therobrob Oct 10, 2025
15bde01
Merge branch 'main' into feat/mobile-content-navigation-menu
therobrob Oct 10, 2025
42aac5e
modified bottom-sheet max-height
therobrob Oct 10, 2025
caf0d54
modified bottom-sheet max-height
therobrob Oct 10, 2025
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
121 changes: 121 additions & 0 deletions assets/js/contentNavigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import * as mq from "./mediaqueries";

const isMobile = () => {
return window.matchMedia(mq.maxMD).matches;
};

const initAside = () => {
const aside = document.querySelector(".o-aside");
const asideContent = document.querySelector(".o-aside__content");
const handleBtn = document.querySelector(".o-aside__header");
const overlay = document.getElementById("overlay");

if (!aside || !asideContent || !handleBtn || !overlay) return;

let isClosed = true;

const closeSheet = () => {
isClosed = true;
aside.classList.remove("o-aside--open");
asideContent.removeAttribute("role");
asideContent.setAttribute("aria-hidden", "true");
handleBtn.setAttribute("aria-expanded", "false");
overlay.classList.remove("overlay--show");
};

const openSheet = () => {
isClosed = false;
aside.classList.add("o-aside--open");
overlay.classList.add("overlay--show");
asideContent.setAttribute("role", "dialog");
asideContent.setAttribute("aria-hidden", "false");
handleBtn.setAttribute("aria-expanded", "true");
};

if (isMobile()) {
closeSheet();
}

const toggleSheet = () => {
if (isClosed) {
openSheet();
} else {
closeSheet();
}
};

handleBtn.addEventListener("click", toggleSheet);
overlay.addEventListener("click", closeSheet);

// Drag support
let startY = 0;
let currentY = 0;
let isDragging = false;

const dragStart = (e) => {
startY = e.clientY || e.touches?.[0].clientY;
isDragging = true;
};

const dragging = (e) => {
if (!isDragging) return;
e.preventDefault();
currentY = e.clientY || e.touches?.[0].clientY;
const deltaY = startY - currentY;

if (isClosed && deltaY > 50) {
openSheet();
}

if (!isClosed && deltaY < -50) {
closeSheet();
}
};

const dragEnd = () => {
if (!isDragging) return;
isDragging = false;
};

handleBtn.addEventListener("mousedown", dragStart);
handleBtn.addEventListener("mousemove", dragging);
handleBtn.addEventListener("mouseup", dragEnd);

handleBtn.addEventListener("touchstart", dragStart);
handleBtn.addEventListener("touchmove", dragging);
handleBtn.addEventListener("touchend", dragEnd);

// close bottom-sheet if link is clicked
document.querySelectorAll(".o-aside__toc-link").forEach((link) => {
link.addEventListener("click", () => {
if (isMobile()) {
closeSheet();
}
});
});

let wasMobile = isMobile();

const handleResize = () => {
if (isMobile() && !wasMobile) {
wasMobile = true;
closeSheet();
}
if (!isMobile()) {
wasMobile = false;
overlay.classList.remove("overlay--show");
aside.classList.remove("o-aside--open");
}
};

window.addEventListener("load", handleResize);
window.addEventListener("resize", handleResize);
};

if (document.readyState === "interactive") {
initAside();
} else {
window.addEventListener("DOMContentLoaded", () => {
initAside();
});
}
10 changes: 0 additions & 10 deletions assets/js/highlightHeadline.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import * as mq from "./mediaqueries";

function isAsideActive() {
return window.matchMedia(mq.minLG).matches;
}

function initHighlightHeadline() {
const headings = Array.from(
document.querySelectorAll(".o-single__highlight :is(h1, h2, h3)"),
Expand All @@ -28,10 +22,6 @@ function initHighlightHeadline() {
let scrollDebounce;

function updateActiveHeading() {
if (!isAsideActive()) {
return;
}

let currentHeading = null;

for (let i = 0; i < headings.length; i++) {
Expand Down
1 change: 1 addition & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./mobileMenu.js";
import "./resizeObserver.js";
import "./mediaqueries.js";
import "./highlightHeadline.js";
import "./contentNavigation.js";
import "./anchorlinks.js";
import "./dropdown.js";
import "./darkmode.js";
Expand Down
20 changes: 10 additions & 10 deletions assets/js/mediaqueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* import * as mq from '../helpers/mediaqueries';
*==================================================
*/
export const maxXS = "(max-width: 575px)";
export const maxSM = "(max-width: 751px)";
export const maxMD = "(max-width: 967px)";
export const maxLG = "(max-width: 1182px)";
export const maxXL = "(max-width: 1463px)";
export const maxXS = "(max-width: 576px)";
export const maxSM = "(max-width: 768px)";
export const maxMD = "(max-width: 992px)";
export const maxLG = "(max-width: 1200px)";
export const maxXL = "(max-width: 1400px)";

export const minSM = "(min-width: 576px)";
export const minMD = "(min-width: 752px)";
export const minLG = "(min-width: 968px)";
export const minXL = "(min-width: 1183px)";
export const minXXL = "(min-width: 1464px)";
export const minSM = "(min-width: 577px)";
export const minMD = "(min-width: 768px)";
export const minLG = "(min-width: 993px)";
export const minXL = "(min-width: 1201px)";
export const minXXL = "(min-width: 1401px)";
194 changes: 194 additions & 0 deletions assets/sass/contentNavigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
.o-aside {
margin-bottom: 0;
position: sticky;
top: 8rem;
font-size: 1.4rem;
line-height: 1.5;
margin-right: 0;
z-index: 3;
display: flex;
flex-direction: column;
gap: 1.5rem;
flex-wrap: wrap;
height: fit-content;

ul,
ol {
list-style-type: none;
list-style-position: outside;
padding-left: 0;

ul,
ol {
margin-bottom: 0;
}
}
}

.o-aside__header {
display: none;
}

.o-aside a {
text-decoration-line: none;
display: flex;
align-items: flex-start;
gap: 0.4rem;
}

.o-aside__backlink-text {
display: flex;
align-items: center;
gap: 0.4rem;
}

.o-aside__toc {
li {
list-style-type: none;
}

ol {
padding: 0 0 0 1em;
}

> ol {
padding-left: 0;
}
}

.o-aside__toc-link {
display: flex;
}

.o-aside__toc a[data-current] {
font-weight: bold;

&:before {
content: "";
width: 0.4rem;
height: 2.1rem;
position: absolute;
display: flex;
left: 0;
background-color: var(--link-default);
}
}

.o-related {
&__list {
list-style-type: none;
list-style-position: outside;
padding-left: 0;
}

&-date {
padding-left: 2.5rem;
}

p {
margin-bottom: 0;
}
}

.o-related__item img {
border-radius: var(--border-radius-s);
}

@media (max-width: #{$breakpoint-lg}) {
.o-aside {
position: fixed;
top: unset;
bottom: 0;
left: 0;
width: 100%;
max-height: 100vh;
gap: 0;
overflow: hidden;
flex-flow: column;
transition: transform 0.5s ease-in-out;
border-radius: var(--border-radius-m) var(--border-radius-m) 0 0;
transform: translateY(calc(100% - 6.4rem - env(safe-area-inset-bottom)));
box-shadow: var(--box-shadow);
max-height: calc(100vh - 20rem - env(safe-area-inset-bottom));

&--open {
transform: translateY(0);
}

&:not(.o-aside--open) {
> .o-aside__header {
border-bottom: none;
}

> .o-aside__content {
pointer-events: none;
user-select: none;

* {
opacity: 0;
}
}
}

&__content {
background: var(--bg-default);
overflow-y: scroll;
overscroll-behavior-y: contain;
border-left: var(--border);
border-right: var(--border);

.o-single__container {
border: none;
}

* {
transition: opacity 0.3s ease-in-out;
}
}

&__header {
display: flex;
align-items: center;
flex-direction: column;
gap: 1.5rem;
width: 100%;
border: var(--border);
border-bottom: 1px solid #3d444d;
padding: 1rem;
height: 6.4rem;
border-radius: 1rem 1rem 0 0;
background: var(--bg-default);
color: var(--color-body);
}

&__drag {
height: 0.4rem;
width: 4rem;
display: block;
background: var(--color-body);
border-radius: 2rem;
}

&__logo {
display: flex;
align-items: center;
gap: 1.5rem;
}
}

main.o-newspage .o-aside {
display: none;
}
}

.overlay--show {
backdrop-filter: blur(4px);
background-color: rgba(0, 0, 0, 0.6);
position: fixed;
inset: 0;
z-index: 3;
}

body:has(.overlay--show) {
overflow: hidden;
}
2 changes: 1 addition & 1 deletion assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "styles.scss";
@import "fonts.scss";
@import "navigation.scss";
@import "sidemenu.scss";
@import "contentNavigation";
@import "search.scss";
@import "teaser.scss";
@import "footer.scss";
Expand Down
Loading
Loading