Style improvements
parent
faf0d1d5ec
commit
c4bf944f93
|
|
@ -82,7 +82,7 @@ label {
|
||||||
}
|
}
|
||||||
.lever {
|
.lever {
|
||||||
bottom: -2.75rem;
|
bottom: -2.75rem;
|
||||||
height: 3.4375rem;
|
height: 4.4375rem;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 12rem;
|
left: 12rem;
|
||||||
width: 6.125rem;
|
width: 6.125rem;
|
||||||
|
|
@ -92,6 +92,7 @@ label {
|
||||||
height: 3.4375rem;
|
height: 3.4375rem;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 3.0625rem;
|
width: 3.0625rem;
|
||||||
|
top: 1em;
|
||||||
transform: rotate(var(--leverRotation));
|
transform: rotate(var(--leverRotation));
|
||||||
transform-origin: calc(100% - 3px) calc(100% - 2px);
|
transform-origin: calc(100% - 3px) calc(100% - 2px);
|
||||||
|
|
||||||
|
|
@ -226,4 +227,12 @@ label {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
width: 8.125rem;
|
width: 8.125rem;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Util */
|
||||||
|
.no-select {
|
||||||
|
user-select: none
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,16 @@ const kPullDirection = {
|
||||||
* Functions to handle side effects
|
* Functions to handle side effects
|
||||||
*/
|
*/
|
||||||
const middleware = [
|
const middleware = [
|
||||||
|
function disableSelect(_, action) {
|
||||||
|
if (action === kAction.startTurningWheel || action === kAction.startPullingLever) {
|
||||||
|
document.querySelector('.machine')?.classList.add('no-select');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function enableSelect(_, action) {
|
||||||
|
if (action === kAction.stopTurningWheel || action === kAction.stopPullingLever) {
|
||||||
|
document.querySelector('.machine')?.classList.remove('no-select');
|
||||||
|
}
|
||||||
|
},
|
||||||
function completeLoading(state, action) {
|
function completeLoading(state, action) {
|
||||||
if (action === kAction.turnWheel && state.currentState === kState.readyToLoad && parseFloat(state.load) >= configuration.maxLoad) {
|
if (action === kAction.turnWheel && state.currentState === kState.readyToLoad && parseFloat(state.load) >= configuration.maxLoad) {
|
||||||
send(kAction.completeLoading);
|
send(kAction.completeLoading);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue