From c217ed82c98d6111b0dc0b2c5596a76de72ab6c3 Mon Sep 17 00:00:00 2001 From: nguyen van thai Date: Thu, 6 Jun 2024 13:29:22 +0700 Subject: [PATCH] =?UTF-8?q?thainnv-dev:=20Nh=C3=BAng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/styles/custom.css | 2 +- assets/styles/style.scss | 26 ++++++--- .../article/immerse/ArticleRelation.vue | 22 ++++++++ components/article/immerse/Attachment.vue | 14 +++++ components/article/immerse/Document.vue | 14 +++++ components/article/immerse/Poll.vue | 56 +++++++++++++++++++ components/article/immerse/Quiz.vue | 6 ++ components/article/immerse/Survey.vue | 6 ++ components/article/immerse/Tag.vue | 15 +++++ .../templates/other/breadcrumb/Default.vue | 22 ++++++-- .../templates/other/details/default.vue | 48 ++++++++++++++-- .../templates/other/details/emagazine.vue | 6 +- .../templates/other/details/infographics.vue | 6 +- .../pageCategories/collection_page.vue | 19 +------ pages/bai-viet/[slug].vue | 4 ++ pages/index.vue | 2 + server/api/services/[...].ts | 7 ++- server/models/articles/index.ts | 2 +- server/models/dynamic-page/index.ts | 2 +- server/models/poll-option.ts | 22 ++++++++ server/models/poll-response.ts | 24 ++++++++ server/models/poll.ts | 43 ++++++++++++++ stores/poll-option.ts | 20 +++++++ stores/poll-response.ts | 19 +++++++ stores/poll.ts | 20 +++++++ 25 files changed, 382 insertions(+), 45 deletions(-) create mode 100644 components/article/immerse/ArticleRelation.vue create mode 100644 components/article/immerse/Attachment.vue create mode 100644 components/article/immerse/Document.vue create mode 100644 components/article/immerse/Poll.vue create mode 100644 components/article/immerse/Quiz.vue create mode 100644 components/article/immerse/Survey.vue create mode 100644 components/article/immerse/Tag.vue create mode 100644 server/models/poll-option.ts create mode 100644 server/models/poll-response.ts create mode 100644 server/models/poll.ts create mode 100644 stores/poll-option.ts create mode 100644 stores/poll-response.ts create mode 100644 stores/poll.ts diff --git a/assets/styles/custom.css b/assets/styles/custom.css index ae0f44b..497f5ab 100644 --- a/assets/styles/custom.css +++ b/assets/styles/custom.css @@ -40,7 +40,7 @@ img.wide { margin-left: 0; max-width: 70%; width: 70%; - transform: translateX(20%); + /* transform: translateX(20%); */ } figure.image.wide { diff --git a/assets/styles/style.scss b/assets/styles/style.scss index 01e458b..5d710a1 100644 --- a/assets/styles/style.scss +++ b/assets/styles/style.scss @@ -11,17 +11,27 @@ figure { margin: auto !important; } +.content { + & p { + @apply mb-2; + } + + & audio { + @apply w-full; + } + + & a { + @apply text-primary-600 underline; + } + + & document { + @apply cursor-pointer text-primary-600 underline; + } +} div[layout="ARTICLE_DETAIL_EMAGAZINE"] { & p,& figure.align-center-image, & #sub, & #title, & #intro { @apply lg:max-w-640px mx-auto; } +} - // @at-root .section_layout{ - - // & div[layout="BREADCRUM_DEFAULT"] { - // @apply lg:max-w-640px mx-auto; - // } - // } - -} \ No newline at end of file diff --git a/components/article/immerse/ArticleRelation.vue b/components/article/immerse/ArticleRelation.vue new file mode 100644 index 0000000..54de5a7 --- /dev/null +++ b/components/article/immerse/ArticleRelation.vue @@ -0,0 +1,22 @@ + + + \ No newline at end of file diff --git a/components/article/immerse/Attachment.vue b/components/article/immerse/Attachment.vue new file mode 100644 index 0000000..58bf8bf --- /dev/null +++ b/components/article/immerse/Attachment.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/components/article/immerse/Document.vue b/components/article/immerse/Document.vue new file mode 100644 index 0000000..58bf8bf --- /dev/null +++ b/components/article/immerse/Document.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/components/article/immerse/Poll.vue b/components/article/immerse/Poll.vue new file mode 100644 index 0000000..f177f4c --- /dev/null +++ b/components/article/immerse/Poll.vue @@ -0,0 +1,56 @@ + + \ No newline at end of file diff --git a/components/article/immerse/Quiz.vue b/components/article/immerse/Quiz.vue new file mode 100644 index 0000000..d02bc47 --- /dev/null +++ b/components/article/immerse/Quiz.vue @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/components/article/immerse/Survey.vue b/components/article/immerse/Survey.vue new file mode 100644 index 0000000..e10ba2d --- /dev/null +++ b/components/article/immerse/Survey.vue @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/components/article/immerse/Tag.vue b/components/article/immerse/Tag.vue new file mode 100644 index 0000000..8e93693 --- /dev/null +++ b/components/article/immerse/Tag.vue @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/components/dynamic-page/page-component/templates/other/breadcrumb/Default.vue b/components/dynamic-page/page-component/templates/other/breadcrumb/Default.vue index 2150d7a..d51b547 100644 --- a/components/dynamic-page/page-component/templates/other/breadcrumb/Default.vue +++ b/components/dynamic-page/page-component/templates/other/breadcrumb/Default.vue @@ -2,30 +2,40 @@ import { useDynamicPageStore } from "~/stores/dynamic-page"; if(!localStorage.getItem('step')) { - localStorage.setItem('step', 0) + localStorage.setItem('step', '0') } -useDynamicPageStore().step = localStorage.getItem('step') ?? 0 +useDynamicPageStore().step = Number(localStorage.getItem('step')) ?? 0 function increase() { useDynamicPageStore().step = Number(useDynamicPageStore().step) + 2 - localStorage.setItem('step', useDynamicPageStore().step) + localStorage.setItem('step', useDynamicPageStore().step.toString()) } function decrease() { useDynamicPageStore().step = Number(useDynamicPageStore().step) - 2 - localStorage.setItem('step', useDynamicPageStore().step) + localStorage.setItem('step', useDynamicPageStore().step.toString()) } +onMounted(() => { + let detailEmagazine = document.querySelector('div[layout="ARTICLE_DETAIL_EMAGAZINE"]') + let breakcrumb = document.querySelector('div[layout="BREADCRUM_DEFAULT"]') + if( detailEmagazine && breakcrumb) { + breakcrumb.classList.add('lg:max-w-640px','mx-auto') + } + + console.log('b') +}) +