mirror of
https://github.com/DerTyp7/dertyp7.github.io.git
synced 2025-10-29 21:02:09 +01:00
Remove console logs and clean up code
This commit is contained in:
@@ -33,16 +33,10 @@ export default function App() {
|
|||||||
(entries) => {
|
(entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
// console.log("====================================");
|
|
||||||
// console.log(`Previous Hash: ${prevHash.current}`);
|
|
||||||
// console.log(`Current Hash: ${window.location.hash}`);
|
|
||||||
// console.log(`Target ID: ${entry.target.id}`);
|
|
||||||
|
|
||||||
const difference = Math.abs(
|
const difference = Math.abs(
|
||||||
sections.indexOf(prevHash.current.replace("#", "")) -
|
sections.indexOf(prevHash.current.replace("#", "")) -
|
||||||
sections.indexOf(window.location.hash.replace("#", ""))
|
sections.indexOf(window.location.hash.replace("#", ""))
|
||||||
);
|
);
|
||||||
// console.log(`Difference: ${difference}`);
|
|
||||||
if (difference > 1) {
|
if (difference > 1) {
|
||||||
prevHash.current = entry.target.id;
|
prevHash.current = entry.target.id;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function About() {
|
|||||||
setJob(jobs[jobIndex]);
|
setJob(jobs[jobIndex]);
|
||||||
}, 7000);
|
}, 7000);
|
||||||
|
|
||||||
return () => clearInterval(intervalId); // Clean up on unmount
|
return () => clearInterval(intervalId);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user