You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every DOM element is represented by an object in array like the example below.
/* Flash(siteStructure [array], domElement [HTMLElement]) the second argument is optional (if not specified is body) or if declared could be a string (element id) or HTMLElement after that you can get callback with then method and use it to update dom*/newFlash([{}]).then((scope)=>{scope.find("elementId").html="Hello Flash";//find elementId inside dom and change his html})
Inside the object you can add others by two properties:
html [string] (equivalent to HTMLElement.innerHTML)
childs [array] (equivalent to HTMLElement.appendChild)
creating any html element
newFlash([{},//this is equivalent to <div></div>,{tag: "input"//this is equivalent to <input/>}])
childs property
newFlash([{childs: [{},// first div{}// second div]}])
Flash has different properties you can use as html attributes.
All properties are optional. By defaul property tag value is div.
Special properties
not visible in the elements structure inside inspector
Property Name
Value Typeof
tag
string
html
string
childs
array
hover
object
focus
object
active
object
Standard properties
depends on tag you would to create
Property Name
Value Typeof
Note
id
string
if not declared it is auto generated
style
string or animation object
type
string
width
string or number
reserved to table, img, ...
height
string or number
reserved to table, img, ...
onclick
string
onkeyup
string
...
Reserved* property
not visible in the elements structure (inside inspector)
Property Name
Value Typeof
element
HTMLElement
parent
object
*Flash has a global object that returns after then method called globalScope where you retreive each object with element property that contains the real HTMLElement and his parent object
/* set initial document parameters as title and style*/constF=newFlash([
...
]);F.init({title: "Flash Page",//document.title changedstyle: {backgroundColor: "red"//document stylized}})
Flash.prettify()
/* you can use FlashPrettify() or __p() stylize and removes margins from the document body*/constF=newFlash([
...
]);F.prettify()
SCOPE
FIND
/* you can use scope.find(#id) to find object and realtime change DOM Elements*/newFlash([{id: "test",html: "Hello World"}]).then((scope)=>{scope.find("test").html="Hello Flash"})
returns an object that contains element based on ID with self and parent properties inside scope
FIND BY
/* you can use scope.findBy(property,name) to find object and realtime change DOM Elements*/newFlash([{tag: "button",html: "don't click me"{tag: "button",html: "click me"}]).then((scope)=>{console.log(scope.findBy("tag","button"))//return [{...button1},{...button2}]})
QUERY
/* you can use scope.query(element) to find objects list and realtime change DOM Elements*/newFlash([{class: "main",html: "don't search me!"childs: [{id: "find-1"},{id: "find-2"}]{]).then((scope)=>{console.log(scope.query(".main #find-1"))//return [{...find-1}]})
returns an objects array of elements based on ID with self and parent properties inside scope
METHODS
Two methods allow you to compile faster your HTML page
FlashConcat
// you can use FlashConcat() or __c()constSTYLE={div: {color: "#f00",backgroundColor: "#000"}}newFlash([{style: FlashConcat(STYLE.div,{height: 100})}])
merge two or more objects. You can use it for styles, elements and others.
FlashTransform
/* you can use FlashTransform() or __t() FlashTransform ( htmlQueryReference [string], movementsObject [object], // the property must be composed by numeric array [start,stop] duration [number], // (optional) milliseconds callback [function] // (optional) ) */FlashTransform("#someId",{scale: [0,2],translateX: [100,500]},1000,()=>{alert("Wow! transformation complete.")})
provide to animate HTMLElements by style transformation
FlashModule
/* you can use FlashModule("path/to/file") or __m("path/to/file") just inside the server to include synchronously any external json file*/{tag: "input",style: FlashModule("path/to/file"))}
returns an external json object
FlashInclude
/* you can use FlashInclude("path/to/file") or __i("path/to/file") just inside the server to include synchronously any external javascript file*/FlashInclude("path/to/file"))