0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-12-01 15:37:29 +00:00
VueTube/NUXT/components/Player/sponsorblock.vue

64 lines
1.3 KiB
Vue
Raw Normal View History

2022-06-01 03:40:36 +00:00
<template>
<div>
2022-06-01 18:35:14 +00:00
<v-progress-linear
v-for="block in blocks"
:key="block.UUID"
2022-06-10 04:37:08 +00:00
:buffer-value="(block.segment[1] / duration) * 100"
:value="(block.segment[0] / duration) * 100"
2022-06-01 18:35:14 +00:00
style="
2022-06-07 17:16:26 +00:00
position: absolute;
2022-06-01 18:35:14 +00:00
pointer-events: none;
2022-06-07 17:16:26 +00:00
background: transparent;
transform: translateY(50%);
2022-06-01 18:35:14 +00:00
"
2022-06-01 19:02:02 +00:00
:class="!fullscreen || controls ? '' : 'invisible'"
:background-color="colors[block.category]"
2022-06-01 18:35:14 +00:00
background-opacity="1"
color="transparent"
2022-06-07 17:16:26 +00:00
:height="seeking ? 4 : 2"
:style="
fullscreen
2022-06-08 20:15:15 +00:00
? 'width: calc(100% - 2rem); left: 1rem; bottom: 3.5rem;'
2022-06-07 17:16:26 +00:00
: 'width: 100%; left: 0; bottom: 1px;'
"
2022-06-01 18:35:14 +00:00
/>
</div>
2022-06-01 03:40:36 +00:00
</template>
<script>
export default {
props: {
2022-06-08 16:32:04 +00:00
blocks: {
type: Array,
required: true,
},
duration: {
2022-06-10 04:37:08 +00:00
type: Number,
2022-06-01 03:40:36 +00:00
required: true,
},
2022-06-07 17:16:26 +00:00
seeking: {
type: Boolean,
required: true,
},
2022-06-01 18:35:14 +00:00
fullscreen: {
type: Boolean,
required: true,
},
controls: {},
2022-06-01 03:40:36 +00:00
},
2022-06-08 16:32:04 +00:00
data: () => ({
colors: {
sponsor: "green",
selfpromo: "yellow",
exclusive_access: "teal",
interaction: "fuchsia",
poi_highlight: "deeppink",
intro: "lightblue",
outro: "blue",
music_offtopic: "orange",
filter: "purple",
},
}),
2022-06-01 03:40:36 +00:00
};
</script>