css

package
v0.0.0-...-a8ee3e7 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KCssListNameNotFound = "html.CssToggle().error: css list name not found:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

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

Class

English:

Allows you to easily change the cc of an HTML element

 Exemplo:
   var class = new(css.Class)
   // Create a css list named "red" with value "user red"
   class.SetList("red", "user", "red").
     // Create a css list named "yellow" with value "user yellow"
     SetList("yellow", "user", "yellow").
     // Create a css list named "user" with value "user"
     SetList("user", "user").
     // Defines that the "red" and "yellow" lists will change every second
     ToggleTime(time.Second, "red", "yellow").
     // Limit trades to 10 interactions
     ToggleLoop(10).
     // Defines the list named "norm" as the active list at the end of interactions
     OnLoopEnd("user").
     // Start interactions. Caution: they only work after being added to the element
     ToggleStart()

   var a html.Div
   // Create a div with id "example_A";
   a.NewDiv("example_A").
     // Sets css to be "name_a name_b name_N";
     Css("name_a", "name_b", "name_N").
     // Adds the div to the element id "stage".
     AppendById("stage")

   var b html.Div
   // Create a div with id "example_B";
   b.NewDiv("example_B").
     // Sets css to be "name_a name_b name_N";
     Css("name_a", "name_b", "name_N").
     // css.Class cannot work properly before being added, due to lack of reference to the parent
     // object.
     SetCssController(class).
     // Adds the div to the element id "stage".
     AppendById("stage")

Português:

Permite alterar o cc de um elemento HTML de forma fácil

 Exemplo:
   var class = new(css.Class)
   // Crie uma lista css de nome "red" com o valor "user red"
   class.SetList("red", "user", "red").
     // Crie uma lista css de nome "yellow" com o valor "user yellow"
     SetList("yellow", "user", "yellow").
     // Crie uma lista css de nome "user" com o valor "user"
     SetList("user", "user").
     // Define que as listas "red" e "yellow" vão trocar a cada segundo
     ToggleTime(time.Second, "red", "yellow").
     // Limita as trocas em 10 interações
     ToggleLoop(10).
     // Define  alista de nome "normal" como sendo a lista ativa ao final das interações
     OnLoopEnd("user").
     // Inicia as interações. Cuidado: elas só funcionam após serem adicionadas ao elemento
     ToggleStart()

   var a html.Div
   // Cria uma div de id "example_A";
   a.NewDiv("example_A").
     // Define css como sendo "name_a name_b name_N";
     Css("name_a", "name_b", "name_N").
     // Adds the div to the element id "stage".
     // Adiciona a div ao elemento de id "stage".
     AppendById("stage")

   var b html.Div
   // Cria uma div de id "example_B";
   b.NewDiv("example_B").
     // Define css como sendo "name_a name_b name_N";
     Css("name_a", "name_b", "name_N").
     // css.Class não consegue funcionar corretamente antes de ser adicionada, por falta de
     // referência do objeto pai.
     SetCssController(class).
     // Adiciona a div ao elemento de id "stage".
     AppendById("stage")

func (*Class) AddToList

func (e *Class) AddToList(name, class string) (ref *Class)

AddToList

English:

Add a class name to given list of classes.

 Input:
   name: name of the class list;
   class: name of the class to be added.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Adiciona o nome de uma classe a uma determinada lista de classes.

 Entrada:
   name: nome da lista de classes;
   class: nome da classe a ser adicionada.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) DeleteList

func (e *Class) DeleteList(name string) (ref *Class)

DeleteList

English:

Removes a list of classes.

 Input:
   name: name of the list of classes to be removed.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Remove uma lista de classes.

 Entrada:
   name: nome da lista de classes a ser removida.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) OnLoopEnd

func (e *Class) OnLoopEnd(name string) (ref *Class)

OnLoopEnd

English:

Defines the name of the css list to be used at the end of the loop.

 Input:
   name: css list name.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Define o nome da lista css a ser usada no final do loop.

 Entrada:
   name: nome da lista css.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) Remove

func (e *Class) Remove()

Remove

English:

This function must be called when the object is removed.

Português:

Esta função deve ser chamada quando o objeto for removido.

func (*Class) RemoveFromList

func (e *Class) RemoveFromList(name, class string) (ref *Class)

RemoveFromList

English:

Removes a class name from a given list of classes.

 Input:
   name: name of the class list;
   class: name of the class to be removed.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Remove o nome de uma classe de uma determinada lista de classes.

 Entrada:
   name: nome da lista de classes;
   class: nome da classe a ser removida.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) SetList

func (e *Class) SetList(name string, classes ...string) (ref *Class)

SetList

English:

Adds a new list of css classes.

 Input:
   name: css list name;
   classes: css class list.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Adiciona uma nova lista de classes css.

 Entrada:
   name: nome da lista css;
   classes: lista de classes css.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) SetOnLoopEndFunc

func (e *Class) SetOnLoopEndFunc(f func(listName string)) (ref *Class)

SetOnLoopEndFunc

English:

Defines the function to be executed at the end of interactions

 Input:
   f: function to be executed at the end of interactions.
     listName: current list name.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Define a função a ser executada ao fim das interações

 Entrada:
   f: função a ser executada ao fim das interações.
     listName: nome da lista atual.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) SetOnToggleFunc

func (e *Class) SetOnToggleFunc(f func(listName string)) (ref *Class)

SetOnToggleFunc

English:

Defines the function to be performed at each iteration.

 Input:
   f: function to be executed at each iteration.
     listName: current list name.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Define a função a ser executada a cada interação.

 Entrada:
   f: função a ser executada a cada interação.
     listName: nome da lista atual.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) SetRef

func (e *Class) SetRef(id string, refElement *js.Value) (ref *Class)

SetRef

English:

References the parent object.

 Input:
   id: parent object id.
   refElement: object reference.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Referencia o objeto pai.

 Entrada:
   id: id do objeto pai.
   refElement: referência do objeto.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (Class) String

func (e Class) String() (list string)

String

Português:

Converte a lista ativa em string.

func (*Class) Toggle

func (e *Class) Toggle(name string) (ref *Class)

Toggle

English:

Swap the element's css list of classes.

 Entrada:
   name: name of the list of classes to use.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

Português:

Troca a lista de classes css do elemento.

 Entrada:
   name: nome da lista de classes a ser usada.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

func (*Class) ToggleList

func (e *Class) ToggleList(list ...string) (ref *Class)

ToggleList

English:

Defines a new list.

 Input:
   name: names of the lists to be used in the toggle.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

Português:

Define uma nova lista.

 Entrada:
   list: nome das listas a serem usadas na trocas.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

func (*Class) ToggleLoop

func (e *Class) ToggleLoop(loop int) (ref *Class)

ToggleLoop

English:

Defines a finite number of interactions.

 Input:
   loop: number of interactions.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Define um número finito de interações.

 Entrada:
   loop: número de interações.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) ToggleStart

func (e *Class) ToggleStart() (ref *Class)

ToggleStart

English:

Start css class toggle functionality.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Reinicializa a funcionalidade de troca de classes css após usar a função CssToggleStop().

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) ToggleStartInterval

func (e *Class) ToggleStartInterval(interval time.Duration) (ref *Class)

ToggleStartInterval

English:

Start css class toggle functionality.

 Entrada:
   interval: intervalo de tempo entre as trocas.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Reinicializa a funcionalidade de troca de classes css após usar a função CssToggleStop().

 Entrada:
   interval: intervalo de tempo entre as trocas.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) ToggleStop

func (e *Class) ToggleStop() (ref *Class)

ToggleStop

English:

Breaks the toggle loop between css classes.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of <... css="name1 name2 nameN">

Português:

Interrompe o laço de trocas entre classes css.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a <... css="name1 name2 nameN">

func (*Class) ToggleTime

func (e *Class) ToggleTime(interval time.Duration, list ...string) (ref *Class)

ToggleTime

English:

Swap the element's css list of classes.

 Input:
   interval: time interval between toggle;
   name: names of the lists to be used in the toggle.

 Note:
   * This function is equivalent to html.SetList("current", classes...)
   * Css has a feature that allows you to easily change the list of css classes of an html tag,
     with the functions SetList(), CssToggle() and CssToggleTime();
   * Is the equivalent of:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

Português:

Troca a lista de classes css do elemento.

 Entrada:
   interval: intervalo de tempo entre as trocas;
   list: nome das listas a serem usadas na trocas.

 Nota:
   * Esta função equivale a SetList("current", classes...);
   * Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
     fácil, com as funções SetList(), CssToggle() e CssToggleTime();
   * Equivale a:
       <... css="name1 name2 nameN">
       var element = document.getElementById("myDIV");
       element.classList.toggle("myStyle");

Jump to

Keyboard shortcuts

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