From fa988a2ccab4dc1350372f114dd15e9d32d12cb1 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Wed, 13 Nov 2024 02:47:17 +0100 Subject: [PATCH] Add the Scroll module. --- src/Scroll.purs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/Scroll.purs diff --git a/src/Scroll.purs b/src/Scroll.purs new file mode 100644 index 0000000..80b3d19 --- /dev/null +++ b/src/Scroll.purs @@ -0,0 +1,15 @@ +module Scroll where + +import Prelude +import Effect (Effect) +import Effect.Console (log) +import Halogen as H +import Web.HTML (window) +import Web.HTML.Window (scroll) + +scrollToTop :: Effect Unit +scrollToTop = do + H.liftEffect do + w <- window + scroll 0 0 w + log "Scrolled to top of the page"