Skip to content

Commit

Permalink
docs(homepage): update styles, deploy script, wait for images
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa committed Sep 18, 2017
1 parent 4f1b4d9 commit 2fcb157
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{
"name": "docs",
"root": "docs",
"outDir": "docs-dist",
"outDir": "docs/dist",
"assets": [
"assets",
"favicon.ico",
Expand Down
41 changes: 27 additions & 14 deletions docs/app/homepage/homepage.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ $mobile: 767px;
background-position: top center;
height: 6720px;
transform: translate3d(0, 0, 0);
will-change: top;
}
section {
min-height: calc(100vh - 90px);
Expand All @@ -172,19 +173,12 @@ $mobile: 767px;
display: flex;
flex-flow: row nowrap;
align-items: center;
opacity: 0.1;
transition: opacity 0.3s ease-in-out;
will-change: opacity;
.txt p {
color: nb-theme(landing-fg-light);
a {
font-weight: nb-theme(font-weight-bold);
}
}

&.current {
opacity: 1;
}
}
.section-container {
width: 100%;
Expand Down Expand Up @@ -362,6 +356,10 @@ $mobile: 767px;
}
border-radius: 12px;
margin-right: 2rem;
margin-bottom: 1rem;
}
.docs {
font-weight: nb-theme(font-weight-bold);
}
.bigger {
margin: 0 0 30px;
Expand Down Expand Up @@ -1130,20 +1128,39 @@ $mobile: 767px;
.hero {
.hero-i {
height: auto;
padding: 50px;
}
padding-top: 30px;
padding-bottom: 50px;
}
section {
margin-bottom: 100px;
}
}

@media (max-width: 500px) {
section {
margin-bottom: 40px;
}
.hero {
margin-top: 0;
padding-top: 0;
.hero-i {
padding: 0;
}
.section-container {
padding: 0;
}
h1 {
display: none;
}
.btn-hero-wrap {
margin-top: 2rem;
text-align: center;
}
.btn-hero {
font-size: 18px;
margin: 1rem;
}
}
.fixed-pseudo-bg {
Expand Down Expand Up @@ -1184,6 +1201,9 @@ $mobile: 767px;
and (min-device-width : 375px)
and (max-device-width : 667px)
and (orientation : landscape) {
.fixed-pseudo-bg {
top: 0!important;
}
.ui-kit {
.row {
flex-direction: column-reverse;
Expand All @@ -1208,10 +1228,3 @@ $mobile: 767px;
}

}







26 changes: 24 additions & 2 deletions docs/app/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Title } from '@angular/platform-browser';
import * as ImageComparison from 'image-comparison';
import 'style-loader!image-comparison/src/ImageComparison.css';
import { Subject } from 'rxjs/Rx';
import { NbSpinnerService } from '@nebular/theme';

@Component({
selector: 'ngd-homepage',
Expand Down Expand Up @@ -92,15 +93,26 @@ export class NgdHomepageComponent implements AfterViewInit, OnInit {
highlightMenu$ = new Subject();

constructor(private renderer: Renderer2,
private spinnerService: NbSpinnerService,
private titleService: Title) {
this.renderer.setProperty(document.body, 'scrollTop', 0);

this.highlightMenu();
this.spinnerService.registerLoader(Promise.all([
this.loadImage('assets/images/hero-img-static.png'),
this.loadImage('assets/images/hero-img/1-2.png'),
this.loadImage('assets/images/hero-img/3-4.png'),
this.loadImage('assets/images/hero-img/5-6.png'),
this.loadImage('assets/images/hero-img/7.png'),
this.loadImage('assets/images/hero-img/8.png'),
this.loadImage('assets/images/hero-img/9.png'),
]).then(() => {
setTimeout(() => this.animated = true, 500);
}));
}

ngOnInit() {
this.titleService.setTitle('Nebular - full featured front-end framework based on Angular.');
setTimeout(() => this.animated = true, 500);
}

ngAfterViewInit() {
Expand Down Expand Up @@ -130,7 +142,7 @@ export class NgdHomepageComponent implements AfterViewInit, OnInit {

private highlightMenu() {
this.highlightMenu$
.debounceTime(100)
.debounceTime(30)
.subscribe(() => {
let closestSection = this.sections.first.nativeElement;
this.sections
Expand Down Expand Up @@ -167,4 +179,14 @@ export class NgdHomepageComponent implements AfterViewInit, OnInit {
html.clientHeight, html.scrollHeight, html.offsetHeight);
return documentHeight / (NgdHomepageComponent.BG_IMAGE_HEIGHT - html.clientHeight);
}

private loadImage(src): Promise<any> {
return new Promise((resolve, reject) => {
let img = new Image();
img.src = src;
img.onload = function () {
resolve(src);
};
});
}
}
5 changes: 3 additions & 2 deletions docs/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"sourceMap": true,
"declaration": false,
Expand All @@ -15,8 +16,8 @@
"baseUrl": ".",
"types": [],
"paths": {
"@nebular/theme": ["./../src/framework/theme"],
"@nebular/theme/*": ["./../src/framework/theme/*"]
"@nebular/theme": ["./framework/theme"],
"@nebular/theme/*": ["./framework/theme/*"]
}
},
"exclude": [
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"repository": "git+https://github.com/akveo/nebular.git",
"scripts": {
"ng": "ng",
"ngh": "ngh",
"start": "ng serve",
"start:hmr": "ng serve --hmr",
"start:aot": "ng serve --aot",
"start:wp:aot": "npm run start:aot -- --app playground-wp",
"docs:serve": "npm run docs:parse && npm run docs:start",
"docs:parse": "gulp docs",
"docs:start": "ng serve --app docs",
"docs:build": "npm run docs:parse && npm run build:prod:aot -- --app docs",
"docs:build": "npm run docs:parse && rimraf docs/dist && npm run build:prod:aot -- --app docs --base-href https://akveo.github.io/nebular/",
"docs:gh-pages": "npm run docs:build && npm run ngh -- --dir ./docs/dist",
"build": "rimraf dist && ng build",
"build:prod": "npm run build -- --prod",
"build:prod:aot": "npm run build:prod -- --aot",
Expand Down

0 comments on commit 2fcb157

Please sign in to comment.