Show hover effect on active time slot
This commit is contained in:
parent
48d53e9b54
commit
9b5cbaa7e9
|
|
@ -98,6 +98,7 @@
|
||||||
background-origin: border-box;
|
background-origin: border-box;
|
||||||
transition: background-color .1s;
|
transition: background-color .1s;
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
border-top-width: 2px;
|
border-top-width: 2px;
|
||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
|
|
@ -108,6 +109,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nonEditable:hover::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background-color: var(--highlight-color, rgba(0,0,0,.3));
|
||||||
|
}
|
||||||
|
|
||||||
.editable {
|
.editable {
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:hover:not(:active) {
|
&:hover:not(:active) {
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ const AvailabilityViewer = ({ times, people, table }: AvailabilityViewerProps) =
|
||||||
key={y}
|
key={y}
|
||||||
className={makeClass(
|
className={makeClass(
|
||||||
styles.time,
|
styles.time,
|
||||||
|
styles.nonEditable,
|
||||||
(focusCount === undefined || focusCount === peopleHere.length) && highlight && (peopleHere.length === max || tempFocus) && peopleHere.length > 0 && styles.highlight,
|
(focusCount === undefined || focusCount === peopleHere.length) && highlight && (peopleHere.length === max || tempFocus) && peopleHere.length > 0 && styles.highlight,
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,13 @@ export const usePalette = (steps: number) => {
|
||||||
})
|
})
|
||||||
.format('rgba')
|
.format('rgba')
|
||||||
.map(([r, g, b, a]) => color(r, g, b, a / 255))
|
.map(([r, g, b, a]) => color(r, g, b, a / 255))
|
||||||
.map(c => ({
|
.map(c => {
|
||||||
|
let highlight = c.luminance() > .5 ? c.darker() : c.brighter()
|
||||||
|
highlight = highlight.alpha(highlight.alpha() + .3)
|
||||||
|
return {
|
||||||
string: c.hex('rgba'),
|
string: c.hex('rgba'),
|
||||||
highlight: c.luminance() > .5 ? c.darker().hex('rgba') : c.brighter().hex('rgba'),
|
highlight: highlight.hex('rgba'),
|
||||||
})),
|
}
|
||||||
|
}),
|
||||||
[steps, colormap])
|
[steps, colormap])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue