-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from matiasdelellis/nc24
Enable NC24 and update tests..
- Loading branch information
Showing
15 changed files
with
367 additions
and
133 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
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
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.colorPickWrapper { | ||
position: relative; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
#colorPick { | ||
background: #fff; | ||
-webkit-backdrop-filter: blur(15px); | ||
position: absolute; | ||
border-radius: 8px; | ||
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); | ||
padding: 10px; | ||
width: auto; | ||
box-sizing: content-box; | ||
z-index: 2500; | ||
display: flex; | ||
} | ||
|
||
.colorPickButton { | ||
border-radius: 50%; | ||
width: 24px; | ||
height: 24px; | ||
margin: 0px 3px; | ||
cursor: pointer; | ||
display: inline-block; | ||
border: 1px solid rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.colorPickButton:hover { | ||
transform: scale(1.1); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function QnColorPick(parentSelector, onSelectColor) { | ||
|
||
this._parentSelector = parentSelector; | ||
this._onSelectColor = onSelectColor; | ||
|
||
this._color = undefined; | ||
|
||
this._template = '' + | ||
'<div id="colorPickWrapper" class="colorPickWrapper">' + | ||
'<div id="colorPick">' + | ||
'<div class="colorPickButton" hexvalue="#F7EB96" style="background-color:#F7EB96"></div>' + | ||
'<div class="colorPickButton" hexvalue="#88B7E3" style="background-color:#88B7E3"></div>' + | ||
'<div class="colorPickButton" hexvalue="#C1ECB0" style="background-color:#C1ECB0"></div>' + | ||
'<div class="colorPickButton" hexvalue="#BFA6E9" style="background-color:#BFA6E9"></div>' + | ||
'<div class="colorPickButton" hexvalue="#DAF188" style="background-color:#DAF188"></div>' + | ||
'<div class="colorPickButton" hexvalue="#FF96AC" style="background-color:#FF96AC"></div>' + | ||
'<div class="colorPickButton" hexvalue="#FCF66F" style="background-color:#FCF66F"></div>' + | ||
'<div class="colorPickButton" hexvalue="#F2F1EF" style="background-color:#F2F1EF"></div>' + | ||
'<div class="colorPickButton" hexvalue="#C1D756" style="background-color:#C1D756"></div>' + | ||
'<div class="colorPickButton" hexvalue="#CECECE" style="background-color:#CECECE"></div>' + | ||
'</div>' + | ||
'</div>'; | ||
|
||
this.select = function (hexcolor) { | ||
this._color = hexcolor; | ||
} | ||
|
||
this.close = function () { | ||
var picker = document.getElementById("colorPickWrapper"); | ||
picker.remove(); | ||
} | ||
|
||
this.show = function (hexcolor) { | ||
var self = this; | ||
|
||
var parent = document.querySelector(this._parentSelector); | ||
parent.innerHTML += this._template; | ||
|
||
var colors = document.querySelectorAll(".colorPickButton"); | ||
colors.forEach (function(color) { | ||
if (hexcolor == color.getAttribute("hexvalue")) { | ||
color.classList.add("icon-checkmark"); | ||
} | ||
color.addEventListener("click", function () { | ||
self._color = color.getAttribute("hexvalue"); | ||
self._onSelectColor(self._color); | ||
self.close (); | ||
}); | ||
}); | ||
} | ||
|
||
this.isVisible = function () { | ||
var picker = document.getElementById("colorPickWrapper"); | ||
return picker != null; | ||
}; | ||
|
||
this.toggle = function () { | ||
if (this.isVisible()) { | ||
this.close(); | ||
} else { | ||
this.show(this._color); | ||
} | ||
}; | ||
} |
Oops, something went wrong.