File tree 4 files changed +134
-8
lines changed
app/homepage/api/api-list
4 files changed +134
-8
lines changed Original file line number Diff line number Diff line change 2
2
< h1 >
3
3
API List
4
4
</ h1 >
5
- < section #content > </ section >
6
- < section *ngFor ="let section of apiSection | async ">
7
- < h3 > {{ section.title }}</ h3 >
5
+ < section class ="api-list " *ngFor ="let section of apiSection | async ">
6
+ < h2 >
7
+ < a [href] ="'/api/' + section.name "> {{ section.name }}</ a >
8
+ </ h2 >
8
9
< ul >
9
10
< li class ="api-list-item " *ngFor ="let item of section.items ">
10
- < a [href] ="'/api/' + section.name + '/' + item.title "> {{ item.docType }} - {{ item.title }} </ a >
11
+ < a [href] ="'/api/' + section.name + '/' + item.title ">
12
+ < span class ="symbol {{ item.docType }} "> </ span >
13
+ < span class ="item-title ">
14
+ {{ item.title }}
15
+ </ span >
16
+ </ a >
11
17
</ li >
12
18
</ ul >
13
19
</ section >
Original file line number Diff line number Diff line change
1
+ @import ' ../../../../scss/variables.scss' ;
2
+
3
+ .api-list {
4
+ width : 80% ;
5
+ margin-left : 10% ;
6
+ }
7
+
1
8
.api-list-item {
2
9
list-style : none ;
3
10
display : inline-block ;
7
14
8
15
ul {
9
16
padding : 0 ;
10
- }
17
+ }
18
+
19
+ a {
20
+ color : $black-color ;
21
+ display : inline-block ;
22
+ line-height : 16px ;
23
+ overflow : hidden ;
24
+ text-overflow : ellipsis ;
25
+
26
+ .item-title {
27
+ padding : 0 5px ;
28
+ position : relative ;
29
+ top : 2px ;
30
+ }
31
+ }
32
+
33
+ h2 {
34
+ a {
35
+ font-size : 24px ;
36
+ color : $red-color ;
37
+ }
38
+ }
39
+
40
+ .symbol {
41
+ border-radius : 2px ;
42
+ box-shadow : 0 1px 2px rgba ($black-color , .24 );
43
+ color : $white-color ;
44
+ display : inline-block ;
45
+ font-size : 10px ;
46
+ font-weight : 600 ;
47
+ line-height : 16px ;
48
+ text-align : center ;
49
+ width : 16px ;
50
+
51
+ // SYMBOL TYPES
52
+ // Symbol mapping variables in *constants*
53
+ @each $name , $symbol in $api-symbols {
54
+ & .#{$name } {
55
+ background : map-get ($symbol , background );
56
+
57
+ & :before {
58
+ content : map-get ($symbol , content );
59
+ }
60
+ }
61
+ }
62
+ }
Original file line number Diff line number Diff line change 1
1
import { Component , OnInit } from '@angular/core' ;
2
- import { Observable , from } from 'rxjs' ;
2
+ import { Observable } from 'rxjs' ;
3
3
import { ApiSection , ApiService } from '../api.service' ;
4
- import { map , switchMap } from 'rxjs/operators' ;
5
- import { isNgTemplate } from '@angular/compiler' ;
6
4
7
5
@Component ( {
8
6
selector : 'app-api-list' ,
Original file line number Diff line number Diff line change @@ -6,3 +6,73 @@ $grey-color: #404040;
6
6
$darkgrey-color : #272727 ;
7
7
$black-color : #151515 ;
8
8
$red-color : #ed2945 ;
9
+ $blue-color : #2196F3 ;
10
+ $dark-blue-color : #0D47A1 ;
11
+ $pink-color : #D81B60 ;
12
+ $amber-color : #FFA000 ;
13
+ $orange-color : #fb8c00 ;
14
+ $green-color : #4CAF50 ;
15
+ $teal-color : #009688 ;
16
+ $purple-color : #8E24AA ;
17
+ $light-green-color : #7CB342 ;
18
+ $blue-grey-color : #546E7A ;
19
+
20
+
21
+ $api-symbols : (
22
+ all : (
23
+ content : ' ' ,
24
+ background : $white-color
25
+ ),
26
+ class : (
27
+ content : ' C' ,
28
+ background : $dark-blue-color
29
+ ),
30
+ const : (
31
+ content : ' K' ,
32
+ background : $grey-color
33
+ ),
34
+ decorator : (
35
+ content : ' @' ,
36
+ background : $blue-color
37
+ ),
38
+ enum : (
39
+ content : ' E' ,
40
+ background : $amber-color
41
+ ),
42
+ function : (
43
+ content : ' F' ,
44
+ background : $green-color
45
+ ),
46
+ interface : (
47
+ content : ' I' ,
48
+ background : $teal-color
49
+ ),
50
+ let : (
51
+ content : ' K' ,
52
+ background : $grey-color
53
+ ),
54
+ nestmodule : (
55
+ content : ' M' ,
56
+ background : $red-color
57
+ ),
58
+ injectable : (
59
+ content : ' I' ,
60
+ background : $orange-color
61
+ ),
62
+ package : (
63
+ content : ' Pk' ,
64
+ background : $purple-color
65
+ ),
66
+ pipe : (
67
+ content : ' P' ,
68
+ background : $blue-grey-color
69
+ ),
70
+ type-alias : (
71
+ content : ' T' ,
72
+ background : $light-green-color
73
+ ),
74
+ var : (
75
+ content : ' K' ,
76
+ background : $grey-color
77
+ ),
78
+ );
You can’t perform that action at this time.
0 commit comments