) {
+// toast.add({
+// title: "Success",
+// description: "The form has been submitted.",
+// color: "success",
+// });
+// console.log(event.data);
+// }
// get synonyms
+const synonymIsSwitchedOn = computed(() => {
+ return state.synonym.items.filter((i) => i.enable).length;
+});
+const onClearSynonymClear = () => {
+ search_type.value = "normal";
+ state.synonym.items.forEach((element) => {
+ element.enable = false;
+ });
+};
async function openSynonymPopup(type: string) {
search_type.value = type;
+
console.info("openSynonymPopup");
- sendQuery().then(() => {
+ getSynonyms().then(() => {
isSynonymPopupOpen.value = true;
});
}
+const onTypeSelectChanged = (value: string) => {
+ console.info(value);
+
+ if (value == "translations") typeModelValueFa.value = "ترجمه";
+ else if (value == "arabic") typeModelValueFa.value = "عربی";
+ else if (value == "descriptions") typeModelValueFa.value = "شروح";
+ else typeModelValueFa.value = "همه";
+
+ sendQuery();
+};
+
+const getSynonyms = async () => {
+ let url = repoUrl() + hadithaApi.search.synonym;
+ const payload = {
+ query: searchTerm.value,
+ };
+ // fetch search list from backend(ssr)
+ return await httpService.postRequest(url, payload).then((res) => {
+ state.synonym.items = [];
+
+ Object.entries(res.data).forEach((item, index) => {
+ const synonyms = {} as Synonym;
+ synonyms.title = item[0];
+ synonyms.enable = false;
+ synonyms.enableForm = false;
+
+ const subTitlesStrList = item[1].value.split(",");
+ const subTitlesObjList = subTitlesStrList
+ .filter((i) => i)
+ .map((i) => {
+ return {
+ title: i,
+ active: false,
+ };
+ });
+ synonyms.subTitles = subTitlesObjList;
+ state.synonym.items.push(synonyms);
+ });
+ });
+};
+const prepareSynonym = () => {
+ const enabledSwitches = state.synonym.items.filter((i) => i.enable);
+ const res = {};
+
+ console.info(enabledSwitches);
+
+ enabledSwitches.forEach((item) => {
+ console.info(item);
+
+ if (item.subTitles.length)
+ res[item.title] = item.subTitles
+ .filter((i) => i.active)
+ .map((i) => i.title)
+ .join(",");
+ });
+
+ console.info(res);
+
+ return {
+ synonym: res,
+ };
+};
+const onUpdateSwitch = () => {
+ sendQuery(prepareSynonym());
+};
+const onUpdateSubTitle = (subTitle) => {
+ subTitle.active = !subTitle.active;
+
+ sendQuery(prepareSynonym());
+};
+const onAddNewTitle = (subTitles) => {
+ subTitles.push({
+ active: true,
+ title: Formstate.name,
+ });
+ Formstate.name = "";
+
+ sendQuery(prepareSynonym());
+};
// #endregion methods
+
+onMounted(() => {
+ if (searchTerm.value.length) sendQuery();
+});
@@ -305,7 +437,7 @@ async function openSynonymPopup(type: string) {
v-if="props.showFilter && searchTerm.length"
>
-
+
-
+
+
+ >
+ {{ state.synonym.label }}
+
+
+
+
-
-
- نماز
-
-
-
-
- صلات
-
-
-
- عبادت
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ syn.title }}
+
+
+
+
+ {{ sub.title }}
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- نماز
-
-
-
-
- صلات
-
-
-
- عبادت
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+ -->
+
+
+
-
+
-
-
{{ state.type.label }}
-
-
-
+
+ -->
-
+
+
@@ -542,7 +668,8 @@ async function openSynonymPopup(type: string) {
backdrop-filter: blur(60px);
background: linear-gradient(137.41deg, #ffffff -42.82%, #e5e0ff 87.9%);
filter: blur(60px);
- width: 626px;
+ max-width: 626px;
+ width:100%;
height: 68px;
z-index: 0;
}
@@ -730,6 +857,7 @@ async function openSynonymPopup(type: string) {
}
}
.popover-root-content {
+ overflow-y: auto;
width: 20.5em;
height: 17.75em;
/* gap: 8px; */
@@ -782,6 +910,10 @@ async function openSynonymPopup(type: string) {
border: 0.3px solid #29d985;
color: #626b84;
}
+
+ &[disabled="true"] {
+ filter: grayscale(0.7);
+ }
}
.add-button {
width: 48;
diff --git a/components/haditha/CardList.vue b/components/haditha/CardList.vue
index 98f986d..03821d8 100644
--- a/components/haditha/CardList.vue
+++ b/components/haditha/CardList.vue
@@ -18,7 +18,7 @@ const props = defineProps({
diff --git a/components/haditha/NavigationMenu.vue b/components/haditha/NavigationMenu.vue
index 1f3299a..d1d86a1 100644
--- a/components/haditha/NavigationMenu.vue
+++ b/components/haditha/NavigationMenu.vue
@@ -59,13 +59,17 @@ const items = ref([
{
label: "خروج از حساب",
icon: "i-haditha-logout",
- to: "/haditha/logout",
+ type: "button" as const,
+ onSelect(e: Event) {
+ e.preventDefault();
+ logout();
+ },
},
],
},
]);
-const leftItem = ref([
+const leftItem = computed(() => [
{
label: "نشان شده ها",
icon: "i-haditha-bookmark",
@@ -94,7 +98,11 @@ const leftItem = ref([
{
label: "خروج از حساب",
icon: "i-haditha-logout",
- to: "/haditha/logout",
+ type: "button" as const,
+ onSelect(e: Event) {
+ e.preventDefault();
+ logout();
+ },
},
],
},
@@ -186,22 +194,22 @@ onMounted(() => {
.fixed {
z-index: 999;
.my-navbar {
- max-width: 1200px;
- height: 68px;
- border-radius: 16px;
+ max-width: 75em; //1200px
+ height: 4.25em; // 68px;
+ border-radius: 1em;
border-width: 0.3px;
// justify-content: space-between;
- padding-top: 4px;
- padding-right: 16px;
- padding-bottom: 4px;
- padding-left: 16px;
+ padding-top: 0.25em;
+ padding-right: 1em;
+ padding-bottom: 0.25em;
+ padding-left: 1em;
background-color: #fff;
border: 0.3px solid #e0e0e0;
box-shadow: 0px 4px 15px 0px #0000001a;
@media screen and (max-width: 991.99px) {
- height: 76px;
+ height: 5em; // 76px;
}
nav > div {
@@ -226,23 +234,23 @@ onMounted(() => {
&::before {
background-color: color-mix(in oklab, #00a762 50%, transparent);
box-shadow: 0px 4px 10px 0px #00745933;
- border-radius: 12px;
+ border-radius: 0.75em; //12px;
}
}
// max-width: 112px;
- height: 48px;
+ height: 3.5em;
gap: 4px;
- border-radius: 12px;
- padding-top: 6px;
- padding-right: 16px;
- padding-bottom: 6px;
- padding-left: 16px;
+ border-radius: 0.75em;
+ padding-top: 0.37em; /*6px*/
+ padding-right: 1.2em;
+ padding-bottom: 0.37em; /*6px*/
+ padding-left: 1.2em;
font-family: IRANSansX;
font-weight: 400;
- font-size: 14px;
- line-height: 21px;
+ font-size: 0.87rem; /*14px*/
+ line-height: 1.3rem; /*6px*/
letter-spacing: 0%;
text-align: center;
@@ -260,7 +268,7 @@ onMounted(() => {
}
@media screen and (max-width: 991.99px) {
- height: 60px;
+ height: 5em;
}
}
@@ -285,10 +293,10 @@ onMounted(() => {
gap: 4px;
border-radius: 12px;
- padding-top: 14px;
- padding-right: 16px;
- padding-bottom: 14px;
- padding-left: 16px;
+ padding-top: 0.875em; /*14px*/
+ padding-right: 1em; /*16px*/
+ padding-bottom: 0.875em; /*14px*/
+ padding-left: 1em; /*16px*/
background: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%);
box-shadow: 0px 4px 10px 0px #00745933;
diff --git a/components/haditha/hero-page/SectionFive.vue b/components/haditha/hero-page/SectionFive.vue
index e73c0c9..d41a7c4 100644
--- a/components/haditha/hero-page/SectionFive.vue
+++ b/components/haditha/hero-page/SectionFive.vue
@@ -40,7 +40,7 @@ const state = reactive({