The Scrolling Nav is a navigation bar thats updates while you scroll through the page. Clicking on a navigation button will scroll directly to that section.
The intial state include the labels and the arrangement of the sections
Opinionated way of viewing the section.
This might be useful at first, but you should consider writing your own view function.
view :
(section -> Element msg)
-> Model section
-> List (Element msg)
view asElement { toString, arrangement } =
arrangement
|> List.map
(\header ->
Element.el
[ header
|> toString
|> Attributes.id
|> Element.htmlAttribute
, Element.width <| Element.fill
]
<|
asElement <|
header
)Returns the current section
Returns a select widget containing all section, with the current section selected.
Scrolls the screen to the respective section
Scrolls the screen to the respective section with some offset
Updates the positions of all sections. This functions should be called regularly if the height of elements on your page can change during time.
Syncs the position of of the viewport
sets the position of the viewport to show a specific section