Documentation ¶
Index ¶
- Variables
- func BoundingBox(elem dom.Element) (float64, float64, float64, float64)
- func ClientBox() (float64, float64)
- func Document() dom.Document
- func Expando(prop string) []string
- func GetComputedStyle(elem dom.Element, ps string) (*dom.CSSStyleDeclaration, error)
- func GetComputedStylePriority(css *dom.CSSStyleDeclaration, prop string) (int, error)
- func GetComputedStyleValue(elem dom.Element, psudo string, prop string) (*js.Object, error)
- func GetComputedStyleValueWith(css *dom.CSSStyleDeclaration, prop string) (*js.Object, error)
- func GetProp(o *js.Object, prop string) (*js.Object, error)
- func GetShadowRoot(elem dom.Node) (dom.DocumentFragment, bool)
- func HasShadowRoot(elem dom.Node) bool
- func IsMatrix(data string) bool
- func IsPerspective(data string) bool
- func IsRotation(data string) bool
- func IsScale(data string) bool
- func IsSimpleRotation(data string) bool
- func IsSkew(data string) bool
- func IsTranslation(data string) bool
- func MatchProp(o *js.Object, prop string, val string) bool
- func Offset(elem dom.Element) (float64, float64)
- func OffsetParent(elem dom.Element) *js.Object
- func PageBox() (float64, float64)
- func Position(elem dom.Element) (float64, float64)
- func RemoveComputedStyleValue(css *dom.CSSStyleDeclaration, prop string)
- func RootElement(elem dom.Node) dom.Node
- func ShadowRootDocument(elem dom.Node) dom.DocumentFragment
- func Unit(u string) string
- func Vendorize(u string) []string
- func Window() dom.Window
- type ComputedStyle
- type ComputedStyleMap
- type CurvePoint
- type Matrix
- type Perspective
- type Pointer
- type Rotation
- type SVGConfig
- type SVGPathEaser
- type Scale
- type Skew
- type Translation
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("Not found")
ErrNotFound returns when an item is not found.
Functions ¶
func BoundingBox ¶
BoundingBox returns the top,right,down,left corners of a dom.Element.
func GetComputedStyle ¶
GetComputedStyle returns the dom.Element computed css styles.
func GetComputedStylePriority ¶
func GetComputedStylePriority(css *dom.CSSStyleDeclaration, prop string) (int, error)
GetComputedStylePriority retrieves the proritiy of the property from the computed style object.
func GetComputedStyleValue ¶
GetComputedStyleValue retrieves the value of the property from the computed style object.
func GetComputedStyleValueWith ¶
GetComputedStyleValueWith usings the CSSStyleDeclaration to retrieves the value of the property from the computed style object.
func GetShadowRoot ¶
func GetShadowRoot(elem dom.Node) (dom.DocumentFragment, bool)
GetShadowRoot retrieves the shadowRoot connected to the pass dom.Node, else returns false as the second argument if the node has no shadowRoot.
func HasShadowRoot ¶
HasShadowRoot returns true/false if the element type matches the [object shadowRoot].
func IsPerspective ¶
IsPerspective checks wether the giving string is a css perspective directive.
func IsRotation ¶
IsRotation checks wether the giving string is a css rotation directive.
func IsSimpleRotation ¶
IsSimpleRotation checks wether the giving string is a css rotation directive.
func IsTranslation ¶
IsTranslation checks wether the giving string is a css translation directive.
func MatchProp ¶
MatchProp matches the string value from a property val against a provided expected value.
func OffsetParent ¶
OffsetParent returns the offset parent element for a specific element.
func RemoveComputedStyleValue ¶
func RemoveComputedStyleValue(css *dom.CSSStyleDeclaration, prop string)
RemoveComputedStyleValue removes the value of the property from the computed style object.
func RootElement ¶
RootElement returns the root parent element that for the provided element.
func ShadowRootDocument ¶
func ShadowRootDocument(elem dom.Node) dom.DocumentFragment
ShadowRootDocument returns the DocumentFragment interface for the provided shadowRoot.
func Unit ¶
Unit returns a valid unit type in the browser, if the supplied unit is standard then it is return else 'px' is returned as default.
Types ¶
type ComputedStyle ¶
type ComputedStyle struct { Name string VendorName string Value string Values []string Priority bool // values between [0,1] to indicate use of '!important' }
ComputedStyle defines a style property item.
type ComputedStyleMap ¶
type ComputedStyleMap map[string]ComputedStyle
ComputedStyleMap defines a map type of computed style properties and values.
func GetComputedStyleMap ¶
func GetComputedStyleMap(elem dom.Element, ps string) (ComputedStyleMap, error)
GetComputedStyleMap returns a map of computed style properties and values. Also all vendored names are cleaned up to allow quick and easy access regardless of vendor.
func (ComputedStyleMap) Get ¶
func (c ComputedStyleMap) Get(name string) (ComputedStyle, error)
Get retrieves the specific property if it exists.
func (ComputedStyleMap) Has ¶
func (c ComputedStyleMap) Has(name string) bool
Has returns true/false if the property exists.
type CurvePoint ¶
type CurvePoint struct { Length int X float64 Y float64 Xd float64 Yd float64 SampleProgress float64 }
CurvePoint defines a area along a svg path for a specific progress and x value.
type Matrix ¶
type Matrix struct { ScaleX float64 RotationX float64 ScaleY float64 RotationY float64 PositionX float64 PositionY float64 PositionZ float64 ScaleZ float64 RotationZ float64 }
Matrix defines a transformation matrix generated from a transform directive.
func ToMatrix2D ¶
ToMatrix2D returns a matrix from the provided data (eg matrix(0,1,0,1,3,4)) else returns an error.
type Perspective ¶
type Perspective struct {
Range float64
}
Perspective provides a structure for storing current perspective data.
func ToPerspective ¶
func ToPerspective(data string) (*Perspective, error)
ToPerspective returns the translation from the giving string else returns an error if it failed.
type Rotation ¶
type Rotation struct {
Angle float64
}
Rotation defines the concrete representation of the css3 skew transform property.
func ToRotation ¶
ToRotation returns the rotation from the giving string else returns an error if it failed.
type SVGConfig ¶
SVGConfig defines a configuration object for the SVGPathEaser. WARNING: Requires to be loaded within the dom.
type SVGPathEaser ¶
type SVGPathEaser struct {
// contains filtered or unexported fields
}
SVGPathEaser defines a easing provider using SVG Paths.
func NewSVGPathEaser ¶
func NewSVGPathEaser(conf SVGConfig) *SVGPathEaser
NewSVGPathEaser returns a new instance of the SVGPathEaser.
func (*SVGPathEaser) Ease ¶
func (svg *SVGPathEaser) Ease(t float64) float64
Ease returns the giving value of t(time) within the giving svg sample.
func (*SVGPathEaser) Sample ¶
func (svg *SVGPathEaser) Sample(t float64) (CurvePoint, bool)
Sample for the giving t value between 0..1, we return a CurvePoint that is either at that range or within that specified range. Also returns a bool whether it was a success or failure.
type Translation ¶
Translation defines the concrete representation of the css3 translation transform property.
func ToTranslation ¶
func ToTranslation(data string) (*Translation, error)
ToTranslation returns the translation from the giving string else returns an error if it failed.