Live CockpitCMS+Svelte Projects:
Directly imported into
App.svelteand nowhere else.
Since the rule is not sufficiently followed, this folder may be restructured. Also, graphical and non-graphical elements are quite mixed in it.
Head - Changes the page's , description and robots
Header,Footer - Always at the top / bottom of the pageLayout - receives an object with the page layout and breaks it down into individual components from sectionsLoading - loading, used in {#await} blocksModal - modal iframe (replacement for lity to avoid having to import jQuery), uses "writable() store", can only be defined once, is also imported in sections as a module (should be in a different folder than Parts because of the rule) to change its content and activate it via writableTheme - simple implementation for quick theme switchingLangSelector - currently implemented only in the header = imported outside App.svelteGlobalScripts - loads external scripts using JSLoaderModule that are always available on the page (e.g. nextSection)Everything related to background navigation (slug management)
Router - Creates an eventListener on window for all anchor elements, causes internal navigation instead of refresh if the anchor meets conditions (poorly defined, e.g. modal=true, besides it doesn't use writable() store but binding via props, which prevents easy access from any Svelte component)RouterModule - Function for causing internal navigation, imported besides the router where internal navigation is needed outside anchor elements (i.e. on elements that Router ignores). Is in a separate filePreview - cockpitcms live preview support. Caching uses a silly trick in App.svelteLanguageStore - Stores the current language and supported languages for all components that need it (currently only App, Router, Nav, LangSelector, Header and Footer). Initialization of supported languages in App via .setSupportedAll files in this folder are scripts with only context="module", i.e. they only export functions and are not graphical.
Slideshow - Slideshow in the header for mottos, possibly this might become a full-fledged separate componentYTurlToEmbed - Converts YouTube URL to embed format, if it receives a non-YouTube URL it returns an empty stringLangDetectModule - Imported into App.svelte and Router.svelte, detects what language the user prefers according to window.navigator.language(s), sets the initial language of the page accordingly via Router.svelte.JSLoaderModule - Function for importing external JS files on-the-fly with callback, currently only in GlobalScriptsisOffScreen - Detection whether an element is off screen, used for animations and auto-pausing video (in Video,Bar,Header,Titulka,Ranking)All values (here some main ones are listed in parentheses in simplified form) should be optional (WIP: so that the user cannot kill the Svelte process e.g. if {#each} accidentally receives null)
Bar
Floaters
Ranking
Ref
Slide
Titulka
Video
Bubbles
![]() |
|---|
Sections find their use as components in CockpitCMS from which the entire page is composed via Layout.svelte |
All elements that use z-index and their value, sorted in descending order. For easy identification of what is at which level.
Previous: 3. Backend parts of CockpitCMS
Next: 5. Process On Page Load