Skip to content

Commit c28b720

Browse files
committed
feat: add carousels
1 parent cccd6d4 commit c28b720

File tree

6 files changed

+114
-2
lines changed

6 files changed

+114
-2
lines changed

src/app/components/components.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ import { Exception404Component } from './exception/404.component';
1515
import { Exception500Component } from './exception/500.component';
1616
import { HomePageComponent } from '@components/homepage/home-page.component';
1717
import { ExcellentProjectComponent } from '@components/homepage/excellent-project/excellent-project.component';
18+
import { HomeCarouselComponent } from '@components/homepage/home-carousel/home-carousel.component';
1819

1920
const COMPONENTS = [
2021
DashboardComponent,
2122
HomePageComponent,
2223
ExcellentProjectComponent,
24+
HomeCarouselComponent,
2325
// passport pages
2426
UserLoginComponent,
2527
UserRegisterComponent,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<nz-carousel nzAutoPlay>
2+
<div nz-carousel-content *ngFor="let item of carousels" class="home-item">
3+
<img [src]="item.url" class="home-item-img">
4+
<div class="home-item-show">
5+
<span class="home-item-show__first">近23万优秀开发者</span>
6+
<span class="home-item-show__second">您的专属云端开发团队</span>
7+
<div>
8+
<span class="button-create" (click)="create()">新建项目</span>
9+
<span class="button-group" (click)="joinGroup()">快速组队</span>
10+
</div>
11+
</div>
12+
</div>
13+
</nz-carousel>`
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/deep/ .carousel {
2+
display: block;
3+
margin-bottom: 50px;
4+
}
5+
6+
.home-item {
7+
position: relative;
8+
9+
&-img {
10+
max-width: 100%;
11+
}
12+
13+
&-show {
14+
position: absolute;
15+
left: 5px;
16+
right: 0;
17+
top: 0;
18+
bottom: 0;
19+
display: flex;
20+
flex-direction: column;
21+
justify-content: center;
22+
23+
&__first {
24+
color: #4688f1;
25+
font-size: 35px;
26+
}
27+
28+
&__second {
29+
font-size: 35px;
30+
color: #18262a;
31+
margin: 16px 0 30px 0;
32+
}
33+
34+
.button-common {
35+
padding: 10px 20px;
36+
cursor: pointer;
37+
}
38+
39+
.button-create {
40+
.button-common;
41+
color: black;
42+
border: 1px solid black;
43+
}
44+
45+
.button-group {
46+
.button-common;
47+
color: #40aea8;
48+
border: 1px solid #40aea8;
49+
margin-left: 20px;
50+
}
51+
}
52+
53+
//max-height: 459px;
54+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Component, HostBinding, Input } from '@angular/core';
2+
import { Router } from '@angular/router';
3+
4+
@Component({
5+
selector: 'page-home-carousel',
6+
templateUrl: './home-carousel.component.html',
7+
styleUrls: ['./home-carousel.component.less']
8+
})
9+
export class HomeCarouselComponent {
10+
@HostBinding('class.carousel') car = true;
11+
12+
constructor(private router: Router) {}
13+
14+
@Input() carousels: Array<object> = [
15+
{
16+
path: '',
17+
url:
18+
'http://img17.3lian.com/d/file/201702/20/d5d692b492df805ad8a4cb61fd1c73d3.jpg'
19+
},
20+
{
21+
path: '',
22+
url:
23+
'http://img17.3lian.com/d/file/201702/20/7d3079c4ca0d11a0126116100d1ca3dd.jpg'
24+
},
25+
{
26+
path: '',
27+
url:
28+
'http://img17.3lian.com/d/file/201702/20/ec4acb80b76b3e84fe58f48b558908d3.jpg'
29+
},
30+
{
31+
path: '',
32+
url:
33+
'http://img17.3lian.com/d/file/201702/20/a7c84a0702d14a073f76dda56f71dec0.jpg'
34+
}
35+
];
36+
37+
create = () => {};
38+
39+
joinGroup = () => {};
40+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
<page-home-carousel></page-home-carousel>
12
<page-excellent-project></page-excellent-project>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { Component } from '@angular/core';
1+
import { Component, HostBinding } from '@angular/core';
22

33
@Component({
44
selector: 'page-home-page',
55
templateUrl: './home-page.component.html'
66
})
7-
export class HomePageComponent {}
7+
export class HomePageComponent {
8+
@HostBinding('style.display') dis = 'block';
9+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy