Adjust styles and default behavior and partially fix knob rending during rotation
This commit is contained in:
parent
cb83a95351
commit
656c11446f
2 changed files with 39 additions and 24 deletions
|
|
@ -49,7 +49,7 @@ rangeKnob.addEventListener("mousedown", (e) => {
|
||||||
function resetGrid() {
|
function resetGrid() {
|
||||||
gridSlider.value = gridSlider.defaultValue;
|
gridSlider.value = gridSlider.defaultValue;
|
||||||
container.style.backgroundColor = "rgb(180, 254, 235)";
|
container.style.backgroundColor = "rgb(180, 254, 235)";
|
||||||
backColorPicker.value = "#ffffff";
|
backColorPicker.value = "#b4feeb";
|
||||||
colorPicker.value = "#000000";
|
colorPicker.value = "#000000";
|
||||||
colorValue = "black";
|
colorValue = "black";
|
||||||
rangeKnob.style.transform = `rotate(${gridSlider.value}deg)`;
|
rangeKnob.style.transform = `rotate(${gridSlider.value}deg)`;
|
||||||
|
|
|
||||||
53
style.css
53
style.css
|
|
@ -42,6 +42,11 @@ footer {
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button, .container, .color-input, .knob {
|
||||||
|
box-shadow: 1px 2px 10px 1px #555;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.pen-input, .grid-input {
|
.pen-input, .grid-input {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -56,15 +61,6 @@ footer {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 900px) {
|
|
||||||
.pen-color, .pen-tools, .grid-tools {
|
|
||||||
flex-direction: row; /* Switch to a row layout when wrapping occurs */
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.col-picker, .background-col-picker {
|
.col-picker, .background-col-picker {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
|
|
@ -78,11 +74,14 @@ footer {
|
||||||
|
|
||||||
.color-input {
|
.color-input {
|
||||||
width: 120%;
|
width: 120%;
|
||||||
|
height: 25px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
display: block;
|
display: block;
|
||||||
width: 120px;
|
width: 120px;
|
||||||
|
height: 25px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +93,19 @@ button {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
background: rgb(180, 254, 235);
|
background: rgb(180, 254, 235);
|
||||||
|
will-change: contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-on {
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-off {
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider {
|
.slider {
|
||||||
|
|
@ -112,11 +124,11 @@ button {
|
||||||
width: 95px;
|
width: 95px;
|
||||||
height: 95px;
|
height: 95px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid #111;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: #bbb;
|
background: #bbb;
|
||||||
box-shadow: 1px 2px 10px 1px #555;
|
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
will-change: transform, box-shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
.knotch {
|
.knotch {
|
||||||
|
|
@ -125,20 +137,23 @@ button {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: #111;
|
background: #111;
|
||||||
|
box-shadow: 1px 2px 1px 1px #555;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 15%;
|
top: 15%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
|
box-shadow: 1px 1px 1px #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid {
|
@media screen and (max-width: 900px) {
|
||||||
box-sizing: border-box;
|
.pen-color, .pen-tools, .grid-tools {
|
||||||
|
flex-direction: row; /* Switch to a row layout when wrapping occurs */
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
.knob {
|
||||||
.grid-on {
|
width: 50px;
|
||||||
border: 1px solid #bbb;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-off {
|
|
||||||
border: none;
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue