misc

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Rendered for js/wasm

Index

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 FancyHR added in v1.3.6

func FancyHR(opts *HR) *elements.Element

func GridNoOverflow added in v1.3.3

func GridNoOverflow(opts *GridOptions) *elements.Element

func JiggleText added in v1.3.2

func JiggleText(tag, text string, opts *JiggleOptions) *elements.Element

func Join added in v1.1.9

func Join(css ...[]string) []string

func NewGrid added in v1.3.3

func NewGrid(opts *GridOptions) *elements.Element

func RoadMap added in v1.3.0

func RoadMap(roadMap *RoadMapOptions) *elements.Element
func SearchBar(classPrefix, foregroundHex, background, text string) []*elements.Element

Search bar element with button Returns slice of elements [0]: search container, [1]: search bar, [2]: search bar submit button

Types

type ButtonType added in v1.3.1

type ButtonType int
const (
	Anchor ButtonType = 0
	Button ButtonType = 1
)

type Counter added in v1.2.0

type Counter struct {
	// contains filtered or unexported fields
}

func NewCounter added in v1.2.0

func NewCounter(elem *elements.Element) *Counter

func (*Counter) Add added in v1.2.0

func (c *Counter) Add(i int)

func (*Counter) Decrement added in v1.2.0

func (c *Counter) Decrement()

func (*Counter) Get added in v1.2.0

func (c *Counter) Get() int

func (*Counter) Increment added in v1.2.0

func (c *Counter) Increment()

func (*Counter) Reset added in v1.2.0

func (c *Counter) Reset()

func (*Counter) Set added in v1.2.0

func (c *Counter) Set(i int)

func (*Counter) Sub added in v1.2.0

func (c *Counter) Sub(i int)

type Grid added in v1.1.9

type Grid interface {
	Columns() []*elements.Element
	Rows() []*elements.Element
	Element() *elements.Element
	Render() jsext.Element
}

func GridFromPattern added in v1.3.3

func GridFromPattern(gridItemCallback func(row int, column int, index int) []*elements.Element, gridPattern ...string) Grid

Provide a grid based on a pattern. Returns the rows and columns of the grid.

type GridItem added in v1.3.3

type GridItem struct {
	Header *elements.Element
	Body   *elements.Element
	Footer *elements.Element
}

func (*GridItem) Container added in v1.3.3

func (g *GridItem) Container(className string) *elements.Element

type GridOptions added in v1.3.3

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 added in v1.3.3

func (c *GridOptions) Fractions(fr ...string)

type HR added in v1.3.6

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 added in v1.3.2

type JiggleOptions struct {
	ChangeColor string
	ClassPrefix string
	Words       bool
}

func (*JiggleOptions) MainElementClass added in v1.3.5

func (opts *JiggleOptions) MainElementClass() string

func (*JiggleOptions) SetDefaults added in v1.3.2

func (opts *JiggleOptions) SetDefaults()
type Modal elements.Element

func CreateModal added in v1.3.1

func CreateModal(opts ModalOptions) *Modal

func (*Modal) Button added in v1.3.1

func (m *Modal) Button(tag ButtonType, innerText string) *elements.Element

func (*Modal) CloseOnClickOf added in v1.3.1

func (m *Modal) CloseOnClickOf(e *elements.Element)

func (*Modal) Create added in v1.3.1

func (m *Modal) Create(appendToQuerySelector ...string)

func (*Modal) Delete added in v1.3.1

func (m *Modal) Delete()

func (*Modal) Hide added in v1.3.1

func (m *Modal) Hide()

func (*Modal) OpenOnClickOf added in v1.3.1

func (m *Modal) OpenOnClickOf(e *elements.Element)

func (*Modal) Render added in v1.3.1

func (m *Modal) Render() jsext.Element

func (*Modal) Show added in v1.3.1

func (m *Modal) Show()

type ModalOptions added in v1.3.1

type ModalOptions struct {
	Header           *elements.Element
	Body             *elements.Element
	Footer           *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 added in v1.3.1

func (opts *ModalOptions) SetDefaults()

type RoadMapItem added in v1.3.0

type RoadMapItem struct {
	Name         string
	Title        string
	TitleElement *elements.Element
	Description  string
	Tags         []string
	StartDate    string
	EndDate      string
}

type RoadMapOptions added in v1.3.0

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 added in v1.3.0

type RoadMapStyle int
const (
	RoadMapStyleOne RoadMapStyle = iota
	RoadMapStyleTwo
)

type TimeCounter added in v1.2.0

type TimeCounter struct {
	// contains filtered or unexported fields
}

func NewTimeCounter added in v1.2.0

func NewTimeCounter(elem *elements.Element) *TimeCounter

func (*TimeCounter) Add added in v1.2.0

func (c *TimeCounter) Add(t time.Duration)

func (*TimeCounter) Date added in v1.2.0

func (c *TimeCounter) Date(year int, month time.Month, day int, hour int, min int, sec int, nsec int)

func (*TimeCounter) Display added in v1.2.0

func (c *TimeCounter) Display(Time time.Time)

func (*TimeCounter) FormatFunc added in v1.2.0

func (c *TimeCounter) FormatFunc(f func(*convert.TimeTracker) string)

func (*TimeCounter) Get added in v1.2.0

func (c *TimeCounter) Get() time.Time

func (*TimeCounter) Increment added in v1.2.0

func (c *TimeCounter) Increment()

func (*TimeCounter) Live added in v1.2.0

func (c *TimeCounter) Live()

func (*TimeCounter) Reset added in v1.2.0

func (c *TimeCounter) Reset()

func (*TimeCounter) Set added in v1.2.0

func (c *TimeCounter) Set(t time.Time)

func (*TimeCounter) SetFormat added in v1.2.0

func (c *TimeCounter) SetFormat(format string)

func (*TimeCounter) StopLive added in v1.2.0

func (c *TimeCounter) StopLive()

func (*TimeCounter) Sub added in v1.2.0

func (c *TimeCounter) Sub(t time.Duration)

func (*TimeCounter) Tracker added in v1.2.0

func (c *TimeCounter) Tracker() *convert.TimeTracker

func (*TimeCounter) UpdateFunc added in v1.2.0

func (c *TimeCounter) UpdateFunc(f func(*convert.TimeTracker, *elements.Element))

type Translations added in v1.3.0

type Translations struct {
	To      string
	Present string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL