-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
website - more icon options added + icons updated
- button added to switch settings and display of buttons changed - option to change icon font size added - option to change icon size added - bootstrap icons updated - tabler icons updated to always use the latest version
- Loading branch information
Showing
2 changed files
with
128 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
<!-- Font Awesome --> | ||
<link rel="stylesheet" type="text/css" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> | ||
<link rel="stylesheet" type="text/css" | ||
<link rel="stylesheet" type="text/css" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
|
||
<!-- Simple Line Icons --> | ||
|
@@ -26,15 +26,14 @@ | |
crossorigin="anonymous" /> | ||
|
||
<!-- Bootstrap Icons--> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" | ||
as="stylesheet" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" as="stylesheet" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
|
||
<!-- Remix Icons--> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/fonts/remixicon.css" rel="stylesheet"> | ||
|
||
<!-- Tabler Icons --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons@1.63.0/iconfont/tabler-icons.min.css"> | ||
<link rel="stylesheet" href="https://unpkg.com/@tabler/icons@latest/iconfont/tabler-icons.min.css"> | ||
|
||
<!-- Weather Icons--> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.12/css/weather-icons.min.css" rel="stylesheet"> | ||
|
@@ -56,16 +55,24 @@ | |
let icon = new IBO_ICON({ | ||
'font_color': document.getElementById('iconFontColor').value, | ||
'font_family': document.getElementById('iconSet').value, | ||
'font_size': document.getElementById('iconFontSizeValue').value, | ||
'icon_background': document.getElementById('iconBackgroundColor').value, | ||
'icon_class': document.getElementById('iconClass').value, | ||
'icon_width': document.getElementById('iconSizeValue').value, | ||
'odoo_version': document.getElementById('odooVersion').value, | ||
}); | ||
icon.draw("icon"); | ||
} | ||
|
||
function toggle_settings() { | ||
document.querySelectorAll('.settings-card').forEach(function (element) { | ||
element.classList.toggle('deactivated'); | ||
}); | ||
} | ||
|
||
function download() { | ||
var image = document.getElementsByClassName('ibo-icon-canvas')[0].toDataURL("image/png").replace("image/png", "image/octet-stream"); | ||
document.getElementById("download").setAttribute("href", image); | ||
let image = document.getElementsByClassName('ibo-icon-canvas')[0].toDataURL("image/png").replace("image/png", "image/octet-stream"); | ||
document.getElementById('download').setAttribute('href', image); | ||
} | ||
|
||
function populateIconSetWebsite() { | ||
|
@@ -133,7 +140,8 @@ <h1>IBO - Icon Builder for Odoo</h1> | |
|
||
<div class="container"> | ||
<div class="row row-center"> | ||
<div class="column align-center"> | ||
<div class="column align-center settings-card front"> | ||
|
||
<div class="row"> | ||
<div class="column column-center"> | ||
<label for="odooVersion">Odoo Version</label> | ||
|
@@ -168,8 +176,9 @@ <h1>IBO - Icon Builder for Odoo</h1> | |
</div> | ||
|
||
<div class="column"> | ||
<a href="https://fontawesome.com/v5/search?m=free&s=solid%2Cregular" id="iconSetWebsite" class="button button-outline" target="_blank"> | ||
<i class="fas fa-globe-europe"></i> | ||
<a href="https://fontawesome.com/v5/search?m=free&s=solid%2Cregular" id="iconSetWebsite" | ||
class="button button-outline" target="_blank"> | ||
<i class="fas fa-globe-europe button-icon"></i> | ||
</a> | ||
</div> | ||
</div> | ||
|
@@ -183,6 +192,40 @@ <h1>IBO - Icon Builder for Odoo</h1> | |
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="column column-center"> | ||
<label for="iconBackgroundColor">Icon Background Color</label> | ||
</div> | ||
<div class="column"> | ||
<input type="color" onchange="clickColor(0, -1, -1, 5)" value="#9b4dca" | ||
id="iconBackgroundColor"> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="column align-right"> | ||
|
||
<button class="button button-outline" type="submit" value="Switch Settings" onclick="toggle_settings()"> | ||
<i class="fas fa-sliders-h button-icon"></i> | ||
</button> | ||
|
||
<button class="button button-outline" type="submit" value="Generate" onclick="generate()"> | ||
<i class="fas fa-play button-icon"></i> | ||
</button> | ||
|
||
<a id="download" download="odoo_icon.png"> | ||
<button type="submit" value="Download" onclick="download()"> | ||
Download | ||
</button> | ||
</a> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="column align-center settings-card back deactivated"> | ||
|
||
<div class="row"> | ||
<div class="column column-center"> | ||
<label for="iconFontColor">Icon Font Color</label> | ||
|
@@ -193,24 +236,63 @@ <h1>IBO - Icon Builder for Odoo</h1> | |
</div> | ||
|
||
<div class="row"> | ||
|
||
<div class="column column-center"> | ||
<label for="iconBackgroundColor">Icon Background Color</label> | ||
<label for="iconSize">Icon Font Size</label> | ||
</div> | ||
<div class="column"> | ||
<input type="color" onchange="clickColor(0, -1, -1, 5)" value="#9b4dca" | ||
id="iconBackgroundColor"> | ||
<div class="row" id="iconSize"> | ||
<div class="column column-center"> | ||
<input id="iconSizeSlider" type="range" value="300" min="100" max="800" oninput="document.getElementById('iconSizeValue').value = this.value"> | ||
</div> | ||
<div class="column column-center"> | ||
<input id="iconSizeValue" type="text" value="300"> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="row"> | ||
<div class="column column-center"> | ||
<label for="iconFontSize">Icon Font Size</label> | ||
</div> | ||
<div class="column"> | ||
<div class="row" id="iconFontSize"> | ||
<div class="column column-center"> | ||
<input id="iconFontSizeSlider" type="range" value="150" min="00" max="800" oninput="document.getElementById('iconFontSizeValue').value = this.value"> | ||
</div> | ||
<div class="column column-center"> | ||
<input id="iconFontSizeValue" type="text" value="150"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- placeholder --> | ||
<div class="row"> | ||
<div class="column"> | ||
<input type="text" class="visibility-hidden"> | ||
</div> | ||
<div class="column align-center"> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="column align-right"> | ||
|
||
<button class="button button-outline" type="submit" value="Switch Settings" onclick="toggle_settings()"> | ||
<i class="fas fa-sliders-h button-icon"></i> | ||
</button> | ||
|
||
<button class="button button-outline" type="submit" value="Generate" onclick="generate()"> | ||
<i class="fas fa-play button-icon"></i> | ||
</button> | ||
|
||
<a id="download" download="odoo_icon.png"> | ||
<button class="button" type="submit" value="Download" onclick="download()">Download</button> | ||
<button type="submit" value="Download" onclick="download()"> | ||
Download | ||
</button> | ||
</a> | ||
<input class="button button-outline" type="submit" value="Generate" onclick="generate()"> | ||
|
||
</div> | ||
</div> | ||
|
||
|
@@ -238,7 +320,8 @@ <h2>Documentation</h2> | |
To set an icon you have to find and enter the corresponding css class. | ||
Please check the corresponding page of the icon set for this purpose: | ||
<ul> | ||
<li><a href="https://fontawesome.com/v5/search?m=free&s=solid%2Cregular">Font Awesome 5 Solid & Regular</a></li> | ||
<li><a href="https://fontawesome.com/v5/search?m=free&s=solid%2Cregular">Font Awesome 5 Solid & | ||
Regular</a></li> | ||
<li><a href="https://fontawesome.com/v5/search?m=free&s=brands">Font Awesome 5 Brands</a></li> | ||
<li><a href="https://fontawesome.com/v4/icons/">Font Awesome 4.7</a></li> | ||
<li><a href="https://icons.getbootstrap.com/">Bootstrap Icons</a></li> | ||
|
@@ -352,7 +435,8 @@ <h3>Parameter</h3> | |
<td>icon_class</td> | ||
<td>e.g. "fas fa-address-card"</td> | ||
<td>CSS class name of your symbol for the icon, the class will automatically try to find | ||
the corresponding unicode. If an unicode (parameter "icon_text") is set the class will be ignored.</td> | ||
the corresponding unicode. If an unicode (parameter "icon_text") is set the class will | ||
be ignored.</td> | ||
</tr> | ||
<tr> | ||
<td>icon_text</td> | ||
|