From 5ec42736f3f17e9f5432063b4cc17e6ad9a75713 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 28 Oct 2020 00:03:05 +0100 Subject: Use scroll-padding for aligning anchors This change is one in a series of patches to remove the use of jQuery. Here, we can utilize the scroll-padding CSS property to align anchors properly in presence of a fixed top header. --- frontend/src/components/home/SimulationSection.js | 2 +- frontend/src/index.sass | 3 ++ frontend/src/pages/Home.js | 61 ++++++----------------- 3 files changed, 20 insertions(+), 46 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/home/SimulationSection.js b/frontend/src/components/home/SimulationSection.js index e7a02068..b0244cb5 100644 --- a/frontend/src/components/home/SimulationSection.js +++ b/frontend/src/components/home/SimulationSection.js @@ -3,7 +3,7 @@ import ScreenshotSection from './ScreenshotSection' const ModelingSection = () => ( 0) { - return - } - e.preventDefault() - jQuery(jQuery(this).attr('href'))[0].scrollIntoView() - window.scrollBy(0, -scrollOffset) - }) - - if (!this.state.scrollSpySetup) { - jQuery('body').scrollspy({ - target: '#navbar', - offset: scrollOffset, - }) - this.setState({ scrollSpySetup: true }) - } - } - - render() { - return ( -
- -
- - - - - - - - - -
+function Home() { + return ( +
+ +
+ + + + + + + + +
- ) - } +
+ ) } export default Home -- cgit v1.2.3