web
#
1. Importing pluginYou can directly import plugin into your project. File structure like below. There is sample html file (index.html) that plugin imported.
- Plugin/
- static/
- css/
- js/
- image/
- view.html
- static/
- index.html
#
2. StructureBasically we need one iframe and color buttons. Any design can be created. View html is can be edit and icons and styles can be modified.
iframe takes least three arguments. Id is used to reach functions with js. Src
is a view html file path. And onload
is a function that run after page is loaded. API Key must be provided after page load unless it is not worked. Also the initial color must be set.
Hex code is used to apply nail polish. You must create function like applyColor(hex_color)
. This function will be used on color button clicked.
<button value="#008080" style="background-color: #008080; border: 2px solid white; width: 4em; height: 4em;" onclick="applyColor(this.value);"></button>
#
3. FunctionsPlugin can be integrated only 3 functions. Plugin functions are used with below command. document.getElementById('nailpolishView').contentWindow.function_name()
Will be used on iframe load
void set_api_key(String API_KEY);
void set_initial_color(String HexCode)
Will be used on color selection
void applyColorNailPolish(String HexCode)
#
Plugin filesMail us to to get plugin files and api-key. You can get contact from [email protected]