Skip to content

Commit

Permalink
update gale regionale pages (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorinZarafu authored Jun 22, 2023
1 parent 479d533 commit f3132ac
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 407 deletions.
152 changes: 63 additions & 89 deletions app/Http/Controllers/RegionalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,6 @@ class RegionalController extends Controller
{
public function index()
{
$testimonials = [
[
'content' => '11111 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
[
'content' => '222222222 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
];

$links = [
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
];

$editions = [
[
Expand Down Expand Up @@ -90,54 +58,53 @@ public function index()
],
];

$projects = Project::publish()->paginate(9)->withQueryString();
$counties = County::whereHas('projects')->get(['name', 'id']);

return Inertia::render('Public/Regional/Regional', [
'query' => $projects,
'counties' => $counties,
'testimonials' => $testimonials,
'links' => $links,
'editions' => $editions,
'articles' => $articles,
]);
}
$registration = [
'start' => '2023-06-01',
'end' => '2023-07-20'
];

public function edition()
{
$testimonials = [
[
'content' => '11111 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
[
'content' => '222222222 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
$parteners = [
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png'
];

$links = [
$faqs = [
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
'title' => 'Title 1',
'content' => 'Content 1'
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
'title' => 'Title 2',
'content' => 'Content 2'
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
'title' => 'Title 3',
'content' => 'Content 3'
],
[
'title' => 'Title 4',
'content' => 'Content 4'
]
];

$projects = Project::publish()->paginate(9)->withQueryString();

return Inertia::render('Public/Regional/Regional', [
'query' => $projects,
'editions' => $editions,
'articles' => $articles,
'parteners' => $parteners,
'registration' => $registration,
'faqs' => $faqs
]);
}

public function edition()
{
$editions = [
[
'href' => '1',
Expand Down Expand Up @@ -183,40 +150,47 @@ public function edition()
],
];

$statistics = [
$registration = [
'start' => '2023-06-01',
'end' => '2023-07-20'
];

$parteners = [
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png',
'/images/project_img.png'
];

$faqs = [
[
'month' => 'Decembrie 2016',
'donations' => '2210',
'amount' => '188873,00',
'title' => 'Title 1',
'content' => 'Content 1'
],
[
'month' => 'Decembrie 2016',
'donations' => '2210',
'amount' => '188873,00',
'title' => 'Title 2',
'content' => 'Content 2'
],
[
'month' => 'Decembrie 2016',
'donations' => '2210',
'amount' => '188873,00',
'title' => 'Title 3',
'content' => 'Content 3'
],
[
'month' => 'Decembrie 2016',
'donations' => '2210',
'amount' => '188873,00',
],
'title' => 'Title 4',
'content' => 'Content 4'
]
];

$projects = Project::publish()->paginate(9)->withQueryString();
$counties = County::whereHas('projects')->get(['name', 'id']);

return Inertia::render('Public/Regional/LastEdition', [
'query' => $projects,
'counties' => $counties,
'testimonials' => $testimonials,
'links' => $links,
'editions' => $editions,
'articles' => $articles,
'statistics' => $statistics,
'parteners' => $parteners,
'registration' => $registration,
'faqs' => $faqs
]);
}

Expand Down
3 changes: 3 additions & 0 deletions public/images/svg/chevron_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions resources/js/Components/faqs/Faqs.vue
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>
83 changes: 83 additions & 0 deletions resources/js/Components/timers/Countdown.vue
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>
Loading

0 comments on commit f3132ac

Please sign in to comment.