Skip to content

Commit bdd5b88

Browse files
author
Di Wang
committed
add wizard move tab
1 parent 9d5586e commit bdd5b88

File tree

3 files changed

+115
-2
lines changed

3 files changed

+115
-2
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.wizard-panel{
2+
3+
}
4+
5+
.wizard-header{
6+
padding: 25px 0 35px;
7+
}
8+
9+
.wizard-navigation{
10+
position: relative;
11+
}
12+
13+
.nav-pills{
14+
background-color: rgba(200, 200, 200, 0.2);
15+
width: 100%;
16+
}
17+
18+
.nav-pills li{
19+
width: 33.3333%;
20+
float: left;
21+
margin-left: 0;
22+
font-size: 12px;
23+
font-weight: 500;
24+
min-width: 100px;
25+
color: #555;
26+
padding: 10px 0;
27+
}
28+
29+
.move-tab{
30+
position: absolute;
31+
background-color: #f44336;
32+
box-shadow: 0 16px 26px -10px rgba(244, 67, 54, 0.56), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(244, 67, 54, 0.2);
33+
font-weight: 500;
34+
border-radius: 4px;
35+
color: #fff;
36+
top: -2px;
37+
left: -1vw;
38+
width: 35%;
39+
height: 114%;
40+
display: flex;
41+
justify-content: center;
42+
align-items: center;
43+
transition: all 500ms cubic-bezier(0.29, 1.42, 0.79, 1);
44+
}
45+
46+
.wizard-body{
47+
min-height: 350px;
48+
padding: 15px;
49+
}
50+
51+
.wizard-footer{
52+
display: flex;
53+
padding: 10px;
54+
justify-content: space-between;
55+
}
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
<div class="container">
22
<app-navbar title="Wizard"></app-navbar>
33
<div class="row page-title">
4-
4+
<div class="col-md-10 col-md-offset-1">
5+
<div class="wizard-panel card">
6+
<div class="wizard-header">
7+
<h3 class="text-center">Build Your Profile</h3>
8+
<h5 class="text-center" style="margin-top: 5px">This information will let us know more about you.</h5>
9+
</div>
10+
<div class="wizard-navigation">
11+
<ul class="nav nav-pills">
12+
<li class="text-uppercase text-center">About</li>
13+
<li class="text-uppercase text-center">Account</li>
14+
<li class="text-uppercase text-center">Address</li>
15+
</ul>
16+
<div class="move-tab text-center text-uppercase">About</div>
17+
</div>
18+
<div class="wizard-body">
19+
dsds
20+
</div>
21+
<div class="wizard-footer">
22+
<button id="preBtn" class="btn btn-danger" (click)="preOnClick()">Previous</button>
23+
<button id="nextBtn" class="btn btn-success" (click)="nextOnClick()">Next</button>
24+
</div>
25+
</div>
26+
</div>
527
</div>
628
</div>

src/app/dashboard/component/wizard/wizard.component.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,46 @@ import { Component, OnInit } from '@angular/core';
66
styleUrls: ['./wizard.component.css']
77
})
88
export class WizardComponent implements OnInit {
9-
9+
tabIndex = 0;
1010
constructor() { }
1111

1212
ngOnInit() {
13+
const preBtn = <HTMLElement>document.getElementById('preBtn');
14+
preBtn.style.visibility = 'hidden';
15+
}
16+
17+
preOnClick() {
18+
const moveTab = <HTMLElement>document.querySelector('.move-tab');
19+
const nextBtn = <HTMLElement>document.getElementById('nextBtn');
20+
const preBtn = <HTMLElement>document.getElementById('preBtn');
21+
if (this.tabIndex === 2) {
22+
this.tabIndex--;
23+
moveTab.style.left = '20vw';
24+
nextBtn.style.visibility = 'visible';
25+
moveTab.innerHTML = 'Account';
26+
}else if (this.tabIndex === 1) {
27+
this.tabIndex--;
28+
moveTab.style.left = '-1vw';
29+
preBtn.style.visibility = 'hidden';
30+
moveTab.innerHTML = 'About';
31+
}
32+
}
33+
34+
nextOnClick() {
35+
const moveTab = <HTMLElement>document.querySelector('.move-tab');
36+
const nextBtn = <HTMLElement>document.getElementById('nextBtn');
37+
const preBtn = <HTMLElement>document.getElementById('preBtn');
38+
if (this.tabIndex === 0) {
39+
this.tabIndex++;
40+
moveTab.style.left = '20vw';
41+
preBtn.style.visibility = 'visible';
42+
moveTab.innerHTML = 'Account';
43+
}else if (this.tabIndex === 1) {
44+
this.tabIndex++;
45+
moveTab.style.left = '41vw';
46+
nextBtn.style.visibility = 'hidden';
47+
moveTab.innerHTML = 'Address';
48+
}
1349
}
1450

1551
}

0 commit comments

Comments
 (0)