Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
blink play button whilst playing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolarosa committed Feb 28, 2020
1 parent d3b90b0 commit 19e57f4
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div>
<el-button
@click="play"
:type="buttonType"
type="success"
size="small"
:class="{'bg-orange-500': disablePlay}"
:class="{'transition duration-500 ease-in-out blinking bg-orange-500 border-orange-500': disablePlay}"
>
<i class="fas fa-play"></i>
</el-button>
Expand All @@ -29,8 +29,7 @@ export default {
data() {
return {
src: undefined,
disablePlay: false,
buttonType: "success"
disablePlay: false
};
},
methods: {
Expand All @@ -53,7 +52,6 @@ export default {
)[0];
const datafile = ocflObject.datafiles[mediaElement][0];
this.disablePlay = true;
this.buttonType = "warning";
if (datafile.path) this.src = datafile.path;
} catch (error) {
console.log(error);
Expand All @@ -67,12 +65,19 @@ export default {
this.src = undefined;
await new Promise(resolve => setTimeout(resolve, 200));
this.disablePlay = false;
this.buttonType = "success";
}, (this.item.segment.timeEnd - this.item.segment.timeBegin) * 1000);
}
}
};
</script>

<style lang="scss" scoped>
.blinking {
animation: blinkingBackground 1s infinite;
}
@keyframes blinkingBackground {
0% {
@apply bg-orange-800 border-orange-800;
}
}
</style>

0 comments on commit 19e57f4

Please sign in to comment.