picture

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Picture

type Picture struct {
	*tinydom.Element
	// contains filtered or unexported fields
}

Picture is the html5 picture element See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture for reference

func New

func New(image *img.Img, sources ...*Source) *Picture

New creates a new instance of Picture image is the path to the image sources are the different image type sources

func (*Picture) AppendSources

func (p *Picture) AppendSources(sources ...*Source) *Picture

func (*Picture) Sources

func (p *Picture) Sources() []*Source

type Source

type Source struct {
	*tinydom.Element
}

Source is a html5 source element See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source for reference

func FromSourceElement

func FromSourceElement(element *tinydom.Element) *Source

FromSourceElement creates a new Source based on the given element

func NewSource

func NewSource() *Source

New creates a new instance of Source

func (*Source) Media

func (s *Source) Media() (bool, string)

func (*Source) SetMedia

func (s *Source) SetMedia(value string) *Source

func (*Source) SetSizes

func (s *Source) SetSizes(value ...string) *Source

func (*Source) SetSrcSet

func (s *Source) SetSrcSet(value string) *Source

func (*Source) SetType

func (s *Source) SetType(mimetype string) *Source

func (*Source) Sizes

func (s *Source) Sizes() (bool, string)

func (*Source) SrcSet

func (s *Source) SrcSet() (bool, string)

func (*Source) Type

func (s *Source) Type() (bool, string)

Jump to

Keyboard shortcuts

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