|
@@ -23,17 +23,32 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="cursor">
|
|
|
+ <div class="cursor-border">
|
|
|
+ <span class="text">{{ store.currentScore }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { computed, defineComponent, reactive, watch, watchEffect } from "vue";
|
|
|
+import {
|
|
|
+ computed,
|
|
|
+ defineComponent,
|
|
|
+ onMounted,
|
|
|
+ onUnmounted,
|
|
|
+ reactive,
|
|
|
+ watch,
|
|
|
+ watchEffect,
|
|
|
+} from "vue";
|
|
|
import { findCurrentTaskMarkResult, store } from "./store";
|
|
|
import filters from "@/filters";
|
|
|
import MarkDrawTrack from "./MarkDrawTrack.vue";
|
|
|
-import { Track } from "@/types";
|
|
|
+import { ModeEnum, Track } from "@/types";
|
|
|
import { useTimers } from "@/setups/useTimers";
|
|
|
import { loadImage } from "@/utils/utils";
|
|
|
import { groupBy, sortBy } from "lodash";
|
|
|
+// @ts-ignore
|
|
|
+import CustomCursor from "custom-cursor.js";
|
|
|
|
|
|
interface SliceImage {
|
|
|
url: string;
|
|
@@ -400,6 +415,24 @@ export default defineComponent({
|
|
|
{ deep: true }
|
|
|
);
|
|
|
|
|
|
+ let theCursor = null as any;
|
|
|
+ onMounted(() => {
|
|
|
+ if (store.setting.mode === ModeEnum.TRACK) {
|
|
|
+ theCursor = new CustomCursor(".cursor", {
|
|
|
+ focusElements: [
|
|
|
+ {
|
|
|
+ selector: ".mark-body-container",
|
|
|
+ focusClass: "cursor--focused-view",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }).initialize();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ onUnmounted(() => {
|
|
|
+ theCursor && theCursor.destroy();
|
|
|
+ });
|
|
|
+
|
|
|
return {
|
|
|
store,
|
|
|
sliceImagesWithTrackList,
|
|
@@ -430,4 +463,60 @@ export default defineComponent({
|
|
|
.image-seperator {
|
|
|
border: 2px solid rgba(120, 120, 120, 0.1);
|
|
|
}
|
|
|
+
|
|
|
+.cursor {
|
|
|
+ color: #ff5050;
|
|
|
+ display: none;
|
|
|
+ pointer-events: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ user-select: none;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ position: fixed;
|
|
|
+ will-change: transform;
|
|
|
+ z-index: 1000;
|
|
|
+}
|
|
|
+
|
|
|
+.cursor-border {
|
|
|
+ position: absolute;
|
|
|
+ box-sizing: border-box;
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid #ff5050;
|
|
|
+ border-radius: 50%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ height: 0px;
|
|
|
+ width: 0px;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ transition: all 360ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
+}
|
|
|
+
|
|
|
+.cursor.cursor--initialized {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.cursor .text {
|
|
|
+ font-size: 2rem;
|
|
|
+ opacity: 0;
|
|
|
+ transition: opacity 80ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
+}
|
|
|
+
|
|
|
+.cursor.cursor--off-screen {
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.cursor.cursor--focused .cursor-border,
|
|
|
+.cursor.cursor--focused-view .cursor-border {
|
|
|
+ width: 90px;
|
|
|
+ height: 90px;
|
|
|
+}
|
|
|
+
|
|
|
+.cursor.cursor--focused-view .text {
|
|
|
+ opacity: 1;
|
|
|
+ transition: opacity 360ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
+}
|
|
|
</style>
|