WIP starbook demo
This commit is contained in:
39
app/components/UI/CloseButton.vue
Normal file
39
app/components/UI/CloseButton.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<button ref="buttonRef">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M15.7071 5.29289C16.0976 5.68342 16.0976 6.31658 15.7071 6.70711L10.4142 12L15.7071 17.2929C16.0976 17.6834 16.0976 18.3166 15.7071 18.7071C15.3165 19.0976 14.6834 19.0976 14.2929 18.7071L8.46963 12.8839C7.98148 12.3957 7.98148 11.6043 8.46963 11.1161L14.2929 5.29289C14.6834 4.90237 15.3165 4.90237 15.7071 5.29289Z"
|
||||
fill="#0F1729"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const buttonRef = ref<HTMLButtonElement | null>(null)
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape' && buttonRef.value) {
|
||||
buttonRef.value.click()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('keydown', handleKeyDown)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', handleKeyDown)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
button {
|
||||
@apply fixed bottom-4 md:top-4 left-4 size-20;
|
||||
}
|
||||
</style>
|
||||
31
app/components/UI/PlayButton.vue
Normal file
31
app/components/UI/PlayButton.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<button tabindex="-1" class="play-button" :class="{ loading: isLoading }" :disabled="isLoading">
|
||||
<template v-if="props.isLoading">
|
||||
<img src="/loader.svg" alt="Chargement" class="size-16" />
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ props.isPlaying ? 'I I' : '▶' }}
|
||||
</template>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = withDefaults(defineProps<{
|
||||
isLoading?: boolean;
|
||||
isPlaying?: boolean;
|
||||
}>(), {
|
||||
isLoading: false,
|
||||
isPlaying: false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.play-button {
|
||||
@apply pointer-events-none rounded-full size-24 flex items-center justify-center text-esyellow backdrop-blur-sm bg-black/25 transition-all duration-100 ease-in-out transform active:scale-90 scale-110 text-4xl font-bold;
|
||||
}
|
||||
|
||||
.loading,
|
||||
.play-button-changed {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user