Browse Source

fix: design corrections

pull/9323/head
DarkPhoenix2704 2 months ago
parent
commit
30a5d73d45
  1. 5
      packages/nc-gui/assets/nc-icons/megaphone.svg
  2. 89
      packages/nc-gui/components/dashboard/Sidebar/Feed.vue
  3. 35
      packages/nc-gui/components/feed/Changelog/Item.vue
  4. 2
      packages/nc-gui/components/feed/Changelog/index.vue
  5. 10
      packages/nc-gui/components/feed/Error.vue
  6. 2
      packages/nc-gui/components/feed/Header.vue
  7. 7
      packages/nc-gui/components/feed/Recents/Card.vue
  8. 0
      packages/nc-gui/components/feed/Twitter.vue
  9. 4
      packages/nc-gui/components/feed/View.vue
  10. 6
      packages/nc-gui/components/feed/Youtube/Player.vue
  11. 9
      packages/nc-gui/components/feed/Youtube/index.vue
  12. 2
      packages/nc-gui/utils/iconUtils.ts

5
packages/nc-gui/assets/nc-icons/megaphone.svg

@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="megaphone">
<path id="Vector" d="M7.19333 5.66732L13.5 1.33398L13.5 14.6673L7.19333 10.334M7.19333 5.66732L2.50003 5.66732L2.5 10.334H4.84667M7.19333 5.66732L7.19333 10.334M7.19333 10.334H4.84667M7.19333 10.334L7.19333 14.0006H4.84667L4.84667 10.334" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 460 B

89
packages/nc-gui/components/dashboard/Sidebar/Feed.vue

@ -31,78 +31,37 @@ const gotoFeed = () => navigateToFeed()
<template> <template>
<div class="px-2 feed-btn py-2"> <div class="px-2 feed-btn py-2">
<div class="flex items-center py-1.5 cursor-pointer px-3 hover:bg-gray-100 bg-[#F0F3FF] rounded-md gap-3" @click="gotoFeed"> <div
<span class="text-[#2952CC] font-semibold">Whats New!</span> class="flex items-center justify-between text-nc-content-brand py-1.5 cursor-pointer px-3 hover:bg-nc-bg-brand-hover bg-nc-bg-brand rounded-lg"
@click="gotoFeed"
<svg >
:class="{ <div class="flex items-center gap-3">
'animation-active': isNewFeedAvailable, <GeneralIcon icon="megaPhone" />
}" <span class="font-semibold">Whats New!</span>
class="sparkle text-yellow-500 w-4 h-4" </div>
viewBox="0 0 24 24"
fill="none" <div v-if="isNewFeedAvailable" class="w-3 h-3 pulsing-dot bg-nc-fill-red-medium border-2 border-white rounded-full"></div>
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.187 8.096L15 5.25L15.813 8.096C16.0231 8.83114 16.4171 9.50062 16.9577 10.0413C17.4984 10.5819 18.1679 10.9759 18.903 11.186L21.75 12L18.904 12.813C18.1689 13.0231 17.4994 13.4171 16.9587 13.9577C16.4181 14.4984 16.0241 15.1679 15.814 15.903L15 18.75L14.187 15.904C13.9769 15.1689 13.5829 14.4994 13.0423 13.9587C12.5016 13.4181 11.8321 13.0241 11.097 12.814L8.25 12L11.096 11.187C11.8311 10.9769 12.5006 10.5829 13.0413 10.0423C13.5819 9.50162 13.9759 8.83214 14.186 8.097L14.187 8.096Z"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6 14.25L5.741 15.285C5.59267 15.8785 5.28579 16.4206 4.85319 16.8532C4.42059 17.2858 3.87853 17.5927 3.285 17.741L2.25 18L3.285 18.259C3.87853 18.4073 4.42059 18.7142 4.85319 19.1468C5.28579 19.5794 5.59267 20.1215 5.741 20.715L6 21.75L6.259 20.715C6.40725 20.1216 6.71398 19.5796 7.14639 19.147C7.5788 18.7144 8.12065 18.4075 8.714 18.259L9.75 18L8.714 17.741C8.12065 17.5925 7.5788 17.2856 7.14639 16.853C6.71398 16.4204 6.40725 15.8784 6.259 15.285L6 14.25Z"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6.5 4L6.303 4.5915C6.24777 4.75718 6.15472 4.90774 6.03123 5.03123C5.90774 5.15472 5.75718 5.24777 5.5915 5.303L5 5.5L5.5915 5.697C5.75718 5.75223 5.90774 5.84528 6.03123 5.96877C6.15472 6.09226 6.24777 6.24282 6.303 6.4085L6.5 7L6.697 6.4085C6.75223 6.24282 6.84528 6.09226 6.96877 5.96877C7.09226 5.84528 7.24282 5.75223 7.4085 5.697L8 5.5L7.4085 5.303C7.24282 5.24777 7.09226 5.15472 6.96877 5.03123C6.84528 4.90774 6.75223 4.75718 6.697 4.5915L6.5 4Z"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
svg { @keyframes pulse {
overflow: visible !important; 0% {
} transform: scale(1);
opacity: 1;
.sparkle path { }
transform-box: fill-box; 50% {
transform-origin: center; transform: scale(1.1);
fill: currentColor; opacity: 0.7;
stroke: currentColor; }
animation-delay: calc((var(--transition) * 1.5) + (var(--delay) * 1s)); 100% {
animation-duration: 0.6s; transform: scale(1);
animation: bounce 2s infinite !important; opacity: 1;
transition: color var(--transition);
}
@keyframes bounce {
35%,
65% {
scale: var(--scale);
} }
}
.sparkle path:nth-of-type(1) {
--scale: 0.5;
--delay: 0.1;
--base: 40%;
}
.sparkle path:nth-of-type(2) {
--scale: 1.5;
--delay: 0.2;
--base: 20%;
} }
.sparkle path:nth-of-type(3) { .pulsing-dot {
--scale: 2.5; animation: pulse 1.5s infinite ease-in-out;
--delay: 0.35;
--base: 30%;
} }
</style> </style>

35
packages/nc-gui/components/feed/Changelog/Item.vue

@ -15,6 +15,8 @@ const {
item: { 'Published Time': CreatedAt, Description, Title, Tags }, item: { 'Published Time': CreatedAt, Description, Title, Tags },
} = props } = props
const truncate = ref(true)
const iconColorMap = { const iconColorMap = {
'Hotfix': { 'Hotfix': {
icon: iconMap.ncTool, icon: iconMap.ncTool,
@ -43,16 +45,16 @@ const renderMarkdown = async (markdown: string) => {
} }
const renderedText = computedAsync(async () => { const renderedText = computedAsync(async () => {
return await renderMarkdown(Description) return await renderMarkdown(truncate.value ? Description.substring(0, 300).concat('...') : Description)
}) })
</script> </script>
<template> <template>
<div class="block px-12 relative"> <div class="block relative">
<div class="relative pb-12"> <div class="relative bg-white">
<div class="aside"> <div class="aside">
<div class="aside-divider"> <div class="aside-divider">
<div class="aside-divider-dot"></div> <div class="aside-divider-dot mt-8"></div>
</div> </div>
<div class="aside-inner"> <div class="aside-inner">
<div class="text-sm text-right pr-8 text-gray-700 leading-5"> <div class="text-sm text-right pr-8 text-gray-700 leading-5">
@ -62,7 +64,7 @@ const renderedText = computedAsync(async () => {
</div> </div>
<div class="content"> <div class="content">
<div class="flex flex-col py-6 gap-5"> <div class="pt-6 pr-6 space-y-5">
<div class="flex items-center"> <div class="flex items-center">
<a <a
v-for="tag in tags" v-for="tag in tags"
@ -106,6 +108,13 @@ const renderedText = computedAsync(async () => {
{{ Title }} {{ Title }}
</NcBadge> </NcBadge>
<div class="prose max-w-none" v-html="renderedText"></div> <div class="prose max-w-none" v-html="renderedText"></div>
<NcButton v-if="truncate" size="small" class="w-29" type="text" @click="truncate = false">
<div class="gap-2 flex items-center">
Show more
<GeneralIcon icon="arrowDown" />
</div>
</NcButton>
</div> </div>
</div> </div>
</div> </div>
@ -119,7 +128,7 @@ const renderedText = computedAsync(async () => {
} }
.content { .content {
@apply !pl-50; @apply !pl-52;
a { a {
@apply !no-underline; @apply !no-underline;
@ -133,29 +142,33 @@ const renderedText = computedAsync(async () => {
h1 { h1 {
@apply !text-3xl !font-bold; @apply !text-3xl !font-bold;
} }
p {
@apply leading-5;
}
} }
} }
.aside { .aside {
@apply absolute left-0 top-1 bottom-2 w-44; @apply absolute left-0 top-0 bottom-0 w-52;
.aside-inner { .aside-inner {
@apply sticky top-6; @apply sticky top-0 pt-5;
} }
.aside-divider { .aside-divider {
@apply absolute top-0 right-0 bottom-0 w-1.5; @apply absolute top-0 right-0 bottom-0 w-1.5 mr-3;
&:before { &:before {
@apply absolute bg-[#E7E7E9] left-0 transform -translate-x-1/2; @apply absolute bg-[#E7E7E9] left-0 transform -translate-x-1/2;
content: ''; content: '';
top: 6px; top: 0px;
bottom: 0px; bottom: 0px;
width: 2px; width: 2px;
border-radius: 2px; border-radius: 2px;
} }
.aside-divider-dot { .aside-divider-dot {
@apply sticky h-5 top-7.5 @apply sticky h-5 mr-3 top-9;
transform: translateY(calc(-50% + 3px)) translateX(50%); transform: translateY(calc(-50% + 3px)) translateX(50%);
&:before { &:before {
@apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2; @apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2;

2
packages/nc-gui/components/feed/Changelog/index.vue

@ -31,7 +31,7 @@ const { isLoading } = useInfiniteScroll(
<GeneralLoader size="xlarge" /> <GeneralLoader size="xlarge" />
</div> </div>
<div v-else class="max-w-300 mx-auto"> <div v-else class="w-[47.75rem] mx-auto">
<FeedChangelogItem v-for="feed in githubFeed" :key="feed.Id" :item="feed" /> <FeedChangelogItem v-for="feed in githubFeed" :key="feed.Id" :item="feed" />
</div> </div>
</div> </div>

10
packages/nc-gui/components/feed/Error.vue

@ -6,12 +6,10 @@ const props = defineProps<{
const { loadFeed, socialFeed, youtubeFeed, githubFeed } = useProductFeed() const { loadFeed, socialFeed, youtubeFeed, githubFeed } = useProductFeed()
const triggerReload = async () => { const triggerReload = async () => {
const data = ( const data = (await loadFeed({
await loadFeed({ type: props.page,
type: props.page, loadMore: false,
loadMore: false, }))!.filter((item) => item['Feed Source'] !== 'Twitter')
})
).filter((item) => item['Feed Source'] !== 'Twitter')
if (props.page === 'all') { if (props.page === 'all') {
socialFeed.value = data socialFeed.value = data

2
packages/nc-gui/components/feed/Header.vue

@ -3,7 +3,7 @@
<template> <template>
<div class="w-full px-3 h-12 border-b-1 border-gray-200 py-2"> <div class="w-full px-3 h-12 border-b-1 border-gray-200 py-2">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<GeneralIcon icon="magic" class="text-yellow-500" /> <GeneralIcon icon="megaPhone" class="text-nc-content-brand" />
<span class="text-gray-800 text-xl font-medium"> Whats New! </span> <span class="text-gray-800 text-xl font-medium"> Whats New! </span>
</div> </div>

7
packages/nc-gui/components/feed/Recents/Card.vue

@ -40,7 +40,7 @@ const renderedText = computedAsync(async () => {
</script> </script>
<template> <template>
<div class="bg-white recent-card border-gray-200 border-1 rounded-2xl" style="width: 656px"> <div class="bg-white recent-card border-gray-200 border-1 rounded-2xl" style="width: 540px">
<div class="flex items-center justify-between px-5 py-4"> <div class="flex items-center justify-between px-5 py-4">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<component :is="feedIcon[source as any]" class="w-4 h-4 stroke-transparent" /> <component :is="feedIcon[source as any]" class="w-4 h-4 stroke-transparent" />
@ -62,7 +62,7 @@ const renderedText = computedAsync(async () => {
<div class="prose px-5 pb-5 mt-5" v-html="renderedText"></div> <div class="prose px-5 pb-5 mt-5" v-html="renderedText"></div>
</template> </template>
<template v-else-if="source === 'Youtube'"> <template v-else-if="source === 'Youtube'">
<YoutubeVue3 :videoid="extractYoutubeVideoId(Url)" :controls="1" :height="410" :width="656" :autoplay="0" /> <YoutubeVue3 :videoid="extractYoutubeVideoId(Url)" :controls="1" :height="330" :width="538" :autoplay="0" />
<div class="p-5 flex flex-col text-gray-900 gap-4"> <div class="p-5 flex flex-col text-gray-900 gap-4">
<div class="text-2xl font-semibold"> <div class="text-2xl font-semibold">
{{ Title }} {{ Title }}
@ -86,9 +86,10 @@ const renderedText = computedAsync(async () => {
h1 { h1 {
@apply text-2xl font-semibold truncate; @apply text-2xl font-semibold truncate;
font-weight: 500;
} }
p { p {
@apply text-md leading-6; @apply text-md text-nc-content-gray-emphasis leading-6;
} }
} }
} }

0
packages/nc-gui/components/feed/Twitter/index.vue → packages/nc-gui/components/feed/Twitter.vue

4
packages/nc-gui/components/feed/View.vue

@ -2,7 +2,7 @@
import FeedRecents from './Recents/index.vue' import FeedRecents from './Recents/index.vue'
import FeedChangelog from './Changelog/index.vue' import FeedChangelog from './Changelog/index.vue'
import FeedYoutube from './Youtube/index.vue' import FeedYoutube from './Youtube/index.vue'
import FeedTwitter from './Twitter/index.vue' import FeedTwitter from './Twitter.vue'
// import FeedRoadmap from './Roadmap.vue' // import FeedRoadmap from './Roadmap.vue'
const { activeTab } = useProductFeed() const { activeTab } = useProductFeed()
@ -48,7 +48,7 @@ const tabs: Array<{
<template> <template>
<FeedHeader /> <FeedHeader />
<FeedSocial v-if="activeTab === 'recents'" class="absolute right-4 top-28" /> <FeedSocial class="absolute right-4 top-28" />
<div class="flex flex-col h-full"> <div class="flex flex-col h-full">
<NcTabs v-model:activeKey="activeTab" centered> <NcTabs v-model:activeKey="activeTab" centered>
<a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full"> <a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full">

6
packages/nc-gui/components/feed/Youtube/Player.vue

@ -18,13 +18,13 @@ const {
<YoutubeVue3 <YoutubeVue3
:videoid="extractYoutubeVideoId(Url)" :videoid="extractYoutubeVideoId(Url)"
class="!rounded-t-xl" class="!rounded-t-xl"
:height="470" :height="330"
:width="764" :width="538"
:autoplay="0" :autoplay="0"
:controls="1" :controls="1"
/> />
<div class="flex flex-col px-3 py-5 gap-4"> <div class="flex flex-col p-5 gap-4">
<div class="text-gray-900 font-bold text-2xl"> <div class="text-gray-900 font-bold text-2xl">
{{ Title }} {{ Title }}
</div> </div>

9
packages/nc-gui/components/feed/Youtube/index.vue

@ -26,7 +26,7 @@ const gotoChannel = () => {
:style="{ :style="{
height: 'calc(100dvh - var(--toolbar-height) - 3rem)', height: 'calc(100dvh - var(--toolbar-height) - 3rem)',
}" }"
class="overflow-y-auto nc-scrollbar-md pt-9 mx-auto w-full" class="overflow-y-auto nc-scrollbar-md mx-auto w-full"
> >
<div v-if="isErrorOccurred?.youtube && !youtubeFeed.length" class="h-full flex justify-center items-center"> <div v-if="isErrorOccurred?.youtube && !youtubeFeed.length" class="h-full flex justify-center items-center">
<FeedError page="youtube" /> <FeedError page="youtube" />
@ -35,11 +35,6 @@ const gotoChannel = () => {
<GeneralLoader size="xlarge" /> <GeneralLoader size="xlarge" />
</div> </div>
<div v-else class="youtube-feed mx-auto"> <div v-else class="youtube-feed mx-auto">
<div class="flex gap-3 items-center mt-4 justify-between">
<span class="text-gray-900 font-semibold"> Recent Videos </span>
<NcButton type="secondary" size="small" @click="gotoChannel"> Go to Youtube </NcButton>
</div>
<div class="flex gap-2 flex-col"> <div class="flex gap-2 flex-col">
<FeedYoutubePlayer v-for="feed in youtubeFeed" :key="feed.Id" :item="feed" /> <FeedYoutubePlayer v-for="feed in youtubeFeed" :key="feed.Id" :item="feed" />
</div> </div>
@ -49,6 +44,6 @@ const gotoChannel = () => {
<style scoped lang="scss"> <style scoped lang="scss">
.youtube-feed { .youtube-feed {
@apply !max-w-[47.75rem]; @apply !max-w-[33.75rem];
} }
</style> </style>

2
packages/nc-gui/utils/iconUtils.ts

@ -152,6 +152,7 @@ import NcControlPanel from '~icons/nc-icons/control-panel'
import NcHome from '~icons/nc-icons/home' import NcHome from '~icons/nc-icons/home'
import NcHome1 from '~icons/nc-icons/home1' import NcHome1 from '~icons/nc-icons/home1'
import NcWorkspace from '~icons/nc-icons/workspace' import NcWorkspace from '~icons/nc-icons/workspace'
import NcMegaPhone from '~icons/nc-icons/megaphone'
import NcCellBarcode from '~icons/nc-icons/cell-barcode' import NcCellBarcode from '~icons/nc-icons/cell-barcode'
import NcCellCheckbox from '~icons/nc-icons/cell-checkbox' import NcCellCheckbox from '~icons/nc-icons/cell-checkbox'
@ -761,6 +762,7 @@ export const iconMap = {
cellAttachment: NcCellAttachment, cellAttachment: NcCellAttachment,
cellButton: NcCellButton, cellButton: NcCellButton,
camera: NcCamera, camera: NcCamera,
megaPhone: NcMegaPhone,
office: NcOffice, office: NcOffice,
sort: Sort, sort: Sort,

Loading…
Cancel
Save