⇠ Go back to GitHub repository
Overview
- SVGBigHeadsElement ⇐
HTMLElement - SVGBigHeadsPartElement ⇐
HTMLElement
- colors
Dictionary of all editable colors (in the form
--bigheads-color-${name}) with default values
- data :
object℗ - style_global :
object℗ - avatar_svg :
object℗
- parts_dictionary :
_JSON_parts All values are _JSON_Tarray
- createElement :
__createElementNS℗ Creates elemnet in svg namespace
- version :
string Library version
- type :
"client"|"server"
- isNotGenderType(candidate) ⇒
boolean - createGroupedElement(els_object) ⇒
GroupedElement℗ - createSVG() ⇒
SVGElement℗ - setHref(element, value) ℗
Sets 'xlink:href' for given element
- createUSE(href) ⇒
SVGUseElement℗ - mixinObservedAttributes(BaseClass, attributes_names) ⇒
HTMLElement℗ Helper for registering
observedAttributesand getters/setters- avatarPartHref(d, type, [name]) ⇒
string℗ - findSafeLayer(d, type) ⇒
SVGUseElement℗ - hairFullConfig(name) ⇒
HairPartsNames℗ Returns filtered non-false parts and with full name as values (eg.
long01-back).- avatarUpdateHair(svg, d) ℗
- nextPartName(part_name, current_name, [shift]) ⇒
string - getFromJSON() ⇒
json℗
- ConfigKeys :
"href"|_JSON_parts_keys℗ - _PreConfig :
object℗ - Data :
object℗ - Config :
_PreConfig|_JSON_config_parts℗ - __createElementNS ⇒
SVGElement|SVGUseElement - GroupedElement :
Object - style_options :
Object Contains options for generating default styles for
<svg-bigheads>. Changes makes sence only before fisrt<svg-bigheads>is created. See style.cerate.- HairPartsNames :
object - _JSON_colors_keys :
"hair"|"clothes"|"hat"|"mouth"|"skin" Final usage of colors are:
--bigheads-color-__color_name__- _JSON_parts_keys :
"glasses"|"breasts"|"eyebrow"|"facialhair"|"hair"|"hat"|"nose"|"base"|"clothes"|"eyes"|"mouth" All svg files options
- _JSON_Tstring :
string - _JSON_Tarray :
Array.<string> - _JSON_Tobject :
object - _JSON_colors :
object - _JSON_parts :
object - _JSON_config_colors :
object - _JSON_config_parts :
object - _JSON_safe_layers_nth :
Array.<_JSON_parts_keys> - _JSON_safe_layers :
_JSON_safe_layers_nth|Array.<_JSON_safe_layers_nth> - json :
object℗
Content
Kind: global class (defined@467)
Extends: HTMLElement
- SVGBigHeadsElement ⇐
HTMLElement- new SVGBigHeadsElement()
- instance
- static
Represents html tag
<svg-bigheads …>, for all possibilities (the '…' part) see ConfigKeys and parts_dictionary.
Kind: instance method of SVGBigHeadsElement (defined@501)
| Param | Type |
|---|---|
| type | ConfigKeys |
Returns html name represantion
Kind: static property of SVGBigHeadsElement (defined@478)
Getter:
Kind: global class (defined@535)
Extends: HTMLElement
Represents html tag
<svg-bigheads-part href="…" type="…" name="…">.
Regenrate html elememnt with the next svg part in parts_dictionary.
Kind: instance method of SVGBigHeadsPartElement (defined@568)
| Param | Type | Default |
|---|---|---|
| shift | numbet |
1 |
Dictionary of all editable colors (in the form
--bigheads-color-${name}) with default values
Kind: global variable (defined@7)
Properties
| Name | Type |
|---|---|
| colors | object |
Kind: global namespace (defined@37)
Access: private
- data :
object℗- .isFromMultiplePieces(name) ⇒
boolean - .isNullable(name) ⇒
boolean - .getNextPartName(part_name, current_name, [shift]) ⇒
string - .get(target) ⇒
Data - .setAttribute(data, name, [value])
- .getAttribute(data, name)
- .hasElement(data, name) ⇒
boolean - .getElement(data, name) ⇒
SVGUseElement|GroupedElement|undefined - .setElement(data, name, el)
- .deleteElement(data, name)
- .isFromMultiplePieces(name) ⇒
Kind: static method of data (defined@46)
| Param | Type |
|---|---|
| name | _JSON_parts_keys |
Kind: static method of data (defined@54)
| Param | Type |
|---|---|
| name | _JSON_parts_keys |
Kind: static method of data (defined@63)
| Param | Type | Default |
|---|---|---|
| part_name | _JSON_parts_keys |
|
| current_name | string |
|
| [shift] | number |
1 |
data.get(target) ⇒ Data
Kind: static method of data (defined@74)
| Param | Type |
|---|---|
| target | SVGBigHeadsElement |
Kind: static method of data (defined@82)
| Param | Type | Default |
|---|---|---|
| data | Data |
|
| name | ConfigKeys |
|
| [value] | string | null |
null |
Kind: static method of data (defined@88)
| Param | Type |
|---|---|
| data | Data |
| name | ConfigKeys |
Kind: static method of data (defined@95)
| Param | Type |
|---|---|
| data | Data |
| name | _JSON_parts_keys |
data.getElement(data, name) ⇒ SVGUseElement | GroupedElement | undefined
Kind: static method of data (defined@102)
| Param | Type |
|---|---|
| data | Data |
| name | _JSON_parts_keys |
Kind: static method of data (defined@109)
| Param | Type |
|---|---|
| data | Data |
| name | _JSON_parts_keys |
| el | SVGUseElement | GroupedElement |
Kind: static method of data (defined@115)
| Param | Type |
|---|---|
| data | Data |
| name | _JSON_parts_keys |
Kind: global namespace (defined@270)
Access: private
- style_global :
object℗
Kind: static property of style_global (defined@276)
Access: public
Properties
| Name | Type |
|---|---|
| options | style_options |
Keeping information the global style was created – see style.cerate
Kind: static property of style_global (defined@283)
Access: private
Properties
| Name | Type | Default |
|---|---|---|
| [is_created] | boolean |
false |
Creates new
<style>inside<head>with default styling of<svg-bigheads>(displays block and size)
Kind: static method of style_global (defined@290)
Access: public
Kind: global namespace (defined@400)
Access: private
- avatar_svg :
object℗- .create(big_heads)
- .get(big_heads)
- .appendUSE(svg, d, name) ⇒
SVGUseElement - .insertAfterUSE(svg, d, name, el) ⇒
SVGUseElement - .remove(big_heads)
Kind: static method of avatar_svg (defined@408)
| Param | Type |
|---|---|
| big_heads | SVGBigHeadsElement |
Kind: static method of avatar_svg (defined@417)
| Param | Type |
|---|---|
| big_heads | SVGBigHeadsElement |
Append
<use>to internal<svg>.
Kind: static method of avatar_svg (defined@426)
| Param | Type |
|---|---|
| svg | SVGElement |
| d | Data |
| name | _JSON_parts_keys |
Insert
<use>to<svg>beforeel.
Kind: static method of avatar_svg (defined@440)
| Param | Type |
|---|---|
| svg | SVGElement |
| d | Data |
| name | _JSON_parts_keys |
| el | SVGUseElement |
Kind: static method of avatar_svg (defined@449)
| Param | Type |
|---|---|
| big_heads | SVGBigHeadsElement |
parts_dictionary : _JSON_parts
All values are _JSON_Tarray
Kind: global constant (defined@165)
createElement : __createElementNS ℗
Creates elemnet in svg namespace
Kind: global constant (defined@191)
Access: private
Library version
Kind: global constant (defined@687)
Kind: global constant (defined@691)
Kind: global function (defined@180)
| Param | Type |
|---|---|
| candidate | _JSON_parts_keys |
createGroupedElement(els_object) ⇒ GroupedElement ℗
Kind: global function (defined@208)
Access: private
| Param | Type |
|---|---|
| els_object | object |
| [els_object.front] | SVGUseElement |
| [els_object.top] | SVGUseElement |
| [els_object.back] | SVGUseElement |
Kind: global function (defined@217)
Access: private
Sets 'xlink:href' for given element
Kind: global function (defined@229)
Access: private
| Param | Type |
|---|---|
| element | SVGUseElement |
| value | String |
Kind: global function (defined@235)
Access: private
| Param | Type |
|---|---|
| href | string |
Helper for registering
observedAttributesand getters/setters
Kind: global function (defined@247)
Access: private
| Param | Type |
|---|---|
| BaseClass | HTMLElement |
| attributes_names | Array.<string> |
Kind: global function (defined@308)
Access: private
| Param | Type | Description |
|---|---|---|
| d | Data |
|
| type | ConfigKeys |
|
| [name] | string |
Defaults to value saved in d |
Kind: global function (defined@322)
Access: private
| Param | Type |
|---|---|
| d | Data |
| type | _JSON_parts_keys |
hairFullConfig(name) ⇒ HairPartsNames ℗
Returns filtered non-false parts and with full name as values (eg.
long01-back).
Kind: global function (defined@354)
Access: private
| Param | Type |
|---|---|
| name | string |
Kind: global function (defined@375)
Access: private
| Param | Type |
|---|---|
| svg | SVGElement |
| d | Data |
Kind: global function (defined@584)
| Param | Type | Default |
|---|---|---|
| part_name | _JSON_parts_keys |
|
| current_name | string |
|
| [shift] | number |
1 |
getFromJSON() ⇒ json ℗
Kind: global function (defined@681)
Access: private
ConfigKeys : "href" | _JSON_parts_keys ℗
Kind: global typedef (defined@10)
Access: private
Kind: global typedef (defined@15)
Access: private
Properties
| Name | Type | Description |
|---|---|---|
| [href] | string |
Target of svg file |
Kind: global typedef (defined@21)
Access: private
Properties
| Name | Type |
|---|---|
| attributes | Config |
| els | Object.<_JSON_parts_keys, (SVGElement|SVGUseElement)> |
Config : _PreConfig | _JSON_config_parts ℗
Kind: global typedef (defined@28)
Access: private
Kind: global typedef (defined@181)
Kind: global typedef (defined@192)
Properties
| Name | Type | Description |
|---|---|---|
| [front] | SVGUseElement |
|
| [top] | SVGUseElement |
|
| [back] | SVGUseElement |
|
| remove | function |
Removes all elements |
Contains options for generating default styles for
<svg-bigheads>. Changes makes sence only before fisrt<svg-bigheads>is created. See style.cerate.
Kind: global typedef (defined@258)
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| [allow] | boolean |
true |
Allow creating global default styles |
| [fit] | string |
"contain" |
CSS fit property of <svg> inside <svg-bigheads> |
| [big_hat] | string |
"bigheads-hat-longhairs" |
Class name for making hat bigger when long hair |
Kind: global typedef (defined@341)
Properties
| Name | Type |
|---|---|
| [front] | string |
| [top] | string |
| [back] | string |
Final usage of colors are:
--bigheads-color-__color_name__
Kind: global typedef (defined@586)
_JSON_parts_keys : "glasses" | "breasts" | "eyebrow" | "facialhair" | "hair" | "hat" | "nose" | "base" | "clothes" | "eyes" | "mouth"
All svg files options
Kind: global typedef (defined@591)
Kind: global typedef (defined@596)
Kind: global typedef (defined@600)
Kind: global typedef (defined@604)
Properties
| Name | Type | Description |
|---|---|---|
| [front] | boolean |
|
| [back] | boolean |
|
| [top] | boolean |
|
| [parent] | string |
The name of hair to be also used |
Kind: global typedef (defined@612)
Properties
| Name | Type |
|---|---|
| hair | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| clothes | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| hat | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| mouth | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| skin | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
Kind: global typedef (defined@621)
Properties
| Name | Type |
|---|---|
| glasses | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| breasts | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| eyebrow | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| facialhair | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| hair | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| hat | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| nose | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| base | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| clothes | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| eyes | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
| mouth | _JSON_Tstring | _JSON_Tarray | _JSON_Tobject |
Kind: global typedef (defined@636)
Properties
| Name | Type | Default |
|---|---|---|
| [hair] | string |
"#d96e27" |
| [clothes] | string |
"#d67070" |
| [hat] | string |
"#5bcaf0" |
| [mouth] | string |
"#dd3e3e" |
| [skin] | string |
"#fdd2b2" |
Kind: global typedef (defined@645)
Properties
| Name | Type | Default |
|---|---|---|
| [glasses] | string |
"none" |
| [breasts] | string |
"none" |
| [eyebrow] | string |
"none" |
| [facialhair] | string |
"none" |
| [hair] | string |
"none" |
| [hat] | string |
"none" |
| [nose] | string |
"none" |
| [base] | string |
"base" |
| [clothes] | string |
"dressshirt" |
| [eyes] | string |
"narrower" |
| [mouth] | string |
"lips" |
_JSON_safe_layers_nth : Array.<_JSON_parts_keys>
Kind: global typedef (defined@660)
_JSON_safe_layers : _JSON_safe_layers_nth | Array.<_JSON_safe_layers_nth>
Kind: global typedef (defined@664)
Kind: global typedef (defined@669)
Access: private
Properties
| Name | Type |
|---|---|
| colors | _JSON_colors |
| parts | _JSON_parts |
| safe_layers | _JSON_safe_layers |