aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-06-16 15:44:37 +0200
committerlonkaars <loek@pipeframe.xyz>2021-06-16 15:44:37 +0200
commit64aba383d6fbfa46fa558616c8bce868923d98a3 (patch)
treedc1acce3feedcd0d0cb4f93a490877142da25470
parentb034f288d39e6fc58472db8711e5ba7b18ebc66b (diff)
added placed class to #selection
-rw-r--r--pages/editor.tsx5
-rw-r--r--styles/editor.css4
2 files changed, 6 insertions, 3 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx
index 972c5f4..abb7b5e 100644
--- a/pages/editor.tsx
+++ b/pages/editor.tsx
@@ -351,6 +351,7 @@ function TimelineEditor(props: {
}, []);
var [selectionActive, setSelectionActive] = useState(false);
+ var [selectionPlaced, setSelectionPlaced] = useState(false);
var [selectionHidden, setSelectionHidden] = useState(true);
var [selectionLeftType, setSelectionLeftType] = useState(null);
var [selectionRightType, setSelectionRightType] = useState(null);
@@ -375,6 +376,7 @@ function TimelineEditor(props: {
if (selectionHidden && distanceTraveled > minDistance) setSelectionHidden(false);
if (selectionLeftType) setSelectionLeftType(null);
if (selectionRightType) setSelectionRightType(null);
+ if (selectionPlaced) setSelectionPlaced(false);
selectionPosAPI.start({
center: 0,
startOffset: 0,
@@ -432,6 +434,7 @@ function TimelineEditor(props: {
});
setSelectionLeftType(left.type);
setSelectionRightType(right.type);
+ setSelectionPlaced(true);
}
}
}, { domTarget: selectionRef, eventOptions: { passive: false } });
@@ -484,7 +487,7 @@ function TimelineEditor(props: {
{workingTimeline.map((slide: anySlide) => <TimelineKeyframe slide={slide} />)}
<div
id='selection'
- className='posabs dispinbl'
+ className={'posabs dispinbl ' + (selectionPlaced ? 'placed ' : '')}
style={{
left: `calc(var(--zoom) * ${selectionPos.startingFrame.toJSON()
+ selectionPos.center.toJSON()} * 1px - 6px + ${selectionPos.startOffset.toJSON()} * 1px)`,
diff --git a/styles/editor.css b/styles/editor.css
index 1279c72..881f82c 100644
--- a/styles/editor.css
+++ b/styles/editor.css
@@ -175,10 +175,10 @@
width: calc(var(--zoom) * var(--total-frames) * 1px);
background-color: rgba(0, 0, 255, var(--debug-hitbox-opacity));
}
-#selection {
+#selection.placed {
cursor: grab;
}
-#selection:active {
+#selection.placed:active {
cursor: grabbing;
}