-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
resources/assets/js/annotations/components/labelbotPopover.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<ul class="labelbot-labels"> | ||
<li class="labelbot-labels-label" v-for="(label, index) in labelBOTLabels" :key="index"> | ||
<div v-if="index === 0" class="labelbot-labels-label__nameProgress"> | ||
<!-- Progress bar --> | ||
<div class="labelbot-labels-label__progress-bar" :style="{ width: progressWidth + '%' }"></div> | ||
<!-- Label name --> | ||
<div class="labelbot-labels-label__nameProgressColor"> | ||
<span class="labelbot-labels-label__color" :style="{ backgroundColor: label.color }"></span> | ||
<span>{{ label.name }}</span> | ||
</div> | ||
</div> | ||
<div v-else class="labelbot-labels-label__name"> | ||
<span class="labelbot-labels-label__color" :style="{ backgroundColor: label.color }"></span> | ||
<span>{{ label.name }}</span> | ||
</div> | ||
</li> | ||
<li class="labelbot-labels-label"> | ||
<input class="form-control" placeholder="type..."> | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
annotationPoints: { x: 222, y: 200 }, | ||
labelBOTLabels: [ | ||
{ name: "Label 1", color: "red" }, | ||
{ name: "Label 2", color: "blue" }, | ||
{ name: "Label 3", color: "green" } | ||
], | ||
progressWidth: 0 | ||
}; | ||
}, | ||
methods: { | ||
startAnimation() { | ||
this.progressWidth = 100; | ||
} | ||
}, | ||
mounted() { | ||
this.startAnimation(); | ||
} | ||
}; | ||
</script> |
64 changes: 64 additions & 0 deletions
64
resources/assets/sass/annotations/components/_labelbotPopover.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.labelbot-labels { | ||
list-style-type: none; | ||
max-width: min-content; | ||
display: block; | ||
padding: $padding-large-vertical; | ||
border: 1px solid $input-border; | ||
border-radius: $input-border-radius; | ||
margin: 0; | ||
} | ||
|
||
.labelbot-labels-label { | ||
position: relative; | ||
|
||
.labelbot-labels-label__color { | ||
position: absolute; | ||
top: 14px; | ||
left: $padding-small-vertical; | ||
width: 1em; | ||
height: 1em; | ||
border: 2px solid white; | ||
border-radius: 50%; | ||
} | ||
|
||
.labelbot-labels-label__name, | ||
.labelbot-labels-label__nameProgressColor { | ||
position: relative; | ||
padding: $padding-large-vertical 27px; | ||
margin-bottom: 4px; | ||
border: 1px solid $input-border; | ||
border-radius: $input-border-radius; | ||
word-wrap: break-word; | ||
transition: background-color 0.3s ease; | ||
|
||
&:hover { | ||
color: white; | ||
cursor: pointer; | ||
background-color: $gray-lighter; | ||
} | ||
} | ||
|
||
.labelbot-labels-label__nameProgress { | ||
position: relative; | ||
|
||
.labelbot-labels-label__nameProgressColor { | ||
border-color: #219b19; | ||
|
||
&:hover { | ||
background-color: #219b19; | ||
} | ||
} | ||
|
||
.labelbot-labels-label__progress-bar { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 0; | ||
height: 100%; | ||
background-color: #186612; | ||
transition: width 10s ease-in-out; | ||
border: 1px solid #219b19; | ||
border-radius: $input-border-radius; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters