Spaces:
Running
Running
File size: 1,241 Bytes
b4f9490 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
<template>
<div class="object-timeline">
<div class="object-info">
<span class="object-name">{{ object.name }}</span>
</div>
<div class="timeline-segments">
<div
v-for="segment in object.segments"
:key="segment.id"
class="segment"
:style="{
left: `${(segment.start / videoDuration) * 100}%`,
width: `${((segment.end - segment.start) / videoDuration) * 100}%`
}"
></div>
</div>
</div>
</template>
<script>
export default {
name: 'ObjectTimeline',
props: {
object: {
type: Object,
required: true
},
videoDuration: {
type: Number,
required: true
}
}
}
</script>
<style scoped>
.object-timeline {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 0;
}
.object-info {
width: 120px;
flex-shrink: 0;
}
.object-name {
color: #ffffff;
font-size: 0.875rem;
}
.timeline-segments {
flex-grow: 1;
height: 24px;
background: #2c2c2c;
border-radius: 4px;
position: relative;
}
.segment {
position: absolute;
height: 100%;
background: #4CAF50;
opacity: 0.7;
border-radius: 2px;
}
</style> |