Skip to content

Commit 3a1d90c

Browse files
committed
Initiating doc
1 parent fd072f0 commit 3a1d90c

File tree

78 files changed

+6449
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+6449
-63
lines changed

.angular-cli.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"outDir": "dist",
1010
"assets": [
1111
"assets",
12+
"manifest.json",
1213
"favicon.ico"
1314
],
1415
"index": "index.html",
@@ -19,7 +20,7 @@
1920
"testTsconfig": "tsconfig.spec.json",
2021
"prefix": "app",
2122
"styles": [
22-
"styles.css"
23+
"styles/main.scss"
2324
],
2425
"scripts": [],
2526
"environmentSource": "environments/environment.ts",
@@ -54,7 +55,7 @@
5455
}
5556
},
5657
"defaults": {
57-
"styleExt": "css",
58+
"styleExt": "scss",
5859
"component": {}
5960
}
6061
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve",
7+
"start": "ng serve --host 0.0.0.0 --disable-host-check --ssl -o",
88
"build": "ng build",
99
"test": "ng test",
1010
"lint": "ng lint",
11-
"e2e": "ng e2e"
11+
"e2e": "ng e2e",
12+
"build-prod-ngsw": "ng build --prod && node_modules\\.bin\\ngsw-config dist .\\src\\ngsw-config.json && cp node_modules\\@angular\\service-worker\\ngsw-worker.js .\\dist\\ngsw-worker.js"
1213
},
1314
"private": true,
1415
"dependencies": {
@@ -21,7 +22,10 @@
2122
"@angular/platform-browser": "^4.2.4",
2223
"@angular/platform-browser-dynamic": "^4.2.4",
2324
"@angular/router": "^4.2.4",
25+
"@angular/service-worker": "^5.0.0-rc.2",
26+
"bootstrap": "^4.0.0-beta",
2427
"core-js": "^2.4.1",
28+
"prismjs": "^1.8.1",
2529
"rxjs": "^5.4.2",
2630
"zone.js": "^0.8.14"
2731
},

src/app/app.component.html

Lines changed: 392 additions & 18 deletions
Large diffs are not rendered by default.

src/app/app.component.spec.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/app/app.component.ts

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,75 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
2+
import 'prismjs/prism';
3+
import 'prismjs/components/prism-markup';
4+
import 'prismjs/components/prism-javascript';
5+
import 'prismjs/components/prism-css';
6+
import 'prismjs/components/prism-scss';
7+
import c from './code';
28

39
@Component({
4-
selector: 'app-root',
5-
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.css']
10+
selector: 'doc-root',
11+
templateUrl: './app.component.html'
712
})
8-
export class AppComponent {
9-
title = 'app';
13+
export class AppComponent implements OnInit {
14+
links = {} as any;
15+
fontIconLibraries = [];
16+
svgLibraries = [];
17+
18+
ngOnInit(): any {
19+
this.fontIconLibraries = this.getFontIconLibraries();
20+
this.svgLibraries = this.getSvgLibraries();
21+
}
22+
getFontIconLibraries(): any {
23+
return [
24+
{
25+
name: 'Font awesome',
26+
code: 'checkbox_fonticon_fontawesome',
27+
link: 'http://fontawesome.io/icons/'
28+
},
29+
{
30+
name: 'Bootstrap Glyphicons',
31+
code: 'checkbox_fonticon_glyphicon',
32+
link: 'http://fontawesome.io/icons/'
33+
},
34+
{
35+
name: 'Material icon ( MDI )',
36+
code: 'checkbox_fonticon_mdi',
37+
link: 'https://materialdesignicons.com/'
38+
},
39+
{
40+
name: 'Material icon ( ZMDI )',
41+
code: 'checkbox_fonticon_zmdi',
42+
link: 'http://zavoloklom.github.io/material-design-iconic-font/icons.html'
43+
},
44+
{
45+
name: 'Typeicons',
46+
code: 'checkbox_fonticon_typcn',
47+
link: 'http://www.typicons.com/'
48+
},
49+
{
50+
name: 'Ion icons',
51+
code: 'checkbox_fonticon_ion',
52+
link: 'http://ionicons.com/'
53+
},
54+
{
55+
name: 'Material icon ( Google )',
56+
code: 'checkbox_fonticon_gmdi',
57+
link: 'https://material.io/icons'
58+
}
59+
];
60+
}
61+
getSvgLibraries(): any {
62+
return [{
63+
name: 'UIKit',
64+
code: 'checkbox_svg_uikit',
65+
link: 'https://getuikit.com/docs/icon'
66+
}];
67+
}
68+
r(name): any {
69+
return c[name];
70+
}
71+
onRangeChange(e: any): void {
72+
const fs = e + 'em';
73+
document.getElementById('pretty-scale-test').style.fontSize = fs;
74+
}
1075
}

src/app/app.module.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
34

45
import { AppComponent } from './app.component';
6+
import { PrismComponent } from './prism/prism.component';
7+
import { BackToTopComponent } from './back-to-top/back-to-top.component';
8+
import { DocBlockComponent } from './doc-block/doc-block.component';
9+
import { DocSectionComponent } from './doc-section/doc-section.component';
10+
import { DocCodeComponent } from './doc-code/doc-code.component';
11+
import { DocCollapseComponent } from './doc-collapse/doc-collapse.component';
12+
import { DocContentBlockComponent } from './doc-content-block/doc-content-block.component';
13+
import { DocCodeBlockComponent } from './doc-code-block/doc-code-block.component';
14+
import { DocHeaderComponent } from './doc-header/doc-header.component';
515

616
@NgModule({
717
declarations: [
8-
AppComponent
18+
AppComponent,
19+
PrismComponent,
20+
BackToTopComponent,
21+
DocBlockComponent,
22+
DocCodeComponent,
23+
DocSectionComponent,
24+
DocCollapseComponent,
25+
DocCodeBlockComponent,
26+
DocContentBlockComponent,
27+
DocHeaderComponent
928
],
1029
imports: [
11-
BrowserModule
30+
BrowserModule,
31+
FormsModule,
1232
],
1333
providers: [],
1434
bootstrap: [AppComponent]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div (click)="scrollToTop()" class="animated" [ngClass]="{'slideInUp':showArrow,'slideOutDown':!showArrow}">
2+
<i class="mdi" [ngClass]="{'mdi-arrow-up':showArrow,'mdi-arrow-down':!showArrow}"></i>
3+
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
:host() {
2+
div {
3+
position: fixed;
4+
right: 0;
5+
bottom: 0;
6+
cursor: pointer;
7+
background-color: rgba(166, 178, 185, 0.43);
8+
padding: 0.5em;
9+
&:hover {
10+
background-color: #23527c;
11+
}
12+
}
13+
i {
14+
font-size: 2rem;
15+
line-height: 1;
16+
vertical-align: initial;
17+
margin: 0;
18+
display: inline-block;
19+
color: #fff;
20+
}
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Component, HostListener } from '@angular/core';
2+
3+
@Component({
4+
selector: 'doc-back-to-top',
5+
templateUrl: './back-to-top.component.html',
6+
styleUrls: ['./back-to-top.component.scss']
7+
})
8+
export class BackToTopComponent {
9+
10+
showArrow = false;
11+
@HostListener('window:scroll', ['$event'])
12+
onWinScroll(e) {
13+
const winHeight = window.innerHeight;
14+
const scrolled = window.pageYOffset || document.documentElement.scrollTop;
15+
this.showArrow = scrolled > (winHeight / 2);
16+
}
17+
18+
scrollToTop(): any {
19+
window.scrollTo(0, 0);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)