fixed faq bugs

This commit is contained in:
HAM!DREZA
2024-07-02 18:19:51 +03:30
parent a8e723ddf0
commit d2f71b6b14
21 changed files with 205 additions and 307 deletions
@@ -2,28 +2,26 @@
<div class="w-full relative flex h-[86.41vw] md:h-[40.625vw]">
<NuxtImg
:placeholder="[30, 20]"
:src="props.props.image"
:src="props.props?.image"
alt="html"
class="absolute h-[86.41vw] md:h-[40.625vw] top-0 left-0 w-full object-cover brightness-75"
/>
<div class="mt-[14vw] ms-[9.5vw] z-[1] text-white">
<h1 class="text-[5.751vw] md:text-[1.69vw] font-[600] -tracking-[0.05vw]">
{{ props.props.name }}
{{ props.props?.name }}
</h1>
<p class="text-[3.19vw] md:text-[0.833vw] mt-[0.6vw] text-[#E5E5E5]">
{{ props.props.categories[0].name }}
</p>
<p
class="hidden md:block w-[39.896vw] text-[1.055vw] leading-[1.582vw] mt-[1.2vw]"
>
{{ props.props.description }}
{{ props.props?.categories[0].name }}
</p>
<div
class="descriptios hidden md:block w-[39.896vw] text-[1.055vw] leading-[1.582vw] mt-[1.2vw]"
></div>
<p
class="text-[2.836vw] md:text-[0.741vw] text-[##E5E5E5] mt-[1.8vw] absolute bottom-[8vw] md:bottom-auto md:relative"
>
مدرس دوره :
<span class="text-[3.59vw] md:text-[1.055vw] text-white ms-[1vw]"
>حمیدرضا عبادی</span
>{{props.props?.teacher.name}}</span
>
</p>
<div
@@ -113,9 +111,7 @@
</svg>
<div class="space-y-[0.3vw]">
<p class="text-[3.59vw] md:text-[1.055vw]">آخرین بروزرسانی</p>
<p class="text-[2.518vw] md:text-[0.741vw]">
{{ shamsi[2] }} / {{ shamsi[1] }} / {{ shamsi[0] }}
</p>
<p class="text-[2.518vw] md:text-[0.741vw]">{{jDate(props.props?.updatedAt)}}</p>
</div>
</div>
<div class="border-l"></div>
@@ -145,7 +141,7 @@
<div class="space-y-[0.3vw]">
<p class="text-[3.59vw] md:text-[1.055vw]">مدت زمان دوره</p>
<p class="text-[2.518vw] md:text-[0.741vw]">
{{ props.props.duration }} ساعت
{{ props.props?.duration }} ساعت
</p>
</div>
</div>
@@ -189,7 +185,7 @@
<div class="space-y-[0.3vw]">
<p class="text-[3.59vw] md:text-[1.055vw]">
{{ props.props.studentsCount }}
{{ props.props?.studentsCount }}
</p>
<p class="text-[2.518vw] md:text-[0.741vw]">دانشجو</p>
</div>
@@ -201,15 +197,20 @@
<script setup>
const props = defineProps(["props"]);
const isoDateString = props.props.createdAt;
const dateObject = new Date(isoDateString);
const year = dateObject.getFullYear();
const month = dateObject.getMonth() + 1;
const day = dateObject.getDate();
const hours = dateObject.getHours();
const minutes = dateObject.getMinutes();
const seconds = dateObject.getSeconds();
import {jDate} from "@/utils/jDate"
const shamsi = gregorian_to_jalali(year,month,day)
if (process.client) {
const des = props?.props.description;
function hideEndOfString(inputString) {
const words = inputString.split(" ");
if (words.length > 50) {
const truncatedWords = words.slice(0, 50);
return truncatedWords.join(" ") + "...";
} else {
return inputString;
}
}
const data = hideEndOfString(des);
document.querySelector(".descriptios").innerHTML = data;
}
</script>