-
Notifications
You must be signed in to change notification settings - Fork 119
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 #1953 from xodio/feat-color-picker
Add color picker widget
- Loading branch information
Showing
41 changed files
with
1,276 additions
and
268 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
158 changes: 158 additions & 0 deletions
158
packages/xod-client/src/core/styles/components/ColorPicker.scss
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,158 @@ | ||
.ColorPickerWidget { | ||
width: 220px; | ||
} | ||
.PointingPopup-content .ColorPicker { | ||
&, & * { | ||
@include noselect(); | ||
} | ||
} | ||
.ColorPicker { | ||
width: 220px; | ||
position: relative; | ||
padding: 10px 0; | ||
|
||
.HueCircle { | ||
z-index: 1; | ||
margin: 0 20px; | ||
position: relative; | ||
|
||
& > * { | ||
display: block; | ||
position: absolute; | ||
} | ||
&_area { | ||
background: conic-gradient(from 0deg, red, yellow, lime, aqua, blue, magenta, red); | ||
border-radius: 50%; | ||
z-index: 1; | ||
} | ||
&_inner { | ||
border-radius: 50%; | ||
left: 50%; | ||
top: 50%; | ||
background: $sidebar-color-bg; | ||
z-index: 2; | ||
} | ||
&_pointer { | ||
z-index: 3; | ||
left: 50%; | ||
top: 50%; | ||
|
||
border: 1px solid #fff; | ||
border-radius: 50%; | ||
|
||
cursor: grab; | ||
box-shadow: inset 0 0 2px 1px rgba(0,0,0,.3), 0 1px 2px 1px rgba(0,0,0,.3); | ||
} | ||
} | ||
|
||
&_preview { | ||
z-index: 2; | ||
position: absolute; | ||
border-radius: 50%; | ||
width: 30px; | ||
height: 30px; | ||
|
||
top: 10px; | ||
left: 10px; | ||
} | ||
|
||
.SatLightBox { | ||
z-index: 3; | ||
position: absolute; | ||
overflow: hidden; | ||
border-radius: 5px; | ||
padding: 2px 4px; | ||
box-sizing: border-box; | ||
|
||
// position it inside Hue slider | ||
left: 55px; | ||
top: 65px; | ||
|
||
.SatLightBox_gradients { | ||
position: absolute; | ||
z-index: 1; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
width: 100%; | ||
height: 100%; | ||
|
||
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0)); | ||
background: linear-gradient(to right, #fff, rgba(255,255,255,0)); | ||
|
||
&:before { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
|
||
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0)); | ||
background: linear-gradient(to top, #000, rgba(0,0,0,0)); | ||
} | ||
} | ||
|
||
.SatLightBox_container { | ||
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 2; | ||
} | ||
.SatLightBox_pointer { | ||
position: absolute; | ||
z-index: 2; | ||
|
||
width: 10px; | ||
height: 10px; | ||
|
||
margin-left: -5px; | ||
margin-top: -5px; | ||
|
||
border: 1px solid #fff; | ||
border-radius: 50%; | ||
|
||
cursor: grab; | ||
box-shadow: inset 0 0 2px 1px rgba(0,0,0,.3), 0 1px 2px 1px rgba(0,0,0,.3); | ||
} | ||
} | ||
|
||
.ColorPicker_values { | ||
padding: 10px 20px 0; | ||
overflow: hidden; | ||
|
||
& > div { | ||
clear: both; | ||
margin-bottom: 2px; | ||
} | ||
span { | ||
float: right; | ||
width: 2em; | ||
text-align: left; | ||
} | ||
input { | ||
@include select-text(); | ||
float: right; | ||
width: 40px; | ||
border: 1px solid transparent; | ||
background: none; | ||
text-align: right; | ||
|
||
&:focus, &:hover { | ||
// outline: 1px solid $input-color-border; | ||
border: 1px solid $input-color-border; | ||
border-radius: 2px; | ||
} | ||
} | ||
label { | ||
float: none; | ||
max-width: 120px; | ||
width: 120px; | ||
padding: 1px 0; | ||
} | ||
label, input, span { | ||
color: $chalk; | ||
font-size: $font-size-m; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
} | ||
|
||
.inner-container { | ||
position: relative; | ||
overflow-x: hidden; | ||
overflow-y: scroll; | ||
|
||
|
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
72 changes: 72 additions & 0 deletions
72
packages/xod-client/src/core/styles/components/PointingPopup.scss
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,72 @@ | ||
.PointingPopup { | ||
position: fixed; | ||
z-index: 15; | ||
top: 0; | ||
background: $sidebar-color-bg; | ||
border: 1px solid $chrome-outlines; | ||
border-radius: 5px; | ||
box-shadow: 5px 5px 10px -5px rgba(0,0,0,.5); | ||
|
||
margin-top: -13px; // to point accurately on selected item | ||
|
||
display: flex; | ||
flex-direction: column; | ||
|
||
transition: opacity 0.1s; | ||
|
||
.outer-container, .content-wrapper { | ||
width: auto !important; | ||
} | ||
|
||
&--rightSided { | ||
.pointer { | ||
left: auto !important; | ||
right: -7px; | ||
&:before { | ||
transform: rotate(135deg) !important; | ||
} | ||
} | ||
} | ||
&--hidden { | ||
opacity: 0; | ||
pointer-events: none; | ||
} | ||
|
||
&-content { | ||
display: flex; | ||
flex-grow: 1; | ||
|
||
.PatchDocs { | ||
padding: 12px; | ||
} | ||
|
||
* { user-select: text; } | ||
span { cursor: text; } | ||
} | ||
|
||
.pointer { | ||
position: absolute; | ||
z-index: 2; | ||
left: -7px; | ||
top: 20px; | ||
|
||
&:before { | ||
content: ''; | ||
display: block; | ||
width: 12px; | ||
height: 12px; | ||
|
||
background: $sidebar-color-bg; | ||
border-left: 1px solid $chrome-outlines; | ||
border-top: 1px solid $chrome-outlines; | ||
transform: rotate(-45deg); | ||
} | ||
} | ||
|
||
.no-selection { | ||
color: $sidebar-color-text; | ||
font-size: $font-size-m; | ||
text-align: center; | ||
padding: 10px; | ||
} | ||
} |
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
Oops, something went wrong.