-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
479d533
commit f3132ac
Showing
7 changed files
with
278 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div> | ||
<div | ||
v-for="(item, index) in data" | ||
:key="index" | ||
class="w-full pb-6 border-t border-gray-200" | ||
> | ||
<div | ||
@click="show(index)" | ||
class="flex items-center justify-between pt-6" | ||
> | ||
<p class="text-lg font-medium text-gray-900">{{ item.title }}</p> | ||
<SvgLoader :id="`icon-${index}`" name="chevron_down" class="transform shrink-0 fill-white"/> | ||
</div> | ||
|
||
<div :id="`content-${index}`" class="hidden mt-4 text-gray-500" v-html="item.content"></div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import SvgLoader from '@/Components/SvgLoader.vue'; | ||
const props = defineProps({ | ||
data:Array | ||
}); | ||
const show = (index) => { | ||
const content = document.getElementById(`content-${index}`); | ||
const icon = document.getElementById(`icon-${index}`); | ||
if (content.classList.contains('hidden')) { | ||
content.classList.remove('hidden') | ||
icon.classList.add('rotate-180') | ||
return | ||
} | ||
icon.classList.remove('rotate-180') | ||
content.classList.add('hidden') | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<template> | ||
<div> | ||
<div v-if="'soon' === show" class="space-y-6 text-center"> | ||
<p class="text-2xl font-bold text-turqoise-50">Vom deschide procesul de înscriere proiecte</p> | ||
<h2 class="text-6xl font-bold text-white">în curând!</h2> | ||
<p class="text-2xl font-bold text-turqoise-50">Vă mulțumim pentru răbdare!</p> | ||
</div> | ||
|
||
<div v-if="'now' === show" class="space-y-6 text-center"> | ||
<p class="text-2xl font-bold text-turqoise-50">Au mai rămas</p> | ||
<div class="grid grid-cols-3 gap-6"> | ||
<div class="text-center text-white"> | ||
<p class="text-6xl font-bold">{{ countdown.days }}</p> | ||
<p class="text-2xl font-bold">zile</p> | ||
</div> | ||
<div class="text-center text-white"> | ||
<p class="text-6xl font-bold">{{ countdown.days }}</p> | ||
<p class="text-2xl font-bold">ore</p> | ||
</div> | ||
<div class="text-center text-white"> | ||
<p class="text-6xl font-bold">{{ countdown.minutes }}</p> | ||
<p class="text-2xl font-bold">min</p> | ||
</div> | ||
</div> | ||
<p class="text-2xl font-bold text-turqoise-50">până la termenul de depunere</p> | ||
</div> | ||
|
||
<div v-if="'ended' === show" class="space-y-6 text-center"> | ||
<p class="text-2xl font-bold text-turqoise-50">Perioada de înscriere a luat sfârșit. Gala va avea loc pe</p> | ||
<h2 class="text-6xl font-bold text-white">{{ dates.end }}</h2> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
/** Import from vue. */ | ||
import { computed, ref, watchEffect} from 'vue' | ||
const props = defineProps({ | ||
dates: Object | ||
}); | ||
const current = new Date(); | ||
const start = new Date(props.dates.start); | ||
const end = new Date(props.dates.end); | ||
const show = computed(() => { | ||
if (current < start) { | ||
return 'soon'; | ||
} else if (end < current) { | ||
return 'ended'; | ||
} else if ((current >= start) && (current <= end)) { | ||
return 'now'; | ||
} | ||
}); | ||
const countdown = ref({ | ||
days: 0, | ||
hours: 0, | ||
minutes: 0 | ||
}); | ||
const startCountdown = () => { | ||
const countdownInterval = setInterval(() => { | ||
const remainingTime = end - current; | ||
if (remainingTime <= 0) { | ||
clearInterval(countdownInterval); | ||
countdown.value.days = 0; | ||
countdown.value.hours = 0; | ||
countdown.value.minutes = 0; | ||
} else { | ||
countdown.value.days = Math.floor(remainingTime / (1000 * 60 * 60 * 24)); | ||
countdown.value.hours = Math.floor((remainingTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | ||
countdown.value.minutes = Math.floor((remainingTime % (1000 * 60 * 60)) / (1000 * 60)); | ||
} | ||
}, 1000); | ||
}; | ||
watchEffect(() => { | ||
startCountdown(); | ||
}); | ||
</script> |
Oops, something went wrong.