diff --git a/app.vue b/app.vue index 814d558..137cec2 100644 --- a/app.vue +++ b/app.vue @@ -4,7 +4,7 @@ GitHundred • Top 100 starred GitHub repositories diff --git a/components/InsightCard.vue b/components/HighlightCard.vue similarity index 64% rename from components/InsightCard.vue rename to components/HighlightCard.vue index 1e83249..c832c06 100644 --- a/components/InsightCard.vue +++ b/components/HighlightCard.vue @@ -10,19 +10,28 @@ const { card, index } = defineProps<{ card: Card; index: number }>(); const flippedCards = useFlippedCards(); const flipped = computed(() => flippedCards.value.includes(card.title)); +const isFlipping = ref(false); + +watch(flipped, (newFlipped) => { + if (!newFlipped) return; + isFlipping.value = true; + setTimeout(() => { + isFlipping.value = false; + }, 1000); +}); const [translateX, translateY, rotate] = (() => { switch (index) { case 0: - return ['-1rem', '1rem', '-4deg']; + return ['1rem', '1rem', '4deg']; case 1: - return ['0rem', '2rem', '2deg']; + return ['0', '1rem', '2deg']; case 2: - return ['0rem', '0rem', '-2deg']; + return ['0', '0', '-2deg']; case 3: return ['1rem', '-2rem', '1deg']; case 4: - return ['2rem', '2rem', '4deg']; + return ['1rem', '0', '-2deg']; case 5: default: return ['1rem', '-2rem', '-6deg']; @@ -32,12 +41,15 @@ const [translateX, translateY, rotate] = (() => {