Zelda64Recomp/assets/scss/styles/components/ControlOption.scss

171 lines
3.8 KiB
SCSS
Raw Normal View History

2024-01-18 20:49:29 +00:00
@use 'sass:color';
@use 'sass:math';
2024-01-18 20:49:29 +00:00
.control-option {
@include set-color($color-text-dim);
@include trans-colors-svg;
2024-01-18 20:49:29 +00:00
display: flex;
position: relative;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
height: auto;
2024-01-22 16:43:21 +00:00
padding: space(4) space(16) space(4) space(20);
2024-01-18 20:49:29 +00:00
border-radius: $border-radius-sm;
background-color: rgba(0, 0, 0, 0);
&:focus-visible:not(:disabled, [disabled]),
&:hover:not(:disabled, [disabled]) {
@include set-color($color-text);
background-color: $color-bg-overlay;
}
&:disabled, &[disabled] {
opacity: 0.5;
}
&--active {
// while actively looking for inputs, set styles to the correct slots
$valid-binding-slots: 0, 1;
@each $slot in $valid-binding-slots {
// global attr -> this active row -> binding slot
[cur-binding-slot="#{$slot}"] & .control-option__binding[bind-slot="#{$slot}"] {
border-color: $color-error;
.control-option__binding-icon {
opacity: 0;
}
.control-option__binding-recording {
opacity: 1;
}
}
}
}
2024-01-18 20:49:29 +00:00
.icon-button {
flex: 1 1 auto;
}
}
.control-option__label {
@extend %label-md;
flex: 2 1 space(300);
height: auto;
white-space: nowrap;
}
.control-option__bindings {
display: flex;
position: relative;
flex: 2 1 space(400);
2024-01-18 20:49:29 +00:00
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
2024-01-22 16:43:21 +00:00
height: space(56);
2024-01-18 20:49:29 +00:00
padding: 0 space(12) 0 space(4);
}
.control-option__binding {
@include set-color($color-text-dim);
@include trans-colors-border;
2024-01-18 20:49:29 +00:00
display: flex;
position: relative;
2024-01-18 20:49:29 +00:00
flex: 1 1 100%;
align-items: center;
justify-content: center;
2024-01-18 20:49:29 +00:00
width: 100%;
2024-01-22 16:43:21 +00:00
height: space(56);
margin: 0 space(4);
2024-01-18 20:49:29 +00:00
padding: space(8);
border-width: $border-width-thickness;
2024-01-18 20:49:29 +00:00
border-radius: $border-radius-sm;
border-color: $color-bg-overlay;
background-color: $color-bg-overlay;
2024-01-18 20:49:29 +00:00
&:focus, &:hover {
@include set-color($color-text);
border-color: $color-text;
background-color: $color-border-soft;
2024-01-18 20:49:29 +00:00
}
&:active {
@include set-color(color.scale($color-text, $lightness: 20%));
}
&:disabled, &[disabled] {
@include set-color($color-text-dim);
opacity: 0.5;
}
&:not([disabled]) {
@extend %nav-all;
2024-01-22 16:43:21 +00:00
cursor: pointer;
2024-01-18 20:49:29 +00:00
}
}
.control-option__binding-icon {
@include trans-colors-opa;
opacity: 1;
}
@keyframes control-option__binding-recording-scale {
0% {
transform: scale(1);
}
50% {
transform: scale(0.85);
}
100% {
transform: scale(1);
}
}
.control-option__binding-recording {
@include trans-colors-opa;
display: flex;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
align-items: center;
justify-content: center;
opacity: 0;
.control-option__binding-circle {
$rec-size: 24;
width: space($rec-size);
height: space($rec-size);
animation: 1.5s sine-in-out infinite control-option__binding-recording-scale;
border-radius: space($rec-size);
background-color: $color-error;
}
.control-option__binding-edge {
$edge-size: 36;
$h-edge-size: math.div($edge-size, 2);
position: absolute;
top: 50%;
left: 50%;
width: space($edge-size);
height: space($edge-size);
transform: translate(-50%, -50%);
> svg.control-option__binding-edge-svg {
width: space($edge-size);
height: space($edge-size);
image-color: $color-error;
}
}
}