Documentation
¶
Rendered for js/wasm
Index ¶
- Variables
- func FancyHR(opts *HR) *elements.Element
- func GridNoOverflow(opts *GridOptions) *elements.Element
- func JiggleText(tag, text string, opts *JiggleOptions) *elements.Element
- func Join(css ...[]string) []string
- func NewGrid(opts *GridOptions) *elements.Element
- func RoadMap(roadMap *RoadMapOptions) *elements.Element
- func SearchBar(classPrefix, foregroundHex, background, text string) []*elements.Element
- type ButtonType
- type Counter
- type Grid
- type GridItem
- type GridOptions
- type HR
- type JiggleOptions
- type Modal
- func (m *Modal) Button(tag ButtonType, innerText string) *elements.Element
- func (m *Modal) CloseOnClickOf(e *elements.Element)
- func (m *Modal) Create(appendToQuerySelector ...string)
- func (m *Modal) Delete()
- func (m *Modal) Hide()
- func (m *Modal) OpenOnClickOf(e *elements.Element)
- func (m *Modal) Render() jsext.Element
- func (m *Modal) Show()
- type ModalOptions
- type RoadMapItem
- type RoadMapOptions
- type RoadMapStyle
- type TimeCounter
- func (c *TimeCounter) Add(t time.Duration)
- func (c *TimeCounter) Date(year int, month time.Month, day int, hour int, min int, sec int, nsec int)
- func (c *TimeCounter) Display(Time time.Time)
- func (c *TimeCounter) FormatFunc(f func(*convert.TimeTracker) string)
- func (c *TimeCounter) Get() time.Time
- func (c *TimeCounter) Increment()
- func (c *TimeCounter) Live()
- func (c *TimeCounter) Reset()
- func (c *TimeCounter) Set(t time.Time)
- func (c *TimeCounter) SetFormat(format string)
- func (c *TimeCounter) StopLive()
- func (c *TimeCounter) Sub(t time.Duration)
- func (c *TimeCounter) Tracker() *convert.TimeTracker
- func (c *TimeCounter) UpdateFunc(f func(*convert.TimeTracker, *elements.Element))
- type Translations
Constants ¶
This section is empty.
Variables ¶
View Source
var Box = []string{
"border-radius: 0 0 0.5rem 0.5rem",
"box-shadow: 0 1rem 1rem 0 rgba(0,0,0,0.2)",
}
View Source
var Container = []string{
"width: 80%",
"margin: 1rem auto",
"padding: 0 2%",
"padding-bottom: 1rem",
}
View Source
var GridDelimiter = " "
Functions ¶
func GridNoOverflow ¶
func GridNoOverflow(opts *GridOptions) *elements.Element
func JiggleText ¶
func JiggleText(tag, text string, opts *JiggleOptions) *elements.Element
func NewGrid ¶
func NewGrid(opts *GridOptions) *elements.Element
func RoadMap ¶
func RoadMap(roadMap *RoadMapOptions) *elements.Element
Types ¶
type Grid ¶
type GridOptions ¶
type GridOptions struct {
// The grid items to display inside of the grid.
GridItems []*GridItem
// Grid width, 100%, etc.
Width string
// GridItemWidth grid width, 1fr, etc.
GridItemWidth string
// Amount of rows and columns in the grid.
Columns int
Rows int
// Column fractions
GridColumnWidth []string
// If there are too many grid items supplied, and ElementOnOverflow is not nil,
// the last grid item will be replaced with the ElementOnOverflow when used in a supportive function.
ElementOnOverflow *GridItem
// ExtraCSS is a map with the following keys, to edit their respective elements css styles.
// - grid
// - grid-item
ExtraCSS map[string]string
// Class prefix for the grid, and its elements.
ClassPrefix string
// Function to be called for adding extra CSS.
CSSFunc func(gridClass, itemClass, itemHeaderClass, itemBodyClass, itemFooterClass string) string
}
func (*GridOptions) Fractions ¶
func (c *GridOptions) Fractions(fr ...string)
type HR ¶
type HR struct {
// Width and height of the HR
Width, Height string
// Main colors to use.
BackCol, FadeCol string
// Margin top and bottom.
MarginTopBottom string
// Border radius
BorderRadius string
// Fade direction, can be "left", "right", "top", "bottom"
FadeDir string
// Format strings for the colors
// Example: "rgba(%d, %d, %d, 1)"
BackColFormat string
// Format strings for the colors
// Example: "rgba(%d, %d, %d, 0.1)"
FadeColFormat string
// Animate
Animate bool
}
type JiggleOptions ¶
func (*JiggleOptions) MainElementClass ¶
func (opts *JiggleOptions) MainElementClass() string
func (*JiggleOptions) SetDefaults ¶
func (opts *JiggleOptions) SetDefaults()
type Modal ¶
func CreateModal ¶
func CreateModal(opts ModalOptions) *Modal
func (*Modal) CloseOnClickOf ¶
func (*Modal) OpenOnClickOf ¶
type ModalOptions ¶
type ModalOptions struct {
Header *elements.Element
Body *elements.Element
Background string
ModalBackground string
BorderRadius string
Border string
Width string
Height string
ClassPrefix string
CloseButton bool
CloseButtonScale float64
ZIndex int
}
func (*ModalOptions) SetDefaults ¶
func (opts *ModalOptions) SetDefaults()
type RoadMapItem ¶
type RoadMapOptions ¶
type RoadMapOptions struct {
Background string
ItemBackground string
TagBackgroundColors []string
Color string
TitleColor string
TagColor string
DivisorColor string
DivisorWidth string
CardMargin string
CardBorderWidth string
CardBorderColor string
Width string
Items []RoadMapItem
Style RoadMapStyle
Translations Translations
FontScale float64
// contains filtered or unexported fields
}
type RoadMapStyle ¶
type RoadMapStyle int
const ( RoadMapStyleOne RoadMapStyle = iota RoadMapStyleTwo )
type TimeCounter ¶
type TimeCounter struct {
// contains filtered or unexported fields
}
func NewTimeCounter ¶
func NewTimeCounter(elem *elements.Element) *TimeCounter
func (*TimeCounter) Add ¶
func (c *TimeCounter) Add(t time.Duration)
func (*TimeCounter) Display ¶
func (c *TimeCounter) Display(Time time.Time)
func (*TimeCounter) FormatFunc ¶
func (c *TimeCounter) FormatFunc(f func(*convert.TimeTracker) string)
func (*TimeCounter) Get ¶
func (c *TimeCounter) Get() time.Time
func (*TimeCounter) Increment ¶
func (c *TimeCounter) Increment()
func (*TimeCounter) Live ¶
func (c *TimeCounter) Live()
func (*TimeCounter) Reset ¶
func (c *TimeCounter) Reset()
func (*TimeCounter) Set ¶
func (c *TimeCounter) Set(t time.Time)
func (*TimeCounter) SetFormat ¶
func (c *TimeCounter) SetFormat(format string)
func (*TimeCounter) StopLive ¶
func (c *TimeCounter) StopLive()
func (*TimeCounter) Sub ¶
func (c *TimeCounter) Sub(t time.Duration)
func (*TimeCounter) Tracker ¶
func (c *TimeCounter) Tracker() *convert.TimeTracker
func (*TimeCounter) UpdateFunc ¶
func (c *TimeCounter) UpdateFunc(f func(*convert.TimeTracker, *elements.Element))
type Translations ¶
Click to show internal directories.
Click to hide internal directories.