Documentation ¶
Index ¶
- type Application
- func (s *Application) AddPage(title string, c components.ComponentWithValue) *Page
- func (s *Application) Backgrounds(t BackgroundType, b ...string) Backgrounds
- func (a *Application) Client() *requester.APIClient
- func (s *Application) Close()
- func (s *Application) ContainerByName(name string) jsext.Element
- func (s *Application) CurrentPage() *Page
- func (s *Application) NextPage()
- func (s *Application) PageByHash(name string) (*Page, int)
- func (s *Application) PageByTitle(name string) (*Page, int)
- func (s *Application) PreviousPage()
- func (s *Application) Run()
- func (a *Application) SetClientFunc(f func() *requester.APIClient) *Application
- func (s *Application) SetFooter(c components.Component)
- func (s *Application) SetLoader(loader components.Loader)
- func (s *Application) SetNavbar(c components.Component)
- type Axis
- type Background
- type BackgroundType
- type Backgrounds
- type Gradient
- type GradientType
- type Options
- type Page
- type PageDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Loader components.Loader Options *Options // contains filtered or unexported fields }
Application struct
func App ¶
func App(documentObjectQuerySelector string, options *Options) *Application
Create a new application from options
func (*Application) AddPage ¶
func (s *Application) AddPage(title string, c components.ComponentWithValue) *Page
Add a page
func (*Application) Backgrounds ¶
func (s *Application) Backgrounds(t BackgroundType, b ...string) Backgrounds
Set the application backgrounds
func (*Application) Client ¶
func (a *Application) Client() *requester.APIClient
Initialize a http client with a loader for a new request.
func (*Application) ContainerByName ¶
func (s *Application) ContainerByName(name string) jsext.Element
containerByName returns the page's container by name.
func (*Application) CurrentPage ¶
func (s *Application) CurrentPage() *Page
func (*Application) PageByHash ¶
func (s *Application) PageByHash(name string) (*Page, int)
PageByHash returns the page by the hash value.
func (*Application) PageByTitle ¶
func (s *Application) PageByTitle(name string) (*Page, int)
PageByTitle returns the page by the title.
func (*Application) SetClientFunc ¶
func (a *Application) SetClientFunc(f func() *requester.APIClient) *Application
Set the client function.
func (*Application) SetFooter ¶
func (s *Application) SetFooter(c components.Component)
Set the application footer
func (*Application) SetLoader ¶
func (s *Application) SetLoader(loader components.Loader)
Set the application loader
func (*Application) SetNavbar ¶
func (s *Application) SetNavbar(c components.Component)
Set the application navbar
type Background ¶
type Background struct { BackgroundType BackgroundType Background string ExtraCSS string Gradient *Gradient }
Background is a struct that holds the type of background and the background styling.
func (*Background) AddGradient ¶
func (b *Background) AddGradient(gradientType GradientType, direction string, g ...string)
Gradient type can only be set once! Gradients will be passed along in the following css string: background: linear-gradient(to boottom, gradient1, gradient2, ...);
func (*Background) CSS ¶
func (bg *Background) CSS(selector string) string
type BackgroundType ¶
type BackgroundType int8
Supported background types for the scrollable app.
const ( BackgroundTypeImage BackgroundType = 1 BackgroundTypeColor BackgroundType = 2 BackgroundTypeStyle BackgroundType = 3 )
Supported background types for the scrollable app.
type Backgrounds ¶
type Backgrounds []*Background
Backgrounds is a slice of Backgrounds.
func (Backgrounds) AddGradient ¶
func (b Backgrounds) AddGradient(gradientType GradientType, direction string, g ...string)
type Gradient ¶
type Gradient struct { GradientType GradientType Direction string Gradients []string }
Gradient is a struct that holds the type of gradient and the gradients.
type GradientType ¶
type GradientType int8
Type of gradient to use.
const ( GradientTypeLinear GradientType = 1 GradientTypeRadial GradientType = 2 )
Type of gradient to use.
type Page ¶
type Page struct { Component components.ComponentWithValue OnShow func(element components.ComponentWithValue, p PageDirection) OnHide func(element components.ComponentWithValue, p PageDirection) // contains filtered or unexported fields }
Page struct. Mostly used internally.
func (*Page) SetOnHide ¶
func (p *Page) SetOnHide(cb func(element components.ComponentWithValue, p PageDirection)) *Page
Callback for when the page is being hidden.
func (*Page) SetOnShow ¶
func (p *Page) SetOnShow(cb func(element components.ComponentWithValue, p PageDirection)) *Page
Callback for when the page is being viewed.
type PageDirection ¶
type PageDirection int8
const ( Initial PageDirection = 0 Up PageDirection = 1 Down PageDirection = 2 Left PageDirection = 3 Right PageDirection = 4 )