diff --git a/src/App/App.css b/src/App/App.css index fa7ae102f0b627bee8a8d22c7510d473355889c9..6b9bedf4d97c8ea1e30f5ebfdb2ee720160a0595 100644 --- a/src/App/App.css +++ b/src/App/App.css @@ -74,6 +74,10 @@ html{ display: none; } +.scrolllink span{ + color: var(--background) !important; +} + .small-row{ --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; diff --git a/src/components/ScrollLink.tsx b/src/components/ScrollLink.tsx index 30855b7a706b377e0fbcbb18df339761e892d1fd..db9c4c627eef12bfd8bf69e9684ac4289ee99646 100644 --- a/src/components/ScrollLink.tsx +++ b/src/components/ScrollLink.tsx @@ -36,8 +36,8 @@ export const ScrollLink: React.FC<ScrollLinkProps> = ({ targetId, label }) => { }; return ( - <a href={`#${targetId}`} onClick={handleClick}> - {label} + <a className="scrolllink" href={`#${targetId}`} onClick={handleClick}> + <span>{label}</span> </a> ); }; diff --git a/src/utils/Highlight-functions.ts b/src/utils/Highlight-functions.ts index 65215a5fb0d5b391b3700f5af572df949dc059a4..8206b4d69affe16bbf0d2b9d7604dbc2cc442907 100644 --- a/src/utils/Highlight-functions.ts +++ b/src/utils/Highlight-functions.ts @@ -1,5 +1,5 @@ export function NewHighlight({el}: {el: HTMLElement | null}, {subtitle}:{subtitle: HTMLElement | null}){ - let TopDistance = 150; + let TopDistance = 170; /* console.log("Starting highlight check...") console.log("here come el...") console.log(el) @@ -10,12 +10,12 @@ export function NewHighlight({el}: {el: HTMLElement | null}, {subtitle}:{subtitl //console.log(el) // console.log(el.getBoundingClientRect()) if (el.getBoundingClientRect().top < TopDistance + 1 && el.getBoundingClientRect().bottom > TopDistance){ - subtitle.style.color = "#F57D22"; + subtitle.style.color = "white"; subtitle.style.backgroundColor = "rgb(133, 15, 120, 0.8)"; subtitle.style.borderColor = "#850F78"; subtitle.style.marginLeft = "5px"; subtitle.style.paddingRight = "5px"; - subtitle.style.fontWeight = "900"; + subtitle.style.fontWeight = "700"; /* console.log("subtitle: ",subtitle) console.log("style: ", subtitle.style) @@ -74,12 +74,13 @@ export function NewHighlight({el}: {el: HTMLElement | null}, {subtitle}:{subtitl */ export function Highlight({el}: {el: HTMLElement | null}, {subtitle}:{subtitle: HTMLElement | null}){ - let TopDistance = 150; + let TopDistance = 170; if (el != null && subtitle != null){ //console.log("Highlighting Element: ", el, "Subtitle: ", subtitle); //console.log(`Element position: top=${el.getBoundingClientRect().top}, bottom=${el.getBoundingClientRect().bottom}`); if (el.getBoundingClientRect().top < TopDistance + 1 && el.getBoundingClientRect().bottom > TopDistance){ (subtitle.childNodes[0] as HTMLElement).classList.add("active-sideitem"); + subtitle.style.fontWeight = "900"; if(subtitle.childNodes[0].childNodes[1] != undefined){ (subtitle.childNodes[0].childNodes[1] as HTMLElement).style.display = "block"; // console.log(`subtitle.childNodes[0].textContent ${subtitle.childNodes[0].textContent}`) @@ -87,6 +88,7 @@ export function NewHighlight({el}: {el: HTMLElement | null}, {subtitle}:{subtitl } } else { (subtitle.childNodes[0] as HTMLElement).classList.remove("active-sideitem"); + subtitle.style.fontWeight = "normal"; if(subtitle.childNodes[0] != undefined){ (subtitle.childNodes[0] as HTMLElement).classList.remove("active-sideitem"); if(subtitle.childNodes[0].childNodes[1] != undefined){