Skip to content

Commit

Permalink
add vue.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hikipuro committed Oct 3, 2018
1 parent 5d1f65b commit 405d375
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 17 deletions.
13 changes: 9 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -34,6 +34,7 @@
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
"electron": "^1.8.8"
"electron": "^1.8.8",
"vue": "^2.5.17"
}
}
8 changes: 6 additions & 2 deletions src/Main.ts
Expand Up @@ -5,6 +5,8 @@ import { Rotate } from "./Rotate";
import { CameraRotate } from "./CameraRotate";
import { HitTest } from "./HitTest";

const Editor = Tea.Editor;

export class Main {
app: Tea.App;
renderer: Tea.Renderer;
Expand All @@ -22,6 +24,8 @@ export class Main {
//console.log("height", Tea.Screen.height);
//console.log(Tea.Screen.fullscreen);

var label = new Editor.Label();

var b = document.querySelector("#b");
b.addEventListener("click", () => {
console.log("click", Tea.now());
Expand Down Expand Up @@ -467,8 +471,8 @@ export class Main {
//ps.main.startSize = new Tea.ParticleSystem.MinMaxCurve(10, Tea.AnimationCurve.easeInOut(0, 0, 1, 1));
//ps.main.startSpeed = 2;
//ps.main.startSize = 0.5;
scene.addChild(particles);
ps.start();
//scene.addChild(particles);
//ps.start();

var curve = Tea.AnimationCurve.easeInOut(0, 3, 1, 5);
console.log(curve);
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow.ts
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import * as url from "url";
import * as fs from "fs";

import { MenuItem, ipcMain, IpcMessageEvent, MenuItemConstructorOptions } from "electron";
//import { MenuItem, ipcMain, IpcMessageEvent, MenuItemConstructorOptions } from "electron";

module Settings {
export const Title: string = "WebGL Test";
Expand Down
3 changes: 3 additions & 0 deletions src/NodeMain.ts
Expand Up @@ -12,6 +12,9 @@ class NodeMain {
protected _mainWindow: MainWindow = null;

constructor(app: Electron.App) {
//app.commandLine.appendSwitch("force-gpu-rasterization");
//app.commandLine.appendSwitch("ignore-gpu-blacklist");
//console.log(app.getGPUFeatureStatus());
this._app = app;
this.addAppEvents();
}
Expand Down
7 changes: 7 additions & 0 deletions src/tea/Tea.ts
Expand Up @@ -127,6 +127,13 @@ export * from "./GLParameters";
export * from "./Keyboard";
export * from "./Mouse";

import * as ELabel from "./editor/Label";

export module Editor {
export var Label = ELabel.Label;
export type Label = ELabel.Label;
}

/**
* degrees to radians.
* @export
Expand Down
26 changes: 26 additions & 0 deletions src/tea/editor/Label.ts
@@ -0,0 +1,26 @@
import Vue from "vue/dist/vue.common";

//console.log("Vue", Vue);

export class Label {
vue: Vue;

constructor() {
var element = document.createElement("div");
element.id = "app2";
element.innerText = "{{ message }}";
document.body.appendChild(element);
setTimeout(() => {
this.vue = new Vue({
el: '#app2',
data: {
message: 'Hello Vue!'
}
})
}, 1000);
}

set text(value: string) {
this.vue.$data.message = "test";
}
}
2 changes: 1 addition & 1 deletion src/tea/test/001_Vector3.ts
@@ -1,5 +1,5 @@
import * as mocha from "mocha";
import assert = require("assert");
var assert = require("assert");
import { isString } from "util";
import * as Tea from "../Tea";
import { Mathf } from "../math/Mathf";
Expand Down
2 changes: 1 addition & 1 deletion src/tea/test/002_Quaternion.ts
@@ -1,5 +1,5 @@
import * as mocha from "mocha";
import assert = require("assert");
var assert = require("assert");
import * as Tea from "../Tea";
import { Quaternion } from "../math/Quaternion";
import { isString } from "util";
Expand Down
3 changes: 1 addition & 2 deletions src/tea/test/003_Matrix4x4.ts
@@ -1,9 +1,8 @@
import * as mocha from "mocha";
import assert = require("assert");
var assert = require("assert");
import * as Tea from "../Tea";
import { Matrix4x4 } from "../math/Matrix4x4";


describe("Matrix4x4", () => {
function checkRange(m: Matrix4x4): void {
for (var i = 0; i < 16; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/tea/test/010_Mathf.ts
@@ -1,5 +1,5 @@
import * as mocha from "mocha";
import assert = require("assert");
var assert = require("assert");
import * as Tea from "../Tea";
import { Mathf } from "../math/Mathf";
import { isString } from "util";
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
@@ -1,16 +1,15 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"module": "es2015",
"moduleResolution": "node",
//"esModuleInterop": true,
"esModuleInterop": true,
"sourceMap": true,
"noImplicitAny": false,
"noImplicitThis": true,
"outDir": "./dist",
"baseUrl": ".",
"paths": {
}
"paths": {}
},
"include": [
"./src/**/*"
Expand Down

0 comments on commit 405d375

Please sign in to comment.