From 2a5f878608e9cc9e508ab4de70337c2673344596 Mon Sep 17 00:00:00 2001 From: mustafa-rezae Date: Tue, 11 Mar 2025 13:45:25 +0330 Subject: [PATCH] Debug and refactor --- apis/chatApi.js | 8 + assets/chat/scss/chat.scss | 7 +- assets/chat/scss/mixin.scss | 174 +++++++++ assets/chat/scss/placeholder.scss | 225 ++++++++++++ components/chat/components/Group.vue | 380 +++++++++----------- components/chat/components/MobileFooter.vue | 14 +- layouts/default.vue | 241 ------------- layouts/readme.md | 5 - pages/Chat.vue | 158 ++++++++ pages/chat/index.vue | 44 --- pages/chat/pages/Chat.vue | 181 ---------- pages/index.vue | 46 +++ stores/chatStore.ts | 221 ++++++++++++ 13 files changed, 1019 insertions(+), 685 deletions(-) create mode 100644 assets/chat/scss/mixin.scss create mode 100644 assets/chat/scss/placeholder.scss delete mode 100644 layouts/default.vue delete mode 100644 layouts/readme.md create mode 100644 pages/Chat.vue delete mode 100644 pages/chat/index.vue delete mode 100644 pages/chat/pages/Chat.vue create mode 100644 pages/index.vue create mode 100644 stores/chatStore.ts diff --git a/apis/chatApi.js b/apis/chatApi.js index 6fa6c18..473edb2 100644 --- a/apis/chatApi.js +++ b/apis/chatApi.js @@ -22,6 +22,14 @@ export default { leave: 'group/ed/leave', }, + forms:{ + // get:'keyvalue/forms/get', + // list:'keyvalue/forms/list', + // add:'keyvalue/forms/add', + // edit:'keyvalue/forms/edit', + // delete:'keyvalue/forms/delete', + groupTypes:'entity/types/list' + }, lobbies: { list: 'group/ve/get/lobby/1', create: 'group/ed/set', diff --git a/assets/chat/scss/chat.scss b/assets/chat/scss/chat.scss index 3b8e9f4..1932ce2 100644 --- a/assets/chat/scss/chat.scss +++ b/assets/chat/scss/chat.scss @@ -1,5 +1,5 @@ -@import "../../common/scss/mixin"; -@import "../../common/scss/placeholder"; +@import "./mixin.scss"; +@import "./placeholder"; // @import "./javad/list-mixins"; // @import "./javad/list-variables"; @@ -50,7 +50,6 @@ color: #bdc6d0; } } - @import "./components/group/group"; } @@ -70,7 +69,7 @@ opacity: 0.8; .title { - font-family: 'sahel-semi-bold'; + font-family: "sahel-semi-bold"; font-size: 1.3rem; } } diff --git a/assets/chat/scss/mixin.scss b/assets/chat/scss/mixin.scss new file mode 100644 index 0000000..e4ee57c --- /dev/null +++ b/assets/chat/scss/mixin.scss @@ -0,0 +1,174 @@ + +@mixin textOverflow($maxWidth) { + max-width: $maxWidth; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + // &:hover { + // overflow:visible; + // } +} + +@mixin transition($all) { + -webkit-transition: $all; + -ms-transition: $all; + transition: $all; +} + +@mixin flexbox { + display: -webkit-box; + display: -moz-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + +@mixin transform($transforms) { + -webkit-transform: $transforms; + -moz-transform: $transforms; + -ms-transform: $transforms; + transform: $transforms; +} + +@mixin transition($all) { + -webkit-transition: $all; + -ms-transition: $all; + transition: $all; +} +@mixin lineclamp($num) { + display: -webkit-box; + -webkit-line-clamp: $num; + -webkit-box-orient: vertical; + overflow: hidden; +} +@mixin hexagon($color, $width, $height) { + background: $color; + position: relative; + width: $width; + height: $height; + &::before { + content: ""; + position: absolute; + top: -($height / 2) + 1; + left: 0; + width: 0; + height: 0; + border-left: ($width / 2) solid transparent; + border-right: $width / 2 solid transparent; + border-bottom: $height / 2 solid $color; + } + &::after { + content: ""; + position: absolute; + bottom: -($height / 2) + 1; + left: 0; + width: 0; + height: 0; + border-left: $width / 2 solid transparent; + border-right: $width / 2 solid transparent; + border-top: $height / 2 solid $color; + } +} + +@mixin section-backgrounds($pic-address) { + //background-image: url($pic-address); + background-size: cover; + position: relative; + background-position: center; + &::before { + content: " "; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../img/dot-pattern.png"); + z-index: 1; + } + &::after { + content: " "; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba($color: #000000, $alpha: 0.15); + z-index: 1; + } +} +%horizontal-center { + @include flexbox; + align-items: center; +} + +%flex-center { + @include flexbox; + align-items: center; + justify-content: center; +} + +%normal-transition { + @include transition(all 0.3s ease-in-out); +} + +%cover-link { + position: relative; + .cover-link { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: 1; + } +} + +//mixin + +// @mixin bordersolid-w-t-pos($width, $type, $color, $bt: null) { +// @if $bt { +// #{$bt}: $width $type $color; +// } @else { +// border: $width $type $color; +// } +// } + +//mixin - border + +@mixin border-transparent($width) { + border: $width solid transparent; +} +@mixin border($width, $color) { + border: $width solid $color; +} +@mixin border-top($width, $color) { + border-top: $width solid $color; +} +@mixin border-bottom($width, $color) { + border-bottom: $width solid $color; +} + +@mixin border-left($width, $color) { + border-left: $width solid $color; +} +@mixin border-right($width, $color) { + border-right: $width solid $color; +} +// End - mixin - border + +@mixin btn-primary { + @extend %simple-btn; + border-color: var(--color-1); + border-radius: 20px; + min-width: 64px; + font-size: 14px; + height: 32px; +} + +@mixin font-icon-background-color($color) { + background: $color; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} diff --git a/assets/chat/scss/placeholder.scss b/assets/chat/scss/placeholder.scss new file mode 100644 index 0000000..531250e --- /dev/null +++ b/assets/chat/scss/placeholder.scss @@ -0,0 +1,225 @@ + +%horizontal-center { + @include flexbox; + align-items: center; +} + +%flex-center { + @include flexbox; + align-items: center; + justify-content: center; +} + +%normal-transition { + @include transition(all 0.3s ease-in-out); +} + +%cover-link { + position: relative; + + .cover-link { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: 3; + } +} + +%overlay-position { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%); +} + +%fixed-images { + position: absolute; + left: 50%; + top: 50%; + object-fit: cover; + width: 100%; + height: 100%; + transform: translate(-50%, -50%); +} + +%pic-before-hover { + &::before { + content: " "; + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + transition: all 0.3s ease-in-out; + background: radial-gradient( + circle, + rgba(0, 0, 0, 0) 0%, + rgba(0, 0, 0, 0.2413165949973739) 50%, + rgba(0, 0, 0, 0.4514006286108193) 100% + ); + opacity: 0; + z-index: 2; + } +} + +%simple-input { + border: 2px solid #f1f1f1; + color: var(--color-2); + font-size: 18px; + height: 48px; + outline: none; + align-items: center; + border-radius: 10px; + padding-right: 15px; + padding-left: 15px; +} + +%simple-btn { + min-width: 112px; + height: 48px; + border: 2px solid #f1f1f1; + color: var(--color-1); + font-size: 16px; + display: flex; + justify-content: center; + align-items: center; + margin-right: auto; + background: unset; + border-radius: 10px; + transition: all 0.5s ease-in-out; + text-align: left; + + &:hover { + border-color: var(--color-1); + } + + &:disabled { + filter: grayscale(1); + opacity: 0.7; + background-color: #eee; + } +} + +%pastil-color { + .color-1:hover { + a { + border-color: #00b6e3; + } + + i { + background: -webkit-linear-gradient(#00b6e3 0%, #81e6ff 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .active.color-1 { + background-color: #e8fcff; + + a { + border-color: #00b6e3; + } + + i { + background: -webkit-linear-gradient(#00b6e3 0%, #81e6ff 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .color-2:hover { + a { + border-color: #b03bd9; + } + + i { + background: -webkit-linear-gradient(#b03bd9 0%, #dcbbff 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .active.color-2 { + background-color: #fef3ff; + + a { + border-color: #b03bd9; + } + + i { + background: -webkit-linear-gradient(#b03bd9 0%, #dcbbff 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .color-3:hover { + a { + border-color: #fb0; + } + + i { + background: -webkit-linear-gradient(#fb0 0%, #ffdd81 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .active.color-3 { + background-color: #fffbe1; + + a { + border-color: #fb0; + } + + i { + background: -webkit-linear-gradient(#fb0 0%, #ffdd81 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .color-4:hover { + a { + border-color: #39b778; + } + + i { + background: -webkit-linear-gradient(#39b778 0%, #88f57c 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .active.color-4 { + background-color: #e7fce7; + + a { + border-color: #39b778; + } + + i { + background: -webkit-linear-gradient(#39b778 0%, #88f57c 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } + + .active.color-5 { + background-color: #e7fce7; + + a { + border-color: #c1d4da; + } + + i { + background: -webkit-linear-gradient(#c1d4da 0%, #e2e8ef 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + } +} diff --git a/components/chat/components/Group.vue b/components/chat/components/Group.vue index 4208c09..38188cc 100644 --- a/components/chat/components/Group.vue +++ b/components/chat/components/Group.vue @@ -223,7 +223,7 @@ class="d-flex align-items-center align-items-center border-bottom mb-3" v-if="isGroupFilterActive" > - -
+ {{ values.length }} فیلتر
+ > +
چیزی یافت نشد.
@@ -281,7 +281,7 @@ {{ props.option.lable }} --> -
+ - + -->
- - + -->
- - + --> - {{ groupItem.seen_messages.count }} + {{ groupItem.seen_messages?.count }} @@ -602,7 +602,7 @@ :aria-controls="'collapse' + key" >
- - + -->
- - + -->
- Oops! No elements found. Consider changing the search query. --> - +
@@ -923,12 +923,12 @@
- - +
@@ -953,7 +953,7 @@
- - +
چیزی یافت نشد.
@@ -1090,7 +1090,7 @@ {{ props.option.lable }}
--> - + + - - - + + + +
@@ -1258,7 +1260,7 @@
- - + -->
diff --git a/components/chat/components/MobileFooter.vue b/components/chat/components/MobileFooter.vue index a9a9ab4..f7580d1 100644 --- a/components/chat/components/MobileFooter.vue +++ b/components/chat/components/MobileFooter.vue @@ -109,6 +109,7 @@ - - - - diff --git a/layouts/readme.md b/layouts/readme.md deleted file mode 100644 index e11d43e..0000000 --- a/layouts/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -Layouts are wrappers around pages that contain a common User Interface for several pages, such as -a header and footer display. Layouts are Vue files using components to display the page -content. The layouts/default.vue file will be used by default. Custom layouts can be set as part of -your page metadata. -If you only have a single layout in your application, we recommend using app.vue with instead. \ No newline at end of file diff --git a/pages/Chat.vue b/pages/Chat.vue new file mode 100644 index 0000000..7fc2353 --- /dev/null +++ b/pages/Chat.vue @@ -0,0 +1,158 @@ + + + diff --git a/pages/chat/index.vue b/pages/chat/index.vue deleted file mode 100644 index 087e32e..0000000 --- a/pages/chat/index.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/pages/chat/pages/Chat.vue b/pages/chat/pages/Chat.vue deleted file mode 100644 index 9b09d9b..0000000 --- a/pages/chat/pages/Chat.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - - - diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..9726806 --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/stores/chatStore.ts b/stores/chatStore.ts new file mode 100644 index 0000000..621042d --- /dev/null +++ b/stores/chatStore.ts @@ -0,0 +1,221 @@ +import type { ForwardItem } from "~/types/commonTypes"; +import type { + list, + listComponentName, + listId, + selectedItem, + selectedProject, +} from "~/types/listTypes"; + +export const useChatStore = defineStore("chatStore", { + persist: { + storage: piniaPluginPersistedstate.localStorage(), + }, + state: () => ({ + forwardItem: {} as ForwardItem, + + sidebarListStatus: false, + + selectedProject: undefined as selectedProject | undefined, + // isReturnFromItemshowPage: false as isReturnFromItemshowPage, + list: undefined as list | undefined, + listId: undefined as listId | undefined, + listComponentName: "ItemList" as listComponentName | undefined, + // projects: [] as projects[], + // // pieData: [], + selectedItem: undefined as selectedItem | undefined, + // domainActive: undefined as Domain | undefined, + // // activeTab: undefined, + // searchActiveTab: undefined as searchActiveTab | undefined, + // searchSchema: undefined as searchSchema | undefined, + // helpSchema: undefined as helpSchema | undefined, + // searchActiveSchema: undefined as searchActiveTab | undefined, + // helpActiveSchema: undefined as helpActiveSchema | undefined, + // searchListActiveTab: undefined as searchListActiveTab | undefined, + // searchListSchema: undefined as searchListActiveTab[] | undefined, + // activeSearchListSchema: undefined as activeSearchListSchema | undefined, + // searchChartActiveTab: undefined as searchChartActiveTab | undefined, + // searchChartSchema: undefined as searchChartActiveTab[] | undefined, + // activeSearchChartSchema: undefined as activeSearchChartSchema | undefined, + // searchSynonymTitle: undefined as searchSynonymTitle | undefined, + // searchSynonymForm: undefined as searchSynonymForm | undefined, + // selectionFilterItems: [] as selectionFilterItems, + }), + getters: { + getForwardItem: (state) => state.forwardItem, + + sidebarListStatusGetter: (state) => state.sidebarListStatus, + + // projectsGetter(state) { + // return state.projects; + // }, + selectedProjectGetter(state) { + return state.selectedProject; + }, + listIdGetter(state) { + return state.listId; + }, + listComponentNameGetter(state) { + return state.listComponentName; + }, + selectedItemGetter(state) { + return state.selectedItem; + }, + // isReturnFromItemshowPageGetter(state) { + // return state.isReturnFromItemshowPage; + // }, + listGetter(state) { + return state.list; + }, + // searchSynonymTitleGetter(state) { + // return state.searchSynonymTitle; + // }, + // searchSynonymFormGetter(state) { + // return state.searchSynonymForm; + // }, + // domainActiveGetter(state) { + // return state.domainActive; + // }, + // // activeTabGetter(state) { + // // return state.activeTab; + // // }, + // // search page + // searchActiveTabGetter(state) { + // return state.searchActiveTab; + // }, + // searchSchemaGetter(state) { + // return state.searchSchema; + // }, + // helpSchemaGetter(state) { + // return state.helpSchema; + // }, + // helpActiveSchemaGetter(state) { + // return state.helpActiveSchema; + // }, + // searchActiveSchemaGetter(state) { + // return state.searchActiveSchema; + // }, + // // search list + // searchListActiveTabGetter(state) { + // return state.searchListActiveTab; + // }, + // searchListSchemaGetter(state) { + // return state.searchListSchema; + // }, + // searchListActiveSchemaGetter(state) { + // return state.activeSearchListSchema; + // }, + // // search chart + // searchChartActiveTabGetter(state) { + // return state.searchChartActiveTab; + // }, + // searchChartSchemaGetter(state) { + // return state.searchChartSchema; + // }, + // searchChartActiveSchemaGetter(state) { + // return state.activeSearchChartSchema; + // }, + // selectionFilterItemsGetter(state) { + // return state.selectionFilterItems; + // }, + }, + actions: { + SET_FORWARD_ITEM(forwardItem: ForwardItem) { + this.forwardItem = forwardItem; + }, + chatSidebarListStatusReactor(newState: boolean) { + // this.SET_SIDEBAR_LIST_STATUS = newVal; + + this.sidebarListStatus = + newState != undefined || newState != null + ? newState + : !this.sidebarListStatus; + }, + SET_SIDEBAR_LIST_STATUS(newState = undefined) { + this.sidebarListStatus = + newState != undefined || newState != null + ? newState + : !this.sidebarListStatus; + }, + SET_SELECTED_PROJECT(selectedProject = undefined) { + this.selectedProject = selectedProject; + }, + SET_LIST_ID(listId = undefined) { + this.listId = listId; + }, + SET_LIST_COMPONENT_NAME( + payload = { selectedItem: undefined, listComponentName: undefined } + ) { + this.selectedItem = payload.selectedItem; + this.listComponentName = payload.listComponentName; + }, + SET_SELECTED_ITEM(selectedItem = undefined) { + this.selectedItem = selectedItem; + }, + // SET_IS_RETURN_FROM_ITEM_SHOW_PAGE(isReturnFromItemshowPage = false) { + // this.isReturnFromItemshowPage = isReturnFromItemshowPage; + // }, + SET_LIST(list = undefined) { + this.list = list; + }, + // searchSynonymFormSetter(searchSynonymForm = undefined) { + // this.searchSynonymForm = searchSynonymForm; + // }, + // searchSynonymTitleSetter(searchSynonymTitle = undefined) { + // this.searchSynonymTitle = searchSynonymTitle; + // }, + // domainActiveSetter(domain = undefined) { + // this.domainActive = domain; + // }, + // // activeTabSetter(activeTab = undefined) { + // // this.activeTab = activeTab; + // // }, + // // search page + // searchActiveTabSetter(searchActiveTab: searchActiveTab = undefined) { + // this.searchActiveTab = searchActiveTab; + // }, + // searchSchemaSetter(searchSchema = undefined) { + // this.searchSchema = searchSchema; + // }, + // helpSchemaSetter(helpSchema = undefined) { + // this.helpSchema = helpSchema; + // }, + // helpActiveSchemaSetter(helpActiveSchema = undefined) { + // this.helpActiveSchema = helpActiveSchema; + // }, + // searchActiveSchemaSetter(searchActiveSchema = undefined) { + // this.searchActiveSchema = searchActiveSchema; + // }, + // // search list + // searchListActiveTabSetter(searchListActiveTab = undefined) { + // this.searchListActiveTab = searchListActiveTab; + // }, + // searchListSchemaSetter(searchListSchema = undefined) { + // this.searchListSchema = searchListSchema; + // }, + // searchListActiveSchemaSetter(activeSearchListSchema = undefined) { + // this.activeSearchListSchema = activeSearchListSchema; + // }, + // // search chart + // searchChartActiveTabSetter(searchChartActiveTab = undefined) { + // this.searchChartActiveTab = searchChartActiveTab; + // }, + // searchChartSchemaSetter(searchChartSchema = undefined) { + // this.searchChartSchema = searchChartSchema; + // }, + // searchChartActiveSchemaSetter(activeSearchChartSchema = undefined) { + // this.activeSearchChartSchema = activeSearchChartSchema; + // }, + // selectionFilterItemsSetter(selectionFilterItems = []) { + // this.selectionFilterItems = selectionFilterItems; + // }, + }, +}); +// export default { +// namespaced:true, + +// state, +// actions, +// mutations, +// getters +// };