|
6 | 6 |
|
7 | 7 | <script lang="ts"> |
8 | 8 | import { fade } from 'svelte/transition'; |
9 | | - import type { GestureID } from '../../lib/domain/stores/gesture/Gesture'; |
10 | | - import { stores } from '../../lib/stores/Stores'; |
11 | | - import GestureDot from './GestureDot.svelte'; |
12 | | - import RecordingGraph from '../features/graphs/recording/RecordingGraph.svelte'; |
13 | | - import type { RecordingData } from '../../lib/domain/RecordingData'; |
14 | | - import Tooltip from './Tooltip.svelte'; |
15 | | - import { serializeRecordingToCsvWithoutGestureName } from '../../lib/utils/CSVUtils'; |
| 9 | + import type { GestureID } from '../../../lib/domain/stores/gesture/Gesture'; |
| 10 | + import { stores } from '../../../lib/stores/Stores'; |
| 11 | + import GestureDot from './../GestureDot.svelte'; |
| 12 | + import RecordingGraph from '../../features/graphs/recording/RecordingGraph.svelte'; |
| 13 | + import type { RecordingData } from '../../../lib/domain/RecordingData'; |
| 14 | + import Tooltip from './../Tooltip.svelte'; |
| 15 | + import { serializeRecordingToCsvWithoutGestureName } from '../../../lib/utils/CSVUtils'; |
| 16 | + import Fingerprint from './Fingerprint.svelte'; |
| 17 | + import RecordingFingerprint from './RecordingFingerprint.svelte'; |
16 | 18 |
|
17 | 19 | // get recording from mother prop |
18 | 20 | export let recording: RecordingData; |
19 | 21 | export let gestureId: GestureID; |
20 | 22 | export let onDelete: (recording: RecordingData) => void; |
21 | 23 | export let dot: { gesture: GestureID; color: string } | undefined = undefined; |
22 | 24 | export let downloadable: boolean = false; |
| 25 | + export let enableFingerprint: boolean = false; |
23 | 26 |
|
24 | 27 | $: dotGesture = dot?.gesture |
25 | 28 | ? stores.getGestures().getGesture(dot?.gesture) |
|
56 | 59 | } |
57 | 60 | </script> |
58 | 61 |
|
59 | | -<div class="h-28 w-40 pr-3 pt-1 relative rounded-md"> |
| 62 | +<div |
| 63 | + class="h-28 w-50 pr-3 pt-1 relative rounded-md" |
| 64 | + class:w-40={!enableFingerprint} |
| 65 | + class:w-50={enableFingerprint}> |
60 | 66 | {#if dotGesture !== undefined} |
61 | | - <div class="absolute px-1 py-0.5 z-3 right-1 top-2"> |
| 67 | + <div |
| 68 | + class="absolute px-1 py-0.5 z-3 right-1 top-2" |
| 69 | + class:right-1={!enableFingerprint} |
| 70 | + class:right-10={enableFingerprint}> |
62 | 71 | <GestureDot gesture={dotGesture} /> |
63 | 72 | </div> |
64 | 73 | {/if} |
65 | 74 | {#if hide} |
66 | | - <div transition:fade class="absolute h-26 w-40 bg-white" /> |
| 75 | + <div |
| 76 | + transition:fade |
| 77 | + class="absolute h-26 bg-white" |
| 78 | + class:w-40={!enableFingerprint} |
| 79 | + class:w-50={enableFingerprint} /> |
67 | 80 | {:else} |
68 | | - <div transition:fade class="absolute h-26 w-40 bg-white rounded-md"> |
69 | | - <RecordingGraph {recording} /> |
| 81 | + <div |
| 82 | + transition:fade |
| 83 | + class="absolute h-26 bg-white rounded-md" |
| 84 | + class:w-40={!enableFingerprint} |
| 85 | + class:w-50={enableFingerprint}> |
| 86 | + <div class="w-40 h-26"> |
| 87 | + <RecordingGraph {recording} /> |
| 88 | + </div> |
| 89 | + {#if enableFingerprint} |
| 90 | + <div class="absolute right-0 top-0.5 left-40 w-10 overflow-hidden"> |
| 91 | + <RecordingFingerprint {recording} gestureName={$gesture.name} /> |
| 92 | + </div> |
| 93 | + {/if} |
70 | 94 | </div> |
71 | 95 | {/if} |
72 | 96 | <button class="absolute -left-2.8px top-0px outline-none"> |
|
83 | 107 | {#if downloadable} |
84 | 108 | <Tooltip title="CSV" offset={{ x: 125, y: 125 }}> |
85 | 109 | <button |
86 | | - class="absolute bottom-1 right-0.5 text-primarytext bg-primary bg-opacity-10 px-2 py-1 text-sm rounded-full shadow-md hover:bg-secondary hover:bg-opacity-30 transition z-1" |
| 110 | + class="absolute bottom-4 text-primarytext bg-primary bg-opacity-10 px-2 py-1 text-sm rounded-full shadow-md hover:bg-secondary hover:bg-opacity-30 transition z-1" |
| 111 | + class:right-10.5={enableFingerprint} |
| 112 | + class:right-0.5={!enableFingerprint} |
87 | 113 | on:click={bottomRightButtonClicked}> |
88 | 114 | <i class="fas fa-download" /> |
89 | 115 | </button> |
|
0 commit comments