Skip to content

Instantly share code, notes, and snippets.

@leemartin
Created August 10, 2023 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemartin/81f1748547acdd9d7fb1d54c9db7ec98 to your computer and use it in GitHub Desktop.
Save leemartin/81f1748547acdd9d7fb1d54c9db7ec98 to your computer and use it in GitHub Desktop.
Vue Marquee Component
<template>
<div id="marquee">
<div class="inner">
<div class="message">{{ message }}</div>
<div class="message">{{ message }}</div>
</div>
</div>
</template>
<script setup>
// Define props
defineProps(['message'])
</script>
<style lang="postcss" scoped>
#marquee{
@apply bg-black dark:bg-white overflow-hidden text-white dark:text-black;
}
.inner{
@apply flex py-2.5 md:py-3 lg:py-3.5 xl:py-4 2xl:py-[18px] w-max;
animation: scroll 15s linear infinite;
}
.message{
@apply px-5 md:px-6 lg:px-7 xl:px-8 2xl:px-9;
}
@keyframes scroll {
from {
transform: translateX(0%);
}
to {
transform: translateX(-50%);
}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment