Skip to content
This repository was archived by the owner on Aug 3, 2022. It is now read-only.
Open
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
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
1 change: 1 addition & 0 deletions public/app/system.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 26 additions & 0 deletions public/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "cloud-cardboard-viewer",
"description": "Angular2 and Node.js Cardboard video viewer.",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
"repository": {
"type": "git",
"url": "https://github.com/googlecodelabs/cloud-cardboard-viewer.git"
},
"contributors": [
"Jason Dobry <jason.dobry@gmail.com>"
],
"dependencies": {
"@google-cloud/debug-agent": "0.10.2",
"@google/cloud-errors": "0.1.1",
"@google/cloud-trace": "0.6.2",
"body-parser": "1.16.1",
"express": "4.14.1",
"googleapis": "16.1.0"
},
"engines": {
"node": "~6"
}
}
7 changes: 7 additions & 0 deletions public/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (process.env.NODE_ENV === "production") {
require("@google/cloud-trace").start();
}

if (process.env.GCLOUD_PROJECT) {
require("@google/cloud-debug").start();
}
27 changes: 27 additions & 0 deletions 公共/應用程序/about.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'about',
template: `
About
`
})
export class AboutComponent {}
34 changes: 34 additions & 0 deletions 公共/應用程序/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { HomeComponent } from './home.component';
import { AboutComponent } from './about.component';

const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'about', component: AboutComponent },
{ path: '**', redirectTo: '' }
];

@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
55 changes: 55 additions & 0 deletions 公共/應用程序/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'app',
styles: [`
.router-link-active {
text-decoration: underline;
}
`],
template: `
<div>
<div id="sidebar">
<nav>
<a routerLink="/" routerLinkActive="active">Home</a>
<a routerLink="/about" routerLinkActive="active">About</a>
</nav>
</div>
<div class="mui-appbar" id="main-bar">
<div class="mui-container-fluid">
<nav class="mui-row" role="navigation">
<div class="mui-col-sm-8 mui-col-sm-offset-2">
Google Cloud Platform @ ng-conf 2016
</div>
</nav>
</div>
</div>
<div id="content" class="mui-container-fluid">
<main class="mui-row">
<div class="mui-col-sm-8 mui-col-sm-offset-2">
<router-outlet></router-outlet>
</div>
</main>
</div>
</div>
`
})
export class AppComponent {}
45 changes: 45 additions & 0 deletions 公共/應用程序/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import './rxjs-extensions';

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';

import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { HomeComponent } from './home.component';
import { AboutComponent } from './about.component';
import { VideoCardComponent } from './video-card.component';

@NgModule({
imports: [
BrowserModule,
HttpModule,
AppRoutingModule
],
declarations: [
AppComponent,
HomeComponent,
AboutComponent,
VideoCardComponent
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
49 changes: 49 additions & 0 deletions 公共/應用程序/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import { Component } from '@angular/core';
import { Http } from '@angular/http';
import { Video, VideoCardComponent } from './video-card.component';

@Component({
moduleId: module.id,
selector: 'home',
template: `
<h1>3D Cardboard Videos</h1>
<div class="mui--text-dark-secondary mui--text-body2">
{{ resultsPerPage }} of {{ totalResults }} results
</div>
<div class="mui-divider"></div>
<video-card [video]="video" *ngFor="let video of videos"></video-card>
`
})
export class HomeComponent {
resultsPerPage: number;
totalResults: number;
videos = [];
constructor (public http: Http) {

}
ngOnInit () {
this.http.get('/data.json').subscribe((res) => {
const data = res.json();
this.resultsPerPage = data.pageInfo.resultsPerPage;
this.totalResults = data.pageInfo.totalResults;
this.videos = data.items.map((video) => new Video(video));
});
}
}
1 change: 1 addition & 0 deletions 公共/應用程序/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions 公共/應用程序/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
22 changes: 22 additions & 0 deletions 公共/應用程序/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app.module';

platformBrowserDynamic().bootstrapModule(AppModule);
1 change: 1 addition & 0 deletions 公共/應用程序/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package.json
29 changes: 29 additions & 0 deletions 公共/應用程序/rxjs-extensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// Observable class extensions
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/throw';

// Observable operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
7 changes: 7 additions & 0 deletions 公共/應用程序/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (process.env.NODE_ENV === "production") {
require("@google/cloud-trace").start();
}

if (process.env.GCLOUD_PROJECT) {
require("@google/cloud-debug").start();
}
Loading