An online software to design custom balloon structure
main.js: This contains all the event listeners and adds interactivity and functionality to the html page
* @function
* @name handleBtns
* @param {HTMLInputElement} btn The button to activate or disable
* @param {boolean} activate what to do with the button, true means to activate it
Function for activating or disabling buttons in the structure section based on structure selected
(contains options like adding rows, inflate balloons etc)
* @function
* @name setBtns
* @param {string} structure The structure whose buttons will be set
add some styling to show which section is selcted from the topbar(struttura,colori etc)
* Determines if a color code represents a dark or light color
* @function
* @name lightOrDark
* @param {string} color - The color code value of an element's color or background color
* @returns {string} color is light or dark
technical function to get "hsl" values from hex color codes
technical function to convert "rgb" color code to "hex" code
technical function to convert HSL values to HEX
* creates a color scheme for the selected color
* @function
* @name createColorScheme
* @params {string} color - Hex color code
Changing the value of the element with class name "selectedColor" whenever
someone picks a color from the color input field.
Updating recent color section whenever a new color is selected
when a new initial color is selected updating the colorwheel and adding it to
the recent color section
- eventlistener to the clean grid(pulisci griglia) btn
Removing all selected balloons(the balloons whose has been colored earlier)
function enableRicalcaBtnsActivity(balloonStructureContainer, balloonStructureBackground) [line 409 - 466]:
- adding eventlistener to all the btns in Ricalca functions with desired functionality added
Changing the shape and position of the balloon structure background image
Displaying uploaded image in Ricalca Section
Updating precision slider[Precisione movimento] value when the slider is moved
All the functionalities for Sfondo Section
Add row and Add Column btns eventlistner
Function for activating or disabling any button
* @function
* @name disableBtns
* @param {string} structure The structure whose buttons will be set
* @param {string} id id of the delete button
eventlisnter for coloring/decoloring balloons creating box on drag
eventlistener for row gap and column gap btns
eventlistener for inflate and deflate balloon btns
resetting structure on row gap or column gap state change
Change the dimension values when size and structure changes
resetting everything including size select dropdown when a new strcture is selected
* line 958: eventlistener to structure selecting dropdown(on change calls setStructure function)
* line 962: eventlistener to window(on resize calls setStructure function)
eventlisnter to size selection dropdown
functionalities for printing the design
utility function for converting svg image to png format
salva section functionalities
Update(Refresh) new balloon design in the background(In Sfondo Section)
Dimensioni(In struttura section) eventlisteners and functionalities
delete row and delete column eventlisters to the respected buttons
create-design.js: This creates the designs based on the structure selected and handle all balloon selection related events
all the variables to add or handle events(functionalities) to the balloons.
called when clicked on a row for deleting it(row delete enabled state)
called when clicked on a column for deleting it(column delete enabled state)
Triggered when a balloon is selected
* handle selection of balloons and add events to the selected balloon
* @function
* @name handleBalloons
* @param {Element} container - SVG Container element
* @param {Element} element - SVG element(Balloon)
call to handle coloring or decoloring of multiple balloons by creating box(Attiva colorazione ad area enabled)
Adds mouse events to the structure to handle selection
* line 301 - 323 => mousedown event - starting selection related activity with mouse based on which functionality is
choosen from Modifica griglia or palloncini
* line 325 - 356 => mousemove event - creating box to color or decolor balloons(Attiva colorazione ad area enabled)
* line 359 - 373 => mouseup event - ending all selection related activites with mouse
Sets all the attributes for a svg element
* @function
* @name setBalloons
* @param {Element} container - The svg element
* @param {Element} element - The svg circle element(Balloon)
This will create design of balloons based on Duplet Square structure
* @function
* @name createDupletSquare
* @param {number} row number of rows
* @param {number} column number of columns
This will create design of balloons based on Alternate Square pack structure
* @function
* @name createAlternateSquarePack
* @param {number} row number of rows
* @param {number} column number of columns
This will create design of balloons based on Gridz/Gridz Alternate Horizontal/Gridz Alternate Vertical structure
* @function
* @name createGridz
* @param {String} structure structure of the design
* @param {number} row number of rows
* @param {number} column number of columns
This will create design of balloons based on Six Inch Grid structure
* @function
* @name createSixInGrid
* @param {number} row number of rows
* @param {number} column number of columns
This will create design of balloons based on column structure
* @function
* @name createColumn
* @param {number} row number of rows
This will create design of balloons based on Twelve Inch Grid structure
* @function
* @name createTwelveInGrid
* @param {number} row number of rows
* @param {number} column number of columns
This will create design of balloons based on Twelve Inch X Pattern structure
* @function
* @name createTwelveInXPattern
* @param {number} row number of rows
* @param {number} column number of columns
This will create an Arch of balloons
* @function
* @name createArch
This will create design of balloons based on specific structure and size
* @function
* @name createDesign
* @param {string} structure structure of the balloons' deisgn
functions.js: This file will contain all the utility functions and variables to create designs of balloon
Utility variables
* sizes [line 5] => An object containing arrays for size options for different structures
* dimensions [line 19] => Contains width of each column and height of each row for standard size(initial)
of balloons for all structures
* balloonsInfo [line 62] => Contains information about types of balloons and amount to multiply per each
balloon of different types for different structures
* structureInfo [line 166] => Contains the information about the current structure
* selectedBalloons [line 182] => containing infos of the selected and not selected balloons
add information of newly added row to the selectedBalloons object
add information of newly added column to the selectedBalloons object
change information for newly removed row from the selectedBalloons object
change information for newly removed column from the selectedBalloons object
Create rows of table in information section
Creates balloon information table and inserts it in the information section
adds the information of the selected balloon to the selectedBalloons object
removes the information of the unselected balloon to the selectedBalloons object
sets the initial common values for all the structure
Sets all the attributes for a SVG element
Common attributes for all the SVG element
create and return a SVG Ellipse element
create and return overlay balloon
create and return a SVG ellipse balloonTop for selected balloons
create overlay balloons when updating the structure
create and return a SVG ellipse balloonTop for selected balloons