Added favourite button and changed iconbutton cursor to pointer
parent
7bf15c9eeb
commit
1d40f6779b
|
|
@ -25,6 +25,7 @@ export default {
|
||||||
justify-content: center
|
justify-content: center
|
||||||
align-items: center
|
align-items: center
|
||||||
width: 38px
|
width: 38px
|
||||||
|
cursor: pointer
|
||||||
height: 38px
|
height: 38px
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
text-transform: capitalize
|
text-transform: capitalize
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,19 @@
|
||||||
<p class="remainingTime">{{duration}}</p>
|
<p class="remainingTime">{{duration}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-buttons">
|
<div class="control-buttons">
|
||||||
|
<IconButton variant="theme-icon" :click="toggleFavorite">
|
||||||
|
<svg v-show="isFavorited" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="colorable" d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
|
||||||
|
<svg v-show="!isFavorited" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="colorable" d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>
|
||||||
|
</IconButton>
|
||||||
<IconButton variant="contained">
|
<IconButton variant="contained">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton variant="contained large" :click="togglePlay">
|
<IconButton variant="contained large" :click="togglePlay">
|
||||||
<svg v-show="playingStatus" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg v-show="playingStatus" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||||
<svg v-show="!playingStatus" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg v-show="!playingStatus" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton variant="contained">
|
<IconButton variant="contained">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -110,6 +114,7 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
playingStatus: false,
|
playingStatus: false,
|
||||||
|
isFavorited: false,
|
||||||
duration: '00:00'
|
duration: '00:00'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -123,6 +128,23 @@ export default {
|
||||||
this.wavesurfer.minimap.drawer.updateSize()
|
this.wavesurfer.minimap.drawer.updateSize()
|
||||||
for (let child in controlIcons) {
|
for (let child in controlIcons) {
|
||||||
if (typeof controlIcons[child] === 'object') {
|
if (typeof controlIcons[child] === 'object') {
|
||||||
|
if (controlIcons[child].className.includes('no-theme')) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (controlIcons[child].className.includes('theme-icon')) {
|
||||||
|
let paths = controlIcons[child].getElementsByTagName('path')
|
||||||
|
for (let path in paths) {
|
||||||
|
if (typeof paths[path] === 'object') {
|
||||||
|
if (paths[path].getAttribute('class') === null) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (paths[path].getAttribute('class').includes('colorable')) {
|
||||||
|
paths[path].style.fill = `#${color}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
controlIcons[child].style.backgroundColor = `#${color}`
|
controlIcons[child].style.backgroundColor = `#${color}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -161,6 +183,9 @@ export default {
|
||||||
togglePlay () {
|
togglePlay () {
|
||||||
this.wavesurfer.playPause()
|
this.wavesurfer.playPause()
|
||||||
this.playingStatus = this.isPlaying()
|
this.playingStatus = this.isPlaying()
|
||||||
|
},
|
||||||
|
toggleFavorite () {
|
||||||
|
this.isFavorited = !this.isFavorited
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue