Skip to content

Commit e393a94

Browse files
authored
Merge pull request #149 from SoftStackFactory/dev
Dev
2 parents 4db4cc2 + 0271c55 commit e393a94

22 files changed

Lines changed: 507 additions & 846 deletions

File tree

src/assets/imgs/blueline.png

275 Bytes
Loading
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
<!-- Generated template for the TimelineComponent component -->
2+
23
<div class="timeline">
34

4-
<ion-list>
5+
<ion-list class="border-thingy">
56
<ng-template #recursiveList let-list>
6-
<!-- <div class="cd-timeline__img cd-timeline__img--5"></div> -->
77
<ion-list *ngFor="let item of list">
88

9-
<h2 *ngIf="!item.checkmark" (click)="toggleItem(item)">{{item.title}} </h2>
10-
11-
<ion-item *ngIf="item.checkmark">
9+
<ion-item *ngIf="!item.checkmark" (click)="toggleItem(item)" no-padding>
10+
<div *ngIf="item.dot" class="cd-timeline__img cd-timeline__img--5"></div>
11+
<h2>{{item.title}}</h2>
12+
</ion-item>
13+
14+
<ion-item *ngIf="item.checkmark" no-padding>
1215
<ion-label>{{item.title}}</ion-label>
1316
<ion-checkbox color="dark" checked="false"></ion-checkbox>
1417
</ion-item>
1518

1619
<ion-item *ngIf="item.itemExpand && item.children.length > 0 && !item.checkmark">
1720
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container>
1821
</ion-item>
19-
<!-- <ion-item *ngIf="item.checkmark">
20-
<ion-checkbox color="dark" checked="false"></ion-checkbox>
21-
</ion-item> -->
22+
2223
</ion-list>
2324
</ng-template>
2425
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: list }"></ng-container>
2526
</ion-list>
2627

27-
<!-- <ng-content></ng-content>
28-
29-
<timeline-item>
30-
<ion-icon class="" [name]="endIcon"></ion-icon>
31-
</timeline-item> -->
32-
3328
</div>

src/components/timeline/timeline.scss

Lines changed: 38 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,43 @@ timeline {
1515
position: absolute;
1616
top: 0;
1717
left: 0;
18-
width: 40px;
19-
height: 40px;
18+
width: 25px;
19+
height: 25px;
20+
z-index: 1000;
2021
border-radius: 50%;
21-
-webkit-box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
22-
box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
22+
// -webkit-box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
23+
// box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
2324
}
2425

25-
.cd-timeline__img img {
26-
display: block;
27-
width: 24px;
28-
height: 24px;
29-
position: relative;
30-
left: 50%;
31-
top: 50%;
32-
margin-left: -12px;
33-
margin-top: -12px;
34-
}
3526

3627
.cd-timeline__img.cd-timeline__img--5 {
3728
background: #64c5b1;
3829
}
3930

31+
.item-ios h2:last-child, .item-ios h3:last-child, .item-ios h4:last-child, .item-ios h5:last-child, .item-ios h6:last-child, .item-ios p:last-child {
32+
padding-left: 3%;
33+
}
34+
35+
.item-ios{
36+
background-color: transparent !important;
37+
padding-left: 10px !important;
38+
}
39+
40+
.item-checkbox {
41+
margin-left: 10%;
42+
}
43+
44+
.border-thingy {
45+
padding-left: 5%;
46+
}
4047
.timeline {
41-
margin: 30px 0 0 0;
48+
margin-top: 30px;
4249
padding: 0;
4350
position: relative;
51+
background-image: url('../assets/imgs/blueline.png');
52+
background-repeat: repeat-y;
53+
background-position: 6.2% top;
4454

45-
&:before {
46-
content: '';
47-
position: absolute;
48-
top: 0;
49-
bottom: 0;
50-
width: 10px;
51-
background: #afdcf8;
52-
left: 20%;
53-
margin-left: -10px;
54-
}
5555
timeline-item {
5656
position: relative;
5757
display: inline-block;
@@ -114,27 +114,23 @@ timeline {
114114
}
115115
}
116116

117+
@media screen and (min-width:1024px){
118+
background-position: 5.89% top;
119+
}
117120

118-
.list-ios > .item-block:last-child, .list-ios > .item-wrapper:last-child .item-block{
119-
border-bottom: none;
121+
@media screen and (min-width:1360px){
122+
background-position: 5.7% top;
120123
}
121124

122-
.list-ios > .item-block:first-child {
123-
border-top: none;
125+
.list-ios, .item-block, .item-inner {
126+
border-bottom: none !important;
127+
border-top: none !important;
124128
}
125129

126130
.list-ios {
127-
margin: -1px 0 20px !important;
131+
margin: -1px 0 15px !important;
128132
}
129133

130-
131-
132-
&:before {
133-
left: 3% !important;
134-
}
135-
.list, .list-md{
136-
margin-left:3% !important;
137-
}
138134

139135
.item.item-md .checkbox-md {
140136
margin: -6px 14px 8px -35px !important;
@@ -143,83 +139,16 @@ timeline {
143139
}
144140

145141
.checkbox-ios {
146-
// position: absolute !important;
147142
margin: -6px 14px 8px -35px !important;
148143
padding-left: 4%;
149144
padding-top: 2%;
150145
}
151-
152146

153-
@media screen and (max-width: map-get($grid-breakpoints,'lg')){
154-
.list-ios{
155-
margin-top: -1px;
156-
margin-right: 25px;
157-
margin-bottom: 32px;
158-
margin-left: 25px;
159-
}
160-
timeline-item{
161-
timeline-time{
162-
font-size: 0.7em;
163-
}
164-
}
147+
.item-ios h2:last-child, .item-ios h3:last-child, .item-ios h4:last-child, .item-ios h5:last-child, .item-ios h6:last-child, .item-ios p:last-child {
148+
padding-left: 6% !important;
165149
}
166-
@media screen and (max-width: map-get($grid-breakpoints,'md')){
167-
&:before{
168-
left: 30px;
169-
}
170-
timeline-item{
171-
ion-card{
172-
margin-left: 80px !important;
173-
}
174-
ion-icon{
175-
left: 30px;
176-
}
177-
timeline-time{
178-
font-size: 0.8em;
179-
width: 100%;
180-
left: 80px;
181-
position: relative;
182-
span{
183-
text-align: left;
184-
}
150+
185151

186-
}
187-
}
188-
}
189-
@media screen and (max-width: map-get($grid-breakpoints, 'sm' )){
190-
&:before{
191-
display: none;
192-
}
193-
timeline-item{
194-
&:last-child{
195-
visibility: hidden;
196-
}
197-
ion-icon{
198-
position: relative;
199-
float: right;
200-
left: auto;
201-
margin: -55px 5px 0 0;
202-
&:after{
203-
border-left-color: transparent;
204-
border-top-color: #afdcf8;
205-
top: 46px;
206-
left: 10px;
207-
}
208-
}
209-
timeline-time{
210-
width: 100%;
211-
position: relative;
212-
padding: 0 0 20px 0;
213-
left: 20px;
214-
span{
215-
text-align: left;
216-
}
217-
}
218152

219-
ion-card{
220-
width: calc(100% - 20px) !important;
221-
margin-left: 10px !important;
222-
}
223-
}
224-
}
153+
225154
}

src/components/timeline/timeline.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export class TimelineComponent {
5858
]
5959
}
6060
],
61-
itemExpand: false
61+
itemExpand: false,
62+
dot: true
6263
},
6364
{
6465
title: 'Starting Up',
@@ -102,25 +103,29 @@ export class TimelineComponent {
102103
]
103104
}
104105
],
105-
itemExpand: false
106+
itemExpand: false,
107+
dot: true
106108
},
107109
{
108110
title: 'Taking care of myself',
109111
checkmark: false,
110112
children: [],
111-
itemExpand: false
113+
itemExpand: false,
114+
dot: true
112115
},
113116
{
114117
title: 'Reinventing myself',
115118
checkmark: false,
116119
children: [],
117-
itemExpand: false
120+
itemExpand: false,
121+
dot: true
118122
},
119123
{
120124
title: 'Putting down roots',
121125
checkmark: false,
122126
children: [],
123-
itemExpand: false
127+
itemExpand: false,
128+
dot: true
124129
}
125130
];
126131

src/pages/dashboard/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h1 id="hello" text-center>Hello, Austin!</h1>
4848
are.
4949
<br>
5050
<br>
51-
<a id="separationLink">See what's next
51+
<a (click)="toTimeline()" id="separationLink">See what's next
5252
<ion-icon class="linkIcons" name="arrow-round-forward"></ion-icon>
5353
</a>
5454
</ion-card-content>

src/pages/dashboard/dashboard.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ page-dashboard {
4242
justify-content: center
4343
}
4444

45-
#lifeWheel {
46-
width: 250px;
47-
height: 250px;
48-
}
49-
5045
#networkingContent {
5146
padding: 0px 16px;
5247
display: flex;

src/pages/dashboard/dashboard.ts

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { NavController, NavParams } from 'ionic-angular';
33
import { Chart } from 'chart.js';
44
import 'chartjs-plugin-datalabels';
55

6+
import { TimelinePage} from '../timeline/timeline';
7+
68

79
/**
810
* Generated class for the DashboardPage page.
@@ -23,7 +25,31 @@ export class DashboardPage {
2325
constructor(public navCtrl: NavController, public navParams: NavParams) {
2426
}
2527

26-
ionViewDidLoad() {
28+
/** This block of code is for everything contained in ionViewDidLoad right below it
29+
*
30+
Everything above the options property in the chart code below relates to the chart data. Everything below that property modifies the display in some way.
31+
32+
Everything below the plugins property in options relates to the snazzy labels that surround the chart.
33+
34+
The layout.padding property gives room for the snazzy labels.
35+
36+
In plugins.datalabels:
37+
38+
anchor, align, and offset are all used to position the labels. the anchor value sets the anchor point from which you'll relate a label's position
39+
align defines what direction you'll position your labels relative to the anchor point
40+
offset defines how far away from the anchor point you will position the labels
41+
For more explanation: https://chartjs-plugin-datalabels.netlify.com/positioning.html
42+
43+
Some properties have functions as their values. This makes the values dynamic, changing based on certain conditions.
44+
You'll notice that the functions take an argument called context. This object contains helpful information about the chart. Console log it if you're curious!
45+
46+
The "rotation" property is what rotates the labels to match where they are around the graph
47+
The "BorderRadius property " controls how round the edges of the label containers are.
48+
The "Font" and "Offset" functions scale the font and positioning according to the chart's width.
49+
The "Formatter" property is what allows us to display the data names and values.
50+
*/
51+
52+
ionViewDidLoad() {
2753
this.chart = new Chart(this.canvas.nativeElement, {
2854
type: 'polarArea',
2955
data: {
@@ -47,20 +73,22 @@ export class DashboardPage {
4773
legend: {
4874
display: false
4975
},
76+
5077
plugins: {
5178
datalabels: {
5279
textAlign: 'center',
5380
anchor: 'start',
5481
align: 'end',
5582
offset: function (context) {
56-
let chart = context.chart.width;
57-
return chart / 3.6 - 55;
58-
},
59-
backgroundColor: function (context) {
60-
return ["rgba(0,0,255, .2)", "rgba(255,0,0, .2)", "rgba(128,0,128, .2)", "rgba(0,128,0, .2)", "rgba(255,165,0, .2)", "rgba(0,128,128, .2)", "rgba(255,0,255, .2)", "rgba(0,255,0, .2)"];
83+
let chartWidth = context.chart.width;
84+
return chartWidth / 3.6 - 55;
6185
},
86+
backgroundColor: ["rgba(0,0,255, .2)", "rgba(255,0,0, .2)", "rgba(128,0,128, .2)", "rgba(0,128,0, .2)", "rgba(255,165,0, .2)", "rgba(0,128,128, .2)", "rgba(255,0,255, .2)", "rgba(0,255,0, .2)"],
6287
borderColor: 'black',
63-
rotation: function (context) { if (context.dataIndex === 0 || context.dataIndex === 1 || context.dataIndex === 6 || context.dataIndex === 7) { return 45 / 2 + (45 * context.dataIndex) } else { return 45 / 2 + (45 * context.dataIndex) + 180 } },
88+
rotation: function (context) {
89+
if (context.dataIndex === 0 || context.dataIndex === 1 || context.dataIndex === 6 || context.dataIndex === 7) { return 45 / 2 + (45 * context.dataIndex) }
90+
else { return 45 / 2 + (45 * context.dataIndex) + 180 }
91+
},
6492
borderRadius: 5,
6593
borderWidth: 0,
6694
color: 'black',
@@ -87,4 +115,7 @@ export class DashboardPage {
87115
this.chart.update();
88116
}
89117

118+
toTimeline() {
119+
this.navCtrl.setRoot(TimelinePage);
120+
}
90121
}

0 commit comments

Comments
 (0)