Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add data theme #1684

Merged
merged 3 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _screenshot/data.webp
Binary file not shown.
2 changes: 2 additions & 0 deletions src/app/core/i18n/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const ENUS = {
'app.home.theme.ms.desc': 'For microservice development style',
'app.home.theme.yun': 'Yun',
'app.home.theme.yun.desc': 'Let users focus more on business',
'app.home.theme.data': 'Data',
'app.home.theme.data.desc': 'Mainly dashboard and large screen data view',
'app.header.menu.home': 'Home',
'app.header.menu.docs': 'Docs',
'app.header.menu.components': 'Components',
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/i18n/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const ZHCN = {
'app.home.theme.ms.desc': '面向微服务开发风格的主题',
'app.home.theme.yun': '云',
'app.home.theme.yun.desc': '将功能细节化让用户更聚焦业务',
'app.home.theme.data': '数据',
'app.home.theme.data.desc': '以仪表盘、大屏展示为主',
'app.header.menu.home': '首页',
'app.header.menu.docs': '文档',
'app.header.menu.components': '组件',
Expand Down
14 changes: 7 additions & 7 deletions src/app/routes/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ <h1 data-aos="fade-up" data-aos-once="true">NG-ALAIN</h1>
</div>
</div>
<nz-carousel class="page-banner__img" nzAutoPlay>
@for (i of list; track $index) {
@for (i of allThemes; track $index) {
<div nz-carousel-content>
<a href="{{ i.url }}" target="_blank">
<img src="./assets/screenshot/{{ i.type }}.png" />
<a [attr.href]="i.url" target="_blank">
<img src="./assets/screenshot/{{ i.screenshot }}" />
</a>
</div>
}
Expand Down Expand Up @@ -118,7 +118,7 @@ <h3>{{ 'app.home.feature.demo' | i18n }}</h3>
<div class="page">
<h2>{{ 'app.home.theme' | i18n }}</h2>
<div class="ant-row">
@for (t of themes; track $index) {
@for (t of bussionThemes; track $index) {
<div class="ant-col-xs-24 ant-col-md-12">
<a
class="page-theme__item"
Expand All @@ -127,9 +127,9 @@ <h2>{{ 'app.home.theme' | i18n }}</h2>
data-aos-delay="0"
[attr.data-theme]="t"
>
<img src="./assets/screenshot/{{ t }}.png" />
<h3>{{ 'app.home.theme.' + t | i18n }}</h3>
<p>{{ 'app.home.theme.' + t + '.desc' | i18n }}</p>
<img src="./assets/screenshot/{{ t.screenshot }}" />
<h3>{{ 'app.home.theme.' + t.type | i18n }}</h3>
<p>{{ 'app.home.theme.' + t.type + '.desc' | i18n }}</p>
</a>
</div>
}
Expand Down
22 changes: 16 additions & 6 deletions src/app/routes/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

import { I18NService } from '@core';

interface ThemeItem {
type: string;
url: string;
screenshot: string;
buession: boolean;
}

@Component({
selector: 'app-home',
templateUrl: './home.component.html',
Expand All @@ -33,13 +40,16 @@ import { I18NService } from '@core';
]
})
export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
list = [
{ type: 'basic', url: 'https://ng-alain.github.io/ng-alain' },
{ type: 'pro', url: 'https://e.ng-alain.com/theme/pro' },
{ type: 'ms', url: 'https://e.ng-alain.com/theme/ms' },
{ type: 'yun', url: 'https://e.ng-alain.com/theme/yun' }
allThemes: ThemeItem[] = [
{ type: 'data', url: 'https://e.ng-alain.com/theme/data', screenshot: 'data.webp', buession: true },
{ type: 'basic', url: 'https://ng-alain.github.io/ng-alain', screenshot: 'basic.png', buession: false },
{ type: 'pro', url: 'https://e.ng-alain.com/theme/pro', screenshot: 'pro.png', buession: true },
{ type: 'ms', url: 'https://e.ng-alain.com/theme/ms', screenshot: 'ms.png', buession: true },
{ type: 'yun', url: 'https://e.ng-alain.com/theme/yun', screenshot: 'yun.png', buession: true }
];
themes = ['pro', 'ms', 'yun'];
get bussionThemes(): ThemeItem[] {
return this.allThemes.filter(w => w.buession);
}
get isBrowser(): boolean {
return this.platform.isBrowser;
}
Expand Down
Binary file added src/assets/screenshot/data.webp
Binary file not shown.