Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/color improvements #181

Merged
merged 9 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement section hiding
  • Loading branch information
Giwayume committed Oct 20, 2020
commit ee4731cb0905f7d82a5c35163084ddc8ceb90031
6 changes: 0 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ <h2 class="trn toggle" data-target="toggle_preview">Preview</h2>

<div class="colors block">
<h2 class="trn toggle" data-target="toggle_colors">Colors</h2>
<input
title="Click to change color"
type="color"
class="color_area"
id="main_color"
value="#0000ff" />
<div class="content" id="toggle_colors"></div>
</div>

Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"hermite-resize": "git+https://github.com/viliusle/Hermite-resize.git",
"jquery": "^3.5.1",
"pica": "^5.3.0",
"spectrum-colorpicker": "^1.8.1",
"terser": "^3.17.0"
}
}
198 changes: 166 additions & 32 deletions src/css/component.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
/*****************\
| UI Button Group |
\*****************/

.ui_button_group {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.ui_button_group.stacked {
margin: .75rem 0;
}
.ui_button_group.stacked:first-child {
margin-top: 0;
}
.ui_button_group.stacked:last-child {
margin-bottom: 0;
}
.ui_button_group > button,
.ui_button_group > input[type="button"] {
border-radius: 0;
}
.ui_button_group > button:focus,
.ui_button_group > input[type="button"]:focus {
z-index: 1;
}
.ui_button_group > button + button,
.ui_button_group > button + input[type="button"],
.ui_button_group > input[type="button"] + button,
.ui_button_group > input[type="button"] + input[type="button"] {
margin-left: -1px;
}
.ui_button_group > button:first-child,
.ui_button_group > input[type="button"]:first-child {
border-radius: var(--button-border-radius) 0 0 var(--button-border-radius);
}
.ui_button_group > button:last-child,
.ui_button_group > input[type="button"]:last-child {
border-radius: 0 var(--button-border-radius) var(--button-border-radius) 0;
}

/**************************\
| UI Color Picker Gradient |
\**************************/
Expand Down Expand Up @@ -63,41 +104,126 @@
content: '';
display: block;
position: absolute;
left: -6px;
top: -6px;
height: 3px;
width: 3px;
border: 4px solid #999;
left: -.6rem;
top: -.6rem;
height: .3rem;
width: .3rem;
border: .4rem solid #999;
border-radius: 1000px;
}

.ui_color_picker_gradient .secondary_pick .handle:after {
content: '';
display: block;
position: absolute;
left: -5px;
top: -5px;
height: 5px;
width: 5px;
border: 2px solid white;
left: -.5rem;
top: -.5rem;
height: .5rem;
width: .5rem;
border: .2rem solid white;
border-radius: 1000px;
}

.ui_color_picker_gradient .primary_pick .ui_range {
border-color: rgba(1, 1, 1, 0.1);
}
.ui_color_picker_gradient .primary_pick .ui_range:focus {
border-color: var(--input-border-color-active);
}

/*****************\
| UI Color Sample |
\*****************/

.ui_color_sample {
border: 1px solid #999;
box-shadow: 0 0 0 1px #555 inset;
display: block;
height: 28px;
width: 28px;
}

/***************\
| UI Flex Group |
\***************/

.ui_flex_group {
display: flex;
flex-direction: row;
}
.ui_flex_group.stacked {
margin: .75rem 0;
}
.ui_flex_group.stacked:first-child {
margin-top: 0;
}
.ui_flex_group.stacked:last-child {
margin-bottom: 0;
}
.ui_flex_group.column {
flex-direction: column;
}
.ui_flex_group.justify_content_center {
justify-content: center;
}
.ui_flex_group.justify_content_start {
justify-content: flex-start;
}
.ui_flex_group.justify_content_end {
justify-content: flex-end;
}
.ui_flex_group.justify_content_space_around {
justify-content: space-around;
}
.ui_flex_group.justify_content_space_between {
justify-content: space-between;
}
.ui_flex_group.align_items_baseline {
justify-content: baseline;
}
.ui_flex_group.align_items_center {
justify-content: center;
}
.ui_flex_group.align_items_start {
justify-content: flex-start;
}
.ui_flex_group.align_items_end {
justify-content: flex-end;
}
.ui_flex_group.align_items_stretch {
justify-content: stretch;
}

/****************\
| UI Icon Button |
\****************/

.ui_icon_button {
height: 2.8rem;
}

.ui_icon_button > svg {
display: block;
font-size: 1.6rem;
}

/****************\
| UI Input Group |
\****************/

.ui_input_group {
display: flex;
flex-direction: row;
min-height: 24px;
margin: 7.5px 0;
min-height: 2.4rem;
width: 100%;
}
.ui_input_group:first-child {
.ui_input_group.stacked {
margin: .75rem 0;
}
.ui_input_group.stacked:first-child {
margin-top: 0;
}
.ui_input_group:last-child {
.ui_input_group.stacked:last-child {
margin-bottom: 0;
}
.ui_input_group > input,
Expand All @@ -115,24 +241,32 @@
.ui_input_group > label {
display: flex;
align-items: center;
border: 1px solid var(--section-background-color);
border: 1px solid var(--input-group-border-color);
border-right: 0;
margin: 0;
padding: 0 7.5px;
padding: 0 .75rem;
}
.ui_input_group > .ui_range + input {
margin-left: -1px;
}

.ui_input_grid {
margin: 7.5px auto;
border-radius: var(--input-border-radius);
box-shadow: 0 1px 0 0 rgba(1, 1, 1, 0.1);
}
.ui_input_grid.stacked {
margin: .75rem 0;
}
.ui_input_grid:first-child {
.ui_input_grid.stacked:first-child {
margin-top: 0;
}
.ui_input_grid:last-child {
.ui_input_grid.stacked:last-child {
margin-bottom: 0;
}
:not(.ui_input_grid) > .ui_input_group {
border-radius: var(--input-border-radius);
box-shadow: 0 1px 0 0 rgba(1, 1, 1, 0.1);
}
.ui_input_grid > .ui_input_group {
margin: -1px 0;
}
Expand Down Expand Up @@ -173,7 +307,7 @@
background: var(--input-background-color);
border: 1px solid var(--input-border-color);
border-radius: 1000px;
height: 18px;
height: 1.8rem;
overflow: visible;
outline: 0;
padding: 0 calc(var(--range-handle-width) / 2);
Expand Down Expand Up @@ -210,7 +344,7 @@
box-sizing: border-box;
cursor: col-resize;
display: block;
height: 18px;
height: 1.8rem;
width: var(--range-handle-width);
position: absolute;
top: 50%;
Expand All @@ -237,18 +371,18 @@
display: block;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 7px solid white;
border-left: .5rem solid transparent;
border-right: .5rem solid transparent;
border-top: .7rem solid white;
}
.ui_range.color_picker .handle::after {
content: '';
display: block;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 7px solid black;
border-left: .5rem solid transparent;
border-right: .5rem solid transparent;
border-bottom: .7rem solid black;
}
.ui_range.color_picker .handle:hover::before {
border-top-color: #eaeaea;
Expand All @@ -261,7 +395,7 @@
flex-direction: column;
justify-content: flex-end;
height: 100%;
width: 18px;
width: 1.8rem;
padding: calc(var(--range-handle-width) / 2) 0;
}

Expand Down Expand Up @@ -295,12 +429,12 @@
}

.ui_range.vertical.color_picker_thin .padded_track {
top: 1px;
bottom: 1px;
top: 0;
bottom: 0;
}

.ui_range.vertical.color_picker_thin .handle {
border-radius: 0;
width: 100%;
height: 5px;
}
height: .5rem;
}
Loading