You can create variables using the (set:) macro to store which Passage each of the different Tabs (links?) currently reference, and the ideal places to initialise these variables to their default values would be within a startup tagged special Passage
(set: $story to "Front Page")
(set: $codex to "Codex Index")
(set: $timeline to "Year 1")
You can then use these variables to indicate which passage to show when the related links are selected, and you can create the related links using the (link-goto: ) macro like so.
(link-goto: "Story", $story)
(link-goto: "Codex", $codex)
(link-goto: "Timeline", $timeline)
The next issue is how to keep the value of these variables up to date and you could do that one of two ways:
1. Manually: by using a (set:) macro to change which related Passage was last shown to the reader.
(set: $codex to "to-the-last-codex-passage-shown")
2. Automatically: by using known Passage tags to mark each of the Passages belonging to each 'Tab', and then use code within a header tagged special Passage to update the relevant variable each time a related Passage is shown.
2a. Mark all the Codex related passages with a codex tag, all the Timeline related ones with a timeline tag, and so forth. If most of the passages within the story are Story related then I would suggest leaving these ones untagged.
2b. Create a header tagged special Passage and then use code like the following to check for each tag and update the related variable. The following assumes that all Passages without any known tags are Story related passages, it also assumes that each Passage can only belong to one 'Tag'.
note: The name you give the header passage is not important but you will need to remember it so that it can be used in some CSS later, I named the header passage in this example Update Tab Variables
(set: _passage to (passage:)'s name)
(set: _tags to (passage:)'s tags)
(if: _tags contains "codex")[
(set: $codex to _passage)
]
(else-if: _tags contains "timeline")[
(set: $timeline to _passage)
]
(else:)[
(set: $story to _passage)
]
The last issue to solve is removing/hiding any visual output generated by either the startup tagged passage or the header passage from point 2b, and placing CSS like the following within your story's Story Stylesheet area will do this.
tw-include[type="startup"], tw-include[title="Update Tab Variables"] {
display: none;
}
note: If you named the header tagged passage from point 2b something other than Update Tab Variables then you will need to modify the above CSS to use that passage name/title instead.