Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Misc #41

Open
wants to merge 2 commits into
base: rework
Choose a base branch
from
Open

Misc #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<router-outlet></router-outlet>
<app-navigation-header></app-navigation-header>
<hero-banner [title]="currentTitle" [tagline]="currentTagline"></hero-banner>
<router-outlet (activate)="componentAdded($event)"></router-outlet>
19 changes: 10 additions & 9 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { ProjectsService } from './shared/projects.service';
import { ActivatedRoute } from "@angular/router";
import {PageScrollConfig} from 'ng2-page-scroll';
import { NavigationHeaderComponent } from "app/shared/navigation-header/navigation-header.component";


@Component({
selector: 'app-root',
Expand All @@ -10,21 +12,20 @@ import {PageScrollConfig} from 'ng2-page-scroll';
providers: [ProjectsService]
})
export class AppComponent implements OnInit {

currentTitle: string = "You dream it. We build it";
currentTagline = "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding.";

constructor(private route: ActivatedRoute) {
PageScrollConfig.defaultDuration = 500;

}

ngOnInit() {
this.route.fragment.subscribe(f => {
let element = null;
if (f)
element = document.querySelector("#" + f)
if (element)
element.scrollIntoView(element)
})

}

componentAdded($event){
this.currentTitle = $event.route && $event.route.snapshot.data['title'] || this.currentTitle;
this.currentTagline = $event.route && $event.route.snapshot.data['tagline'] || this.currentTagline;
}

}
14 changes: 9 additions & 5 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ import {Ng2PageScrollModule} from 'ng2-page-scroll';

const routes: Routes = [
{path:'', redirectTo:'home', pathMatch:'full'},
{path:'home', component: HomePageComponent},
{path:'about', component: AboutPageComponent},
{path:'password-reset', component: ForgotPasswordPageComponent},
{path:'register', component: SignupPageComponent},
{path:'login', component: LoginPageComponent}
{
path:'home',
data: {title: "You dream it. We build it", tagline: "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding."},
component: HomePageComponent
},
{path:'about', data: {title: "You dream it. We build it", tagline: "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding."}, component: HomePageComponent},
{path:'password-reset', data: {title: "You dream it. We build it", tagline: "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding."}, component: ForgotPasswordPageComponent},
{path:'register', data: {title: "You dream it. We build it", tagline: "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding."}, component: SignupPageComponent},
{path:'login', data: { title: 'Sign up now!', tagline: 'Login now to get started.' }, component: LoginPageComponent}
];

@NgModule({
Expand Down
4 changes: 2 additions & 2 deletions src/app/home-page/hero-banner/hero-banner.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div class="bg-main"></div>
<div class="bg-additional"></div>
<div class="wrap-max1140px row middle-xs">
<h1 class="col-xs-12 center-xs t-white">You dream it. We build it<span class="t-red">_</span></h1>
<h1 class="col-xs-12 center-xs t-white">{{title}}<span class="t-red">_</span></h1>
<p class="p-intro col-xs-offset-2 col-xs-8 center-xs t-white">
<strong>Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding.</strong>
<strong>{{tagline}}</strong>
</p>
</div>
<div class="icon-arrow"></div>
Expand Down
10 changes: 8 additions & 2 deletions src/app/home-page/hero-banner/hero-banner.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { ActivatedRoute, Router, RoutesRecognized } from "@angular/router";

@Component({
selector: 'hero-banner',
templateUrl: './hero-banner.component.html',
styleUrls: ['./hero-banner.component.css']
})
export class HeroBannerComponent implements OnInit {
@Input() title = "You dream it. We build it";
@Input() tagline = "Jumpstart your next dream project with an all-star crew of developers passionate about learning and coding.";

constructor() { }
constructor(private route: ActivatedRoute, private router: Router) {


}

ngOnInit() {
}
Expand Down
6 changes: 0 additions & 6 deletions src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<app-navigation-header></app-navigation-header>
<hero-banner></hero-banner>

<team (loading)="loadingComponents.team = $event"></team>


<skill-set></skill-set>

<project-slide></project-slide>
<newsletter-subscribe></newsletter-subscribe>
<app-footer></app-footer>
3 changes: 2 additions & 1 deletion src/app/home-page/home-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from "@angular/router";

@Component({
selector: 'home-page',
Expand All @@ -15,7 +16,7 @@ export class HomePageComponent implements OnInit {
}


constructor() { }
constructor(public route: ActivatedRoute) { }

ngOnInit() {
}
Expand Down
48 changes: 10 additions & 38 deletions src/app/login-page/login-page.component.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
<div class="wrap-max1140px">
<header class='wrap-height100px row middle-xs end-sm center-xs'>
<div class='col-xs-12' >Don't' have an account? <a [routerLink]="['/register']">Sign Up</a></div>
<div class='col-xs-12'>Don't' have an account? <a [routerLink]="['/register']">Sign Up</a></div>
</header>
</div>
<div class="wrap-max340px">

<div class="row center-xs">
<div class="logo">
<a [routerLink]="['/']">
<span class="vivid">Vivid</span>
<span class="ciphers">Ciphers</span>
</a>
<span class="tag">/></span>
</div>
</div>
<div class="row center-xs">
<p class="p-intro">Log in to your account</p>
<p class="p-intro">Log in to your account</p>
</div>
<form
(ngSubmit)="onSubmit()"
#loginForm="ngForm">
<input
type="email"
style="text-align: center"
placeholder="Email"
name="email"
ngNativeValidate
[(ngModel)] = "user.email"
required
email>
<input
type="password"
style="text-align: center"
placeholder="Password"
name="password"
minlength="8"
ngNativeValidate
[(ngModel)] = "user.password"
required
password>
<form (ngSubmit)="onSubmit()" #loginForm="ngForm">
<input type="email" style="text-align: center" placeholder="Email" name="email" ngNativeValidate [(ngModel)]="user.email"
required email>
<input type="password" style="text-align: center" placeholder="Password" name="password" minlength="8" ngNativeValidate [(ngModel)]="user.password"
required password>
<div class="row middle-xs between-xs wrap-height100px">
<button
class="b-green"
type="submit"
[disabled]="loginForm.invalid">
<button class="b-green" type="submit" [disabled]="loginForm.invalid">
Log In
</button>
<a [routerLink]="['/password-reset']">Forgot password?</a>
Expand All @@ -51,4 +23,4 @@
<footer class="wrap-height100px row middle-xs center-xs">
<a class="t-gray" [routerLink]="['/']">Return to previous page</a>
</footer>
</div>
</div>
11 changes: 9 additions & 2 deletions src/app/login-page/login-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { NgForm } from '@angular/forms';
import { User } from "app/shared/models/user.model";
import { Profile } from "app/shared/models/profile.model";
import { ActivatedRoute, Router } from "@angular/router";

@Component({
selector: 'app-login-page',
Expand All @@ -9,12 +11,17 @@ import { User } from "app/shared/models/user.model";
})
export class LoginPageComponent implements OnInit {
user: User;
@Output() titleChange: EventEmitter<string> = new EventEmitter<string>();


onSubmit() {
console.log(this.user);
}

constructor() { }
constructor(private route: ActivatedRoute) {
this.user = new User();
this.user.profile = new Profile();
}

ngOnInit() {
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class User {
this.active = user && user.active || null;
this.id = user && user.id || null;
this.email = user && user.email || null;
this.created_at = user.created_at || null;
this.created_at = user && user.created_at || null;
this.profile = (user && user.profile) ? new Profile({...user.profile}) : null;
this.roles = user && user.roles.map((role) => {return new Role({...role});}) || [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
</div>
<nav class="main-nav col-md-offset-1 col-xs-9 center-xs">
<a [routerLink]="['/home']">About</a>
<a pageScroll href="#skillset">Skills</a>
<a pageScroll href='#team'>Team</a>
<a pageScroll href='#projects'>Showcase</a>
<a pageScroll href='#contact'>Contact</a>
<a pageScroll [routerLink]="['/home']" href="#skillset">Skills</a>
<a pageScroll [routerLink]="['/home']" href='#team'>Team</a>
<a pageScroll [routerLink]="['/home']" href='#projects'>Showcase</a>
<a pageScroll [routerLink]="['/home']" href='#contact'>Contact</a>
<!--<a href="http://vividciphers.com/blog">Blog</a>-->
</nav>
<div class="auth col-md-2 end-md col-xs-3 start-xs">
Expand Down
6 changes: 5 additions & 1 deletion src/app/signup-page/signup-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { User } from '../shared/models/user.model';
import { Component, EventEmitter, Output } from '@angular/core';
import { Router } from '@angular/router';
import { NgForm } from '@angular/forms';
import { Profile } from "app/shared/models/profile.model";

@Component({
selector: 'app-signup-page',
Expand All @@ -15,7 +16,10 @@ export class SignupPageComponent {
passwordConfirm: string;

constructor(private userService: UserService,
private router: Router) { }
private router: Router) {
this.user = new User();
this.user.profile = new Profile();
}

onSubmit() {
this.userService.createUser(this.user)
Expand Down
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
</head>
<body>
<app-root>Loading...</app-root>
<script src="src/assets/scripts/arrow-animation.js"></script>
</body>
</html>