some tweaks; add CurrentlyListening
parent
1b8aa36a5b
commit
cffa95a91e
@ -0,0 +1,56 @@
|
|||||||
|
<template>
|
||||||
|
<a
|
||||||
|
class="btn currentlyListening"
|
||||||
|
href=" https://spot2gether.cybre.town/user/op3q884heqao7laioz05ebaoz"
|
||||||
|
target="_blank"
|
||||||
|
ref="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<div v-if="currentlyPlaying?.item" class="row align-items-center">
|
||||||
|
<i class="bi-music-note col-auto icon" />
|
||||||
|
<div class="col-auto d-flex flex-column text">
|
||||||
|
<b>{{ currentlyPlaying?.item?.name }}</b>
|
||||||
|
<div>{{ currentlyPlaying?.item?.artists.map(artist => artist.name).join(', ') }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let updateMusicInfo = null;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "CurrentlyListening",
|
||||||
|
data: () => ({
|
||||||
|
currentlyPlaying: null,
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
async fetchMusicInfo() {
|
||||||
|
return await fetch(
|
||||||
|
'https://spot2gether.cybre.town/api/public/users/op3q884heqao7laioz05ebaoz/info'
|
||||||
|
).then(data => data.json());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
this.currentlyPlaying = (await this.fetchMusicInfo())?.currentlyPlaying;
|
||||||
|
updateMusicInfo = setInterval(async () => {
|
||||||
|
this.currentlyPlaying = (await this.fetchMusicInfo())?.currentlyPlaying;
|
||||||
|
}, 20000);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
clearInterval(updateMusicInfo);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.currentlyListening {
|
||||||
|
position: relative;
|
||||||
|
.icon {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-size: .8rem;
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,29 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<BannerWrapperNetwork>
|
||||||
<div>
|
<div>
|
||||||
<div class="row">
|
<CurrentlyListening />
|
||||||
<StickyWrapper class="col-auto mx-4">
|
<StickyWrapper>
|
||||||
<router-link to="/projects" class="btn btn-outline-light">Projects</router-link>
|
<TextScramble :phrases="[
|
||||||
</StickyWrapper>
|
'Hey!',
|
||||||
<div class="col">
|
'Welcome to adb.sh :D',
|
||||||
<FolderList path="/projects/" v-slot="{ page }">
|
'I do web development', 'networking / hosting', 'electronics', 'DJing / music',
|
||||||
<div class="card m-2">
|
]" />
|
||||||
<div class="card-header"><router-link :to="page.regularPath">{{ page.title }}</router-link></div>
|
<SocialIcons />
|
||||||
<div class="card-body">
|
<div class="row my-4 justify-content-center">
|
||||||
{{ page.frontmatter.excerpt }}
|
<router-link class="col-auto mx-2 btn btn-outline-light" to="/projects" >projects</router-link>
|
||||||
</div>
|
<router-link class="col-auto mx-2 btn btn-outline-light" to="/music" >music</router-link>
|
||||||
</div>
|
|
||||||
</FolderList>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</StickyWrapper>
|
||||||
</div>
|
</div>
|
||||||
|
</BannerWrapperNetwork>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "HomeContent"
|
name: "HomeContent",
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue