Commit 65e64cb2 authored by limingzhe's avatar limingzhe

update

parent 20da4385
...@@ -71,6 +71,9 @@ export class FormComponent implements OnInit, OnChanges { ...@@ -71,6 +71,9 @@ export class FormComponent implements OnInit, OnChanges {
// } // }
this.item = {};
this.item.contentObj = {};
const getData = (<any> window).courseware.getData; const getData = (<any> window).courseware.getData;
getData((data) => { getData((data) => {
...@@ -84,7 +87,7 @@ export class FormComponent implements OnInit, OnChanges { ...@@ -84,7 +87,7 @@ export class FormComponent implements OnInit, OnChanges {
console.log('data:', data); console.log('data:', data);
// this.init(); // this.init();
// this.refresh(); this.refresh();
}, this.KEY); }, this.KEY);
......
...@@ -13,16 +13,17 @@ ...@@ -13,16 +13,17 @@
@font-face @font-face
{ {
font-family: 'BRLNSDB_1'; font-family: 'BRLNSDB_1';
src: url("/assets/font/BRLNSDB_1.TTF") format("opentype"); src: url("../../assets/font/BRLNSDB_1.TTF") format("opentype");
} }
@font-face @font-face
{ {
font-family: 'CooperBlackStd'; font-family: 'CooperBlackStd';
src: url("/assets/font/CooperBlackStd.otf") format("opentype"); src: url("../../assets/font/CooperBlackStd.otf") format("opentype");
} }
...@@ -78,6 +78,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -78,6 +78,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// ------ // ------
KEY = 'dfzx_04'; KEY = 'dfzx_04';
unitLabel;
titleLabel;
bottomArr = []; bottomArr = [];
...@@ -306,7 +308,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -306,7 +308,7 @@ export class PlayComponent implements OnInit, OnDestroy {
initDefaultData() { initDefaultData() {
if (!this.data.contentObj.unit) { if (!this.data.contentObj.unit) {
this.data.contentObj.unit = 'unit 1'; this.data.contentObj.unit = 'Unit 1';
} }
if (!this.data.contentObj.title) { if (!this.data.contentObj.title) {
this.data.contentObj.title = 'Hello'; this.data.contentObj.title = 'Hello';
...@@ -351,9 +353,33 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -351,9 +353,33 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initTitle(); this.initTitle();
this.initLogo(); this.initLogo();
this.showAnima();
// this.initItem(); // this.initItem();
} }
showAnima() {
this.unitLabel.alpha = 0;
this.unitLabel.bg.alpha = 0;
this.titleLabel.y = -this.titleLabel.fontSize;
const showUnit = () => {
tweenChange(this.unitLabel, {alpha: 1}, 0.7, null, TWEEN.Easing.Cubic.Out, (item, progress) => {
this.unitLabel.bg.alpha = this.unitLabel.alpha;
});
};
const showTitle = () => {
moveItem(this.titleLabel, this.titleLabel.x, this.titleLabel.baseY, 1, () => {
showUnit();
}, TWEEN.Easing.Bounce.Out);
};
showTitle();
}
initBg() { initBg() {
this.bottomArr = []; this.bottomArr = [];
...@@ -400,9 +426,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -400,9 +426,13 @@ export class PlayComponent implements OnInit, OnDestroy {
label.textAlign = 'center'; label.textAlign = 'center';
label.x = this.canvasWidth / 2; label.x = this.canvasWidth / 2;
label.y = y * this.mapScale; label.y = y * this.mapScale;
label['bg'] = labelBg;
this.renderArr.push(labelBg); this.renderArr.push(labelBg);
this.renderArr.push(label); this.renderArr.push(label);
this.unitLabel = label;
} }
...@@ -434,20 +464,25 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -434,20 +464,25 @@ export class PlayComponent implements OnInit, OnDestroy {
titleText.disH = (10) * this.mapScale; titleText.disH = (10) * this.mapScale;
titleText.fontColor = '#ffffff'; titleText.fontColor = '#ffffff';
titleText.fontName = 'CooperBlackStd'; titleText.fontName = 'CooperBlackStd';
// titleText.fontName = 'Verdana';
titleText.textAlign = 'center'; titleText.textAlign = 'center';
titleText.text = this.data.contentObj.title; titleText.text = this.data.contentObj.title;
titleText.y = this.canvasHeight / 2 - titleText.fontSize / 2 - this.canvasHeight / 15; // * this.mapScale - titleText.fontSize * this.mapScale; // - titleText.textH - titleText.fontSize; titleText.y = this.canvasHeight / 2 - titleText.fontSize / 2 - this.canvasHeight / 15; // * this.mapScale - titleText.fontSize * this.mapScale; // - titleText.textH - titleText.fontSize;
// titleText.setScaleXY(this.mapScale); // titleText.setScaleXY(this.mapScale);
titleText.width = this.canvasWidth / 1.6; titleText.width = this.canvasWidth / 1.6;
// titleText.fontWeight = 900;
titleText.setOutline(20, '#ff7600'); titleText.setOutline(20, '#ff7600');
titleText.x = this.canvasWidth / 2; // - titleText.width * titleText.scaleX / 2; titleText.x = this.canvasWidth / 2; // - titleText.width * titleText.scaleX / 2;
titleText['baseY'] = titleText.y;
// this.titleText = titleText; // this.titleText = titleText;
this.renderArr.push(titleText); this.renderArr.push(titleText);
this.titleLabel = titleText;
} }
...@@ -459,8 +494,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -459,8 +494,8 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
const logoW = 320; const logoW = 320 * this.mapScale;
const logoH = 220; const logoH = 220 * this.mapScale;
const offSet = 20 * this.mapScale; const offSet = 20 * this.mapScale;
......
...@@ -3,6 +3,9 @@ const res = [ ...@@ -3,6 +3,9 @@ const res = [
['bg', "assets/play/bg.jpg"], ['bg', "assets/play/bg.jpg"],
['logo', "assets/default/logo.png"], ['logo', "assets/default/logo.png"],
// ['font_1', "assets/font/BRLNSDB_1.TTF"],
// ['font_2', "assets/font/CooperBlackStd.otf"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment