Commit d267b5f7 authored by 范雪寒's avatar 范雪寒

feat:over

parent 9f3a2900
...@@ -128,5 +128,8 @@ ...@@ -128,5 +128,8 @@
} }
} }
}, },
"defaultProject": "ng-template-generator" "defaultProject": "ng-template-generator",
} "cli": {
"analytics": false
}
}
\ No newline at end of file
<div class="d-flex"> <div class="d-flex">
<div class="p-btn-record d-flex"> <div class="p-btn-record d-flex">
<div class="btn-clear" style="cursor: pointer" (click)="onBtnClearAudio()" *ngIf="withRmBtn && (audioUrl || audioBlob)"> <div class="btn-clear" style="cursor: pointer" (click)="onBtnClearAudio()"
*ngIf="withRmBtn && (audioUrl || audioBlob)">
<fa-icon icon="times"></fa-icon> <fa-icon icon="times"></fa-icon>
</div> </div>
<div class="btn-record" *ngIf="type===Type.RECORD && !isUploading" <div class="btn-record" *ngIf="type===Type.RECORD && !isUploading" [class.p-recording]="isRecording"
[class.p-recording]="isRecording" (click)="onBtnRecord()">
(click)="onBtnRecord()">
<fa-icon icon="microphone"></fa-icon> <fa-icon icon="microphone"></fa-icon>
Record Audio Record Audio
</div> </div>
<nz-upload <nz-upload [nzAccept]="'.mp3'" [nzShowUploadList]="false" [nzAction]="uploadUrl" [nzData]="uploadData"
[nzAccept] = "'.mp3'" (nzChange)="handleChange($event)">
[nzShowUploadList]="false"
[nzAction]="uploadUrl" <div class="btn-upload" [ngClass]="{'has-clear': withRmBtn && (audioUrl || audioBlob)}"
[nzData]="uploadData" *ngIf="type===Type.UPLOAD && !isUploading">
(nzChange)="handleChange($event)">
<div class="btn-upload" [ngClass]="{'has-clear': withRmBtn && (audioUrl || audioBlob)}" *ngIf="type===Type.UPLOAD && !isUploading">
<fa-icon icon="upload"></fa-icon> <fa-icon icon="upload"></fa-icon>
Upload Audio Upload Audio
</div> </div>
...@@ -32,10 +29,9 @@ ...@@ -32,10 +29,9 @@
<div *ngIf="audioUrl && needRemove; then truthyTemplate else falsyTemplate"></div> <div *ngIf="audioUrl && needRemove; then truthyTemplate else falsyTemplate"></div>
<ng-template #truthyTemplate > <ng-template #truthyTemplate>
<div class="btn-delete" (click)="onBtnDeleteAudio()"> <div class="btn-delete" (click)="onBtnDeleteAudio()">
<fa-icon icon="close"></fa-icon> <fa-icon icon="times"></fa-icon>
</div> </div>
</ng-template> </ng-template>
...@@ -52,10 +48,10 @@ ...@@ -52,10 +48,10 @@
</div> </div>
<div class="p-progress ml-2" (click)="onBtnPlay()" *ngIf="audioUrl || audioBlob"> <div class="p-progress ml-2" (click)="onBtnPlay()" *ngIf="audioUrl || audioBlob">
<nz-progress [nzPercent]="percent" [nzWidth]="30" [nzFormat]="progressText" <nz-progress [nzPercent]="percent" [nzWidth]="30" [nzFormat]="progressText" nzType="circle"></nz-progress>
nzType="circle"></nz-progress>
<div class="p-btn-play" [style.left]="isPlaying?'8px':''"> <div class="p-btn-play" [style.left]="isPlaying?'8px':''">
<fa-icon [icon]="playIcon"></fa-icon> <fa-icon [icon]="playIcon"></fa-icon>
</div> </div>
</div> </div>
</div>
</div>
\ No newline at end of file
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output, NgZone, OnChanges} from '@angular/core'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, NgZone, OnChanges } from '@angular/core';
import {NzMessageService, NzNotificationService, UploadFile} from 'ng-zorro-antd'; import { NzMessageService, NzNotificationService, UploadFile } from 'ng-zorro-antd';
import {HttpClient, HttpEvent, HttpEventType, HttpRequest} from '@angular/common/http'; import { HttpClient, HttpEvent, HttpEventType, HttpRequest } from '@angular/common/http';
import {environment} from '../../../environments/environment'; import { environment } from '../../../environments/environment';
declare var Recorder; declare var Recorder;
...@@ -26,7 +26,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -26,7 +26,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
uploadData; uploadData;
@Input() @Input()
needRemove = false; needRemove = true;
@Input() @Input()
audioItem: any = null; audioItem: any = null;
...@@ -54,9 +54,9 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -54,9 +54,9 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
audioBlob: any; audioBlob: any;
constructor( private nzMessageService: NzMessageService ) { constructor(private nzMessageService: NzMessageService) {
this.uploadUrl = (<any> window).courseware.uploadUrl(); this.uploadUrl = (<any>window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData(); this.uploadData = (<any>window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => { window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url; this.uploadUrl = url;
...@@ -185,7 +185,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -185,7 +185,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
this.nzMessageService.error('You can only upload Audio file ( mp3 | wav |ogg)'); this.nzMessageService.error('You can only upload Audio file ( mp3 | wav |ogg)');
return; return;
} }
const delta = 25; const delta = 25;
const isOverSize = (file.size / 1024 / 1024) < delta; const isOverSize = (file.size / 1024 / 1024) < delta;
if (!isOverSize) { if (!isOverSize) {
this.nzMessageService.error(`audio file must smaller than ${delta}MB!`); this.nzMessageService.error(`audio file must smaller than ${delta}MB!`);
...@@ -224,7 +224,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -224,7 +224,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
p = 0; p = 0;
} }
// console.log(Math.floor(p * 100)); // console.log(Math.floor(p * 100));
this.progress = Math.floor(p * 100); this.progress = Math.floor(p * 100);
} }
} }
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
<div nz-row nzType="flex" nzAlign="middle"> <div nz-row nzType="flex" nzAlign="middle">
<div nz-col nzSpan="5" nzOffset="1"> <div nz-col nzSpan="5" nzOffset="1">
<h5> add background-1: </h5>
<h5> add background: </h5>
<div class="bg-box"> <div class="bg-box">
<app-upload-image-with-preview <app-upload-image-with-preview
[picUrl]="bgItem?.url" [picUrl]="bgItem?.url"
...@@ -19,6 +17,16 @@ ...@@ -19,6 +17,16 @@
</div> </div>
</div> </div>
<div nz-col nzSpan="5" nzOffset="1">
<h5> add background-2: </h5>
<div class="bg-box">
<app-upload-image-with-preview
[picUrl]="bgItem2?.url"
(imageUploaded)="onBackground_2_UploadSuccess($event)">
</app-upload-image-with-preview>
</div>
</div>
<div nz-col nzSpan="5" nzOffset="1" class="img-box" <div nz-col nzSpan="5" nzOffset="1" class="img-box"
*ngFor="let it of hotZoneArr; let i = index"> *ngFor="let it of hotZoneArr; let i = index">
......
...@@ -10,12 +10,12 @@ import { ...@@ -10,12 +10,12 @@ import {
Output, Output,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import {Subject} from 'rxjs'; import { Subject } from 'rxjs';
import {debounceTime} from 'rxjs/operators'; import { debounceTime } from 'rxjs/operators';
import {EditorItem, HotZoneImg, HotZoneItem, HotZoneLabel, Label, MySprite, removeItemFromArr} from './Unit'; import { EditorItem, HotZoneImg, HotZoneItem, HotZoneLabel, Label, MySprite, removeItemFromArr } from './Unit';
import TWEEN from '@tweenjs/tween.js'; import TWEEN from '@tweenjs/tween.js';
import {getMinScale} from "../../play/Unit"; import { getMinScale } from "../../play/Unit";
import {tar} from "compressing"; import { tar } from "compressing";
@Component({ @Component({
...@@ -34,15 +34,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -34,15 +34,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
hotZoneArr = null; hotZoneArr = null;
@Output() @Output()
save = new EventEmitter(); save = new EventEmitter();
@ViewChild('canvas', {static: true}) canvas: ElementRef; @ViewChild('canvas', { static: true }) canvas: ElementRef;
@ViewChild('wrap', {static: true}) wrap: ElementRef; @ViewChild('wrap', { static: true }) wrap: ElementRef;
@Input() @Input()
isHasRect = true; isHasRect = true;
@Input() @Input()
isHasPic = true; isHasPic = false;
@Input() @Input()
isHasText = true; isHasText = false;
@Input() @Input()
hotZoneFontObj = { hotZoneFontObj = {
size: 50, size: 50,
...@@ -50,7 +50,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -50,7 +50,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
color: '#8f3758' color: '#8f3758'
} }
@Input() @Input()
defaultItemType = 'text'; defaultItemType = 'rect';
@Input() @Input()
hotZoneImgSize = 190; hotZoneImgSize = 190;
...@@ -83,6 +83,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -83,6 +83,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
radioValue; radioValue;
curItem; curItem;
bg: MySprite; bg: MySprite;
bg2: MySprite;
changeSizeFlag = false; changeSizeFlag = false;
changeTopSizeFlag = false; changeTopSizeFlag = false;
changeRightSizeFlag = false; changeRightSizeFlag = false;
...@@ -99,8 +100,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -99,8 +100,15 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
@Input() @Input()
set bgItem(v) { set bgItem(v) {
this._bgItem = v; this._bgItem = v;
}
this.init(); _bgItem2 = null;
get bgItem2() {
return this._bgItem2;
}
@Input()
set bgItem2(v) {
this._bgItem2 = v;
} }
onResize(event) { onResize(event) {
...@@ -112,7 +120,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -112,7 +120,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.initListener(); this.initListener();
// this.init(); this.init();
this.update(); this.update();
} }
...@@ -133,6 +141,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -133,6 +141,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshBackground(); this.refreshBackground();
} }
onBackground_2_UploadSuccess(e) {
console.log('e: ', e);
this.bgItem2.url = e.url;
this.refreshBackground();
}
onItemImgUploadSuccess(e, item) { onItemImgUploadSuccess(e, item) {
item.pic_url = e.url; item.pic_url = e.url;
this.loadHotZonePic(item.pic, e.url); this.loadHotZonePic(item.pic, e.url);
...@@ -144,34 +158,78 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -144,34 +158,78 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
refreshBackground(callBack = null) { refreshBackground(callBack = null) {
let bg1Loaded = false;
let bg2Loaded = false;
this.loadBg1(() => {
bg1Loaded = true;
if (bg1Loaded && bg2Loaded) {
if (callBack) {
callBack();
}
}
});
this.loadBg2(() => {
bg2Loaded = true;
if (bg1Loaded && bg2Loaded) {
if (callBack) {
callBack();
}
}
})
}
loadBg1(callBack) {
if (!this.bg) { if (!this.bg) {
this.bg = new MySprite(this.ctx); this.bg = new MySprite(this.ctx);
this.renderArr.push(this.bg); this.renderArr.push(this.bg);
} }
const bg = this.bg; const bg = this.bg;
if (this.bgItem.url) {
bg.load(this.bgItem.url).then(() => { if (!this.bgItem.url) {
const rate1 = this.canvasWidth / bg.width; callBack();
const rate2 = this.canvasHeight / bg.height; }
const rate = Math.min(rate1, rate2); bg.load(this.bgItem.url).then(() => {
bg.setScaleXY(rate); const rate1 = this.canvasWidth / bg.width;
const rate2 = this.canvasHeight / bg.height;
const rate = Math.min(rate1, rate2);
bg.setScaleXY(rate);
bg.x = this.canvasWidth / 2; bg.x = this.canvasWidth / 2;
bg.y = this.canvasHeight / 2; bg.y = this.canvasHeight / 2;
if (callBack) { callBack();
callBack(); });
} }
});
loadBg2(callBack) {
if (!this.bg2) {
this.bg2 = new MySprite(this.ctx);
this.renderArr.push(this.bg2);
} }
} const bg2 = this.bg2;
if (!this.bgItem2.url) {
callBack();
}
bg2.load(this.bgItem2.url).then(() => {
const rate1 = this.canvasWidth / bg2.width;
const rate2 = this.canvasHeight / bg2.height;
const rate = Math.min(rate1, rate2);
bg2.setScaleXY(rate);
bg2.alpha = 0.5;
bg2.x = this.canvasWidth / 2;
bg2.y = this.canvasHeight / 2;
callBack();
});
}
addBtnClick() { addBtnClick() {
// this.imgArr.push({}); // this.imgArr.push({});
...@@ -374,7 +432,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -374,7 +432,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
init() { init() {
this.initData(); this.initData();
this.initCtx(); this.initCtx();
...@@ -384,26 +441,17 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -384,26 +441,17 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
initItem() { initItem() {
if (!this.bgItem) { if (!this.bgItem) {
this.bgItem = {}; this.bgItem = {};
} else {
this.refreshBackground(() => {
// if (!this.imgItemArr) {
// this.imgItemArr = [];
// } else {
// this.initImgArr();
// }
// console.log('aaaaa');
if (!this.hotZoneItemArr) {
this.hotZoneItemArr = [];
} else {
this.initHotZoneArr();
}
});
} }
if (!this.bgItem2) {
this.bgItem2 = {};
}
this.refreshBackground(() => {
if (!this.hotZoneItemArr) {
this.hotZoneItemArr = [];
} else {
this.initHotZoneArr();
}
});
} }
initHotZoneArr() { initHotZoneArr() {
...@@ -413,7 +461,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -413,7 +461,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
if (this.bg) { if (this.bg) {
curBgRect = this.bg.getBoundingBox(); curBgRect = this.bg.getBoundingBox();
} else { } else {
curBgRect = {x: 0, y: 0, width: this.canvasWidth, height: this.canvasHeight}; curBgRect = { x: 0, y: 0, width: this.canvasWidth, height: this.canvasHeight };
} }
let oldBgRect = this.bgItem.rect; let oldBgRect = this.bgItem.rect;
...@@ -470,7 +518,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -470,7 +518,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
if (this.bg) { if (this.bg) {
curBgRect = this.bg.getBoundingBox(); curBgRect = this.bg.getBoundingBox();
} else { } else {
curBgRect = {x: 0, y: 0, width: this.canvasWidth, height: this.canvasHeight}; curBgRect = { x: 0, y: 0, width: this.canvasWidth, height: this.canvasHeight };
} }
let oldBgRect = this.bgItem.rect; let oldBgRect = this.bgItem.rect;
...@@ -487,7 +535,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -487,7 +535,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
const data = JSON.parse(JSON.stringify(arr[i])); const data = JSON.parse(JSON.stringify(arr[i]));
const img = {pic_url: data.pic_url}; const img = { pic_url: data.pic_url };
data.rect.x *= rate; data.rect.x *= rate;
data.rect.y *= rate; data.rect.y *= rate;
...@@ -526,7 +574,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -526,7 +574,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
mapDown(event) { mapDown(event) {
this.oldPos = {x: this.mx, y: this.my}; this.oldPos = { x: this.mx, y: this.my };
for (let i = 0; i < this.hotZoneArr.length; i++) { for (let i = 0; i < this.hotZoneArr.length; i++) {
...@@ -580,7 +628,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -580,7 +628,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.curItem.y += addY; this.curItem.y += addY;
} }
this.oldPos = {x: this.mx, y: this.my}; this.oldPos = { x: this.mx, y: this.my };
this.saveDisabled = true; this.saveDisabled = true;
...@@ -864,6 +912,18 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -864,6 +912,18 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}; };
} }
const bgItem2 = this.bgItem2;
if (this.bg2) {
bgItem2['rect'] = this.bg2.getBoundingBox();
} else {
bgItem2['rect'] = {
x: 0,
y: 0,
width: Math.round(this.canvasWidth * 100) / 100,
height: Math.round(this.canvasHeight * 100) / 100
};
}
const hotZoneItemArr = []; const hotZoneItemArr = [];
const hotZoneArr = this.hotZoneArr; const hotZoneArr = this.hotZoneArr;
...@@ -894,7 +954,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -894,7 +954,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
console.log('hotZoneItemArr: ', hotZoneItemArr); console.log('hotZoneItemArr: ', hotZoneItemArr);
this.save.emit({bgItem, hotZoneItemArr}); this.save.emit({ bgItem, bgItem2, hotZoneItemArr });
} }
private updatePos() { private updatePos() {
......
...@@ -6,3 +6,10 @@ ...@@ -6,3 +6,10 @@
height: 100%; height: 100%;
} }
.border {
border-radius: 20px;
border-style: dashed;
padding: 20px;
margin: 20px;
}
\ No newline at end of file
<div class="model-content"> <div class="model-content">
<div class="border" style="width: 750px; height: 190px;">
<span style="float: left; height: 30px; font-size: 18px;">标题字母:</span>
<div style="position: absolute; left: 200px; top: 100px; width: 800px;"> <input style="float: left; width: 50px;" type="text" nz-input [(ngModel)]="item.titleLetter" (blur)="save()">
<span style="float: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()"> <span style="float: left; height: 30px; font-size: 18px;">字母音频:</span>
<app-audio-recorder style="float: left;" [audioUrl]="item.titleLetterAudio"
<app-upload-image-with-preview (audioUploaded)="onTitleLetterAudioUploadSuccess($event)">
[picUrl]="item.pic_url" </app-audio-recorder>
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')" <br><br>
></app-upload-image-with-preview> <span style="float: left; height: 30px; font-size: 18px;">标题:</span>
<input style="float: left; width: 250px;" type="text" nz-input [(ngModel)]="item.title" (blur)="save()">
<app-audio-recorder <span style="float: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
[audioUrl]="item.audio_url" <span style="float: left; height: 30px; font-size: 18px;">标题音频:</span>
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')" <app-audio-recorder style="float: left;" [audioUrl]="item.titleAudio"
></app-audio-recorder> (audioUploaded)="onTitleAudioUploadSuccess($event)">
<app-custom-hot-zone></app-custom-hot-zone> </app-audio-recorder>
<app-upload-video></app-upload-video> <br><br>
<app-lesson-title-config></app-lesson-title-config> <span style="float: left; height: 30px; font-size: 18px;">整体音频:</span>
<app-audio-recorder style="float: left;" [audioUrl]="item.totalAudio"
(audioUploaded)="onTotalAudioUploadSuccess($event)">
</app-audio-recorder>
</div> </div>
<app-custom-hot-zone
[bgItem]="item.popUpPosition.bgItem"
[bgItem2]="item.popUpPosition.bgItem2"
[hotZoneItemArr]="item.popUpPosition.hotZoneItemArr"
(save)="onPopUpPositionHotZoneSave(item.popUpPosition, $event)">
</app-custom-hot-zone>
</div> </div>
\ No newline at end of file
import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef} from '@angular/core'; import { Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef } from '@angular/core';
...@@ -10,27 +10,36 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap ...@@ -10,27 +10,36 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap
export class FormComponent implements OnInit, OnChanges, OnDestroy { export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用 // 储存数据用
saveKey = "test_0011"; saveKey = "YM_L5_27";
// 储存对象 // 储存对象
item; item;
constructor(private appRef: ApplicationRef,private changeDetectorRef: ChangeDetectorRef) { constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
} }
ngOnInit() { ngOnInit() {
this.item = {}; this.item = {
title: '',
titleAudio: '',
titleLetter: '',
titleLetterAudio: '',
totalAudio: '',
popUpPosition: {},
};
// 获取存储的数据 // 获取存储的数据
(<any> window).courseware.getData((data) => { (<any>window).courseware.getData((data) => {
if (data) { if (data) {
this.item = data; this.item = data;
} }
console.log('this.item = ' + JSON.stringify(this.item));
this.init(); this.init();
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
...@@ -60,8 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -60,8 +69,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
*/ */
onImageUploadSuccess(e, key) { onImageUploadSuccess(e, key) {
this.item[key] = e.url; this.item[key] = e.url;
this.save(); this.save();
} }
/** /**
...@@ -74,13 +83,40 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -74,13 +83,40 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
onTitleLetterAudioUploadSuccess(event) {
this.item.titleLetterAudio = event.url;
this.save();
}
onTitleAudioUploadSuccess(event) {
this.item.titleAudio = event.url;
this.save();
}
onTotalAudioUploadSuccess(event) {
this.item.totalAudio = event.url;
this.save();
}
onPopUpPositionHotZoneSave(data, event) {
const { bgItem, bgItem2, hotZoneItemArr } = event;
data.bgItem = bgItem;
data.bgItem2 = bgItem2;
data.hotZoneItemArr = hotZoneItemArr;
this.item.popUpPosition.bgItem = bgItem;
this.item.popUpPosition.bgItem2 = bgItem2;
this.item.popUpPosition.hotZoneItemArr = hotZoneItemArr;
this.save();
}
/** /**
* 储存数据 * 储存数据
*/ */
save() { save() {
(<any> window).courseware.setData(this.item, null, this.saveKey); (<any>window).courseware.setData(this.item, null, this.saveKey);
console.log('this.item = ' + JSON.stringify(this.item));
this.refresh(); this.refresh();
} }
......
...@@ -1640,9 +1640,15 @@ export function jelly(item, time = 0.7) { ...@@ -1640,9 +1640,15 @@ export function jelly(item, time = 0.7) {
TWEEN.remove(item.jellyTween); TWEEN.remove(item.jellyTween);
} }
const t = time / 9; const t = time / 8;
const baseSX = item.scaleX;
const baseSY = item.scaleY; if (!item.baseSX) {
item.baseSX = item.scaleX;
}
if (!item.baseSY) {
item.baseSY = item.scaleY;
}
let index = 0; let index = 0;
const run = () => { const run = () => {
...@@ -1651,19 +1657,19 @@ export function jelly(item, time = 0.7) { ...@@ -1651,19 +1657,19 @@ export function jelly(item, time = 0.7) {
return; return;
} }
const data = arr[index]; const data = arr[index];
const t = tweenChange(item, {scaleX: data[0], scaleY: data[1]}, data[2], () => { const t = tweenChange(item, { scaleX: data[0], scaleY: data[1] }, data[2], () => {
index ++; index++;
run(); run();
}, TWEEN.Easing.Sinusoidal.InOut); }, TWEEN.Easing.Sinusoidal.InOut);
item.jellyTween = t; item.jellyTween = t;
}; };
const arr = [ const arr = [
[baseSX * 1.1, baseSY * 0.9, t], [item.baseSX * 1.1, item.baseSY * 0.9, t],
[baseSX * 0.98, baseSY * 1.02, t * 2], [item.baseSX * 0.98, item.baseSY * 1.02, t * 2],
[baseSX * 1.02, baseSY * 0.98, t * 2], [item.baseSX * 1.02, item.baseSY * 0.98, t * 2],
[baseSX * 0.99, baseSY * 1.01, t * 2], [item.baseSX * 0.99, item.baseSY * 1.01, t * 2],
[baseSX * 1.0, baseSY * 1.0, t * 2], [item.baseSX * 1.0, item.baseSY * 1.0, t],
]; ];
......
export const defaultData = {
"title": "asdf asd fa asdf",
"titleAudio": "http://staging-teach.cdn.ireadabc.com/23376490a9ba0f4a3fe0618fc1c935e1.mp3",
"titleLetter": "F",
"titleLetterAudio": "http://staging-teach.cdn.ireadabc.com/dfb27b510e121a1045a3b7613a530e43.mp3",
}
\ No newline at end of file
This diff is collapsed.
import {
Game,
TouchSprite,
MyLabel,
asyncTweenChange,
} from './Game';
import {
jelly, tweenChange,
} from './../Unit';
import { defaultData } from './DefaultData';
export class MyGame extends Game {
images = null;
data = null;
status = null;
initData(data) {
this.images = data.images;
this.status = {};
if (!data.data || Object.is(data.data, {})) {
this.data = defaultData;
} else {
this.data = data.data;
}
let imgUrlList = [];
let audioUrlList = [];
imgUrlList.push(this.data.popUpPosition.bgItem.url);
imgUrlList.push(this.data.popUpPosition.bgItem2.url);
// audioUrlList.push(this.data.titleLetterAudio);
this.data.popUpPosition.hotZoneItemArr.forEach(data => {
audioUrlList.push(data.audio_url);
});
imgUrlList = imgUrlList.filter((data) => data != null && data != '');
audioUrlList = audioUrlList.filter((data) => data != null && data != '');
this.preLoadData(imgUrlList, audioUrlList);
}
preLoadData(imgUrlList, audioUrlList) {
imgUrlList.forEach((data) => {
this._parent.addUrlToImages(data);
});
audioUrlList.forEach((data) => {
this._parent.addUrlToAudioObj(data);
});
}
mapScale;
initView() {
this.mapScale = this._parent.mapScale;
// 初始化背景
this.initBg();
// 初始化标题
this.initTittle();
// 初始化中间部分
this.initMiddle();
this.initButton();
}
bg;
initBg() {
const bgBig = new TouchSprite();
bgBig.init(this.images.get('img_white_bg'));
bgBig.x = this._parent.canvasWidth / 2;
bgBig.y = this._parent.canvasHeight / 2;
bgBig.setScaleXY(this._parent.mapScaleBig);
this.addChild(bgBig);
const bg = new TouchSprite();
bg.init(this.images.get('img_white_bg'));
bg.x = this._parent.canvasWidth / 2;
bg.y = this._parent.canvasHeight / 2;
bg.setScaleXY(this.mapScale);
this.addChild(bg);
this.bg = bg;
}
initTittle() {
const titleBg = new TouchSprite();
titleBg.init(this.images.get('img_title_bg'));
titleBg.x = titleBg.width / 2 * this.mapScale;
titleBg.y = titleBg.height / 2 * this.mapScale;
titleBg.setScaleXY(this.mapScale);
this.addChild(titleBg);
const titleLetter = new MyLabel();
titleLetter.x = titleBg.width * 1 / 8;
titleLetter.y = 0;
titleLetter.fontSize = 48;
titleLetter.fontColor = "#facf46";
titleLetter.fontName = 'BerlinSansFBDemi';
titleLetter.anchorX = 0;
titleLetter.anchorY = 0.5;
titleLetter.text = this.data.titleLetter;
titleLetter.refreshSize();
titleLetter.addTouchBeganListener(() => {
this.playAudio(this.data.titleLetterAudio);
});
titleBg.addChild(titleLetter);
const titleLabel = new MyLabel();
titleLabel.x = titleBg.width * 5 / 8;
titleLabel.y = 0;
titleLabel.fontSize = 36;
titleLabel.fontColor = "#000000";
titleLabel.fontName = 'FuturaStd';
titleLabel.anchorX = 0;
titleLabel.anchorY = 0.5;
titleLabel.text = this.data.title;
titleLabel.refreshSize();
titleLabel.addTouchBeganListener(() => {
this.playAudio(this.data.titleAudio);
});
titleBg.addChild(titleLabel);
}
middleBg1;
middleBg2;
initMiddle() {
const bgItem = this.data.popUpPosition.bgItem;
const bgItem2 = this.data.popUpPosition.bgItem2;
const bg = this.initMiddleBg(bgItem);
this.middleBg1 = bg;
console.log('bgItem2 = ' + JSON.stringify(bgItem2));
const bg2 = this.initMiddleBg(bgItem2);
bg2.alpha = 0;
this.middleBg2 = bg2;
const bgItemScale = bg.width / bgItem.rect.width;
this.data.popUpPosition.hotZoneItemArr.forEach(data => {
const rect = new TouchSprite();
rect.init(this.images.get('img_title_bg2'));
rect.anchorX = 0;
rect.anchorY = 0;
rect.scaleX = (data.rect.width * bgItemScale) / rect.width;
rect.scaleY = (data.rect.height * bgItemScale) / rect.height;
rect.x = -bg.width / 2 + data.rect.x * bgItemScale;
rect.y = -bg.height / 2 + data.rect.y * bgItemScale;
bg.addChild(rect);
// console.log('data = ' + JSON.stringify(data));
rect.addTouchBeganListener(() => {
// console.log('data.audio_url = ' + data.audio_url);
if (data.audio_url) {
this.playAudio(data.audio_url);
}
});
});
}
initMiddleBg(bgItem) {
const bg = new TouchSprite();
bg.init(this.images.get(bgItem.url));
bg.x = this._parent.canvasWidth / 2;
bg.y = this._parent.canvasHeight / 2 + 35 * this.mapScale;
const maxScaleX = (this._parent.canvasWidth - 30 * this.mapScale) / bg.width;
const maxScaleY = (this._parent.canvasHeight - 70 * this.mapScale) / bg.height;
bg.setScaleXY(Math.min(maxScaleX, maxScaleY));
this.addChild(bg);
return bg;
}
eyeOpen = true;
initButton() {
const btn = new TouchSprite();
btn.init(this.images.get('btn_eye_open'));
btn.x = this._parent.canvasWidth - 60 * this.mapScale;
btn.y = this._parent.canvasHeight - 60 * this.mapScale;
btn.setScaleXY(this.mapScale);
btn.addTouchBeganListener(() => {
jelly(btn);
if (this.eyeOpen) {
btn.init(this.images.get('btn_eye_close'));
tweenChange(this.middleBg1, { alpha: 0 }, 0.2);
tweenChange(this.middleBg2, { alpha: 1 }, 0.2);
} else {
btn.init(this.images.get('btn_eye_open'));
tweenChange(this.middleBg1, { alpha: 1 }, 0.2);
tweenChange(this.middleBg2, { alpha: 0 }, 0.2);
}
this.eyeOpen = !this.eyeOpen;
});
this.addChild(btn);
}
}
...@@ -9,11 +9,27 @@ ...@@ -9,11 +9,27 @@
} }
@font-face
{
font-family: 'BerlinSansFBDemi';
src: url("../../assets/font/BerlinSansFBDemi-Bold.TTF") ;
}
@font-face
{
font-family: 'FuturaStd';
src: url("../../assets/font/FuturaStd-Medium.otf") ;
}
@font-face
{
font-family: 'GOTHICB';
src: url("../../assets/font/GOTHICB_1.TTF") ;
}
@font-face @font-face
{ {
font-family: 'BRLNSDB'; font-family: 'ahronbd';
src: url("../../assets/font/BRLNSDB.TTF") ; src: url("../../assets/font/ahronbd-1.ttf") ;
} }
<div class="game-container" #wrap> <div class="game-container" #wrap>
<canvas id="canvas" #canvas></canvas> <canvas id="canvas" #canvas></canvas>
</div> </div>
<span style="position: absolute; top: 0px; font-family: BerlinSansFBDemi">&nbsp;</span>
<span style="position: absolute; top: 0px; font-family: FuturaStd">&nbsp;</span>
<span style="position: absolute; top: 0px; font-family: GOTHICB">&nbsp;</span>
<span style="position: absolute; top: 0px; font-family: ahronbd">&nbsp;</span>
\ No newline at end of file
import {Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener} from '@angular/core'; import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener } from '@angular/core';
import { import {
Label, Label,
MySprite, tweenChange, MySprite, tweenChange,
} from './Unit'; } from './Unit';
import {res, resAudio} from './resources'; import { res, resAudio } from './resources';
import {Subject} from 'rxjs'; import { Subject } from 'rxjs';
import {debounceTime} from 'rxjs/operators'; import { debounceTime } from 'rxjs/operators';
import TWEEN from '@tweenjs/tween.js'; import TWEEN from '@tweenjs/tween.js';
import { MyGame } from "./game/MyGame";
...@@ -22,8 +23,8 @@ import TWEEN from '@tweenjs/tween.js'; ...@@ -22,8 +23,8 @@ import TWEEN from '@tweenjs/tween.js';
}) })
export class PlayComponent implements OnInit, OnDestroy { export class PlayComponent implements OnInit, OnDestroy {
@ViewChild('canvas', {static: true }) canvas: ElementRef; @ViewChild('canvas', { static: true }) canvas: ElementRef;
@ViewChild('wrap', {static: true }) wrap: ElementRef; @ViewChild('wrap', { static: true }) wrap: ElementRef;
// 数据 // 数据
data; data;
...@@ -39,7 +40,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -39,7 +40,6 @@ export class PlayComponent implements OnInit, OnDestroy {
mx; // 点击x坐标 mx; // 点击x坐标
my; // 点击y坐标 my; // 点击y坐标
// 资源 // 资源
rawImages = new Map(res); rawImages = new Map(res);
rawAudios = new Map(resAudio); rawAudios = new Map(resAudio);
...@@ -53,11 +53,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -53,11 +53,12 @@ export class PlayComponent implements OnInit, OnDestroy {
renderArr; renderArr;
mapScale = 1; mapScale = 1;
mapScaleBig = 1;
canvasLeft; canvasLeft;
canvasTop; canvasTop;
saveKey = 'test_0011'; saveKey = 'YM_L5_27';
btnLeft; btnLeft;
...@@ -69,6 +70,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -69,6 +70,8 @@ export class PlayComponent implements OnInit, OnDestroy {
curPic; curPic;
game;
@HostListener('window:resize', ['$event']) @HostListener('window:resize', ['$event'])
onResize(event) { onResize(event) {
this.winResizeEventStream.next(); this.winResizeEventStream.next();
...@@ -80,13 +83,19 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -80,13 +83,19 @@ export class PlayComponent implements OnInit, OnDestroy {
this.data = {}; this.data = {};
// 获取数据 // 获取数据
const getData = (<any> window).courseware.getData; const getData = (<any>window).courseware.getData;
getData((data) => { getData((data) => {
if (data && typeof data == 'object') { if (data && typeof data == 'object') {
this.data = data; this.data = data;
} }
// console.log('data:' , data);
this.game = new MyGame(this);
this.game.initData({
images: this.images,
data: this.data,
});
// 初始化 各事件监听 // 初始化 各事件监听
this.initListener(); this.initListener();
...@@ -108,16 +117,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -108,16 +117,6 @@ export class PlayComponent implements OnInit, OnDestroy {
ngOnDestroy() { ngOnDestroy() {
window['curCtx'] = null; window['curCtx'] = null;
window.cancelAnimationFrame(this.animationId); window.cancelAnimationFrame(this.animationId);
this.cleanAudio();
}
cleanAudio() {
if (this.audioObj) {
for (const key in this.audioObj) {
this.audioObj[key].pause();
}
}
} }
...@@ -125,9 +124,27 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -125,9 +124,27 @@ export class PlayComponent implements OnInit, OnDestroy {
// 预加载资源 // 预加载资源
this.loadResources().then(() => { this.loadResources().then(() => {
this.addServerListener();
window["air"].hideAirClassLoading(this.saveKey, this.data); window["air"].hideAirClassLoading(this.saveKey, this.data);
this.init();
this.update(); });
}
start() {
console.log(' in start');
this.init();
this.update();
}
addServerListener() {
const c = (<any>window).courseware;
if (!c || !c.onEvent) {
return;
}
c.onEvent('course-in-screen', (data, next) => { // 学生端 初始化时调用
this.start();
next();
}); });
} }
...@@ -151,7 +168,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -151,7 +168,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canvas.nativeElement.height = this.canvasHeight; this.canvas.nativeElement.height = this.canvasHeight;
window['curCtx'] = this.ctx; window['curCtx'] = this.ctx;
window['curImages'] = this.images;
} }
...@@ -340,8 +356,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -340,8 +356,9 @@ export class PlayComponent implements OnInit, OnDestroy {
preloadAudio(url) { preloadAudio(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const audio = new Audio(); const audio = new Audio();
resolve({})
audio.oncanplay = (a) => { audio.oncanplay = (a) => {
resolve(); //resolve();
}; };
audio.onerror = () => { audio.onerror = () => {
reject(); reject();
...@@ -443,10 +460,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -443,10 +460,10 @@ export class PlayComponent implements OnInit, OnDestroy {
*/ */
initDefaultData() { initDefaultData() {
if (!this.data.pic_url) { // if (!this.data.pic_url) {
this.data.pic_url = 'assets/play/default/pic.jpg'; // this.data.pic_url = 'assets/play/default/pic.jpg';
this.data.pic_url_2 = 'assets/play/default/pic.jpg'; // this.data.pic_url_2 = 'assets/play/default/pic.jpg';
} // }
} }
...@@ -455,8 +472,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -455,8 +472,8 @@ export class PlayComponent implements OnInit, OnDestroy {
*/ */
initImg() { initImg() {
this.addUrlToImages(this.data.pic_url); // this.addUrlToImages(this.data.pic_url);
this.addUrlToImages(this.data.pic_url_2); // this.addUrlToImages(this.data.pic_url_2);
} }
...@@ -466,11 +483,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -466,11 +483,15 @@ export class PlayComponent implements OnInit, OnDestroy {
initAudio() { initAudio() {
// 音频资源 // 音频资源
this.addUrlToAudioObj(this.data.audio_url); // this.addUrlToAudioObj(this.data.audio_url);
this.addUrlToAudioObj(this.data.audio_url_2); // this.addUrlToAudioObj(this.data.audio_url_2);
// 音效 for (let item of this.rawAudios) {
this.addUrlToAudioObj('click', this.rawAudios.get('click'), 0.3); if (item[0] != item[1]) {
// 音效
this.addUrlToAudioObj(item[0], this.rawAudios.get(item[0]), 0.3);
}
}
} }
...@@ -483,8 +504,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -483,8 +504,8 @@ export class PlayComponent implements OnInit, OnDestroy {
const sx = this.canvasWidth / this.canvasBaseW; const sx = this.canvasWidth / this.canvasBaseW;
const sy = this.canvasHeight / this.canvasBaseH; const sy = this.canvasHeight / this.canvasBaseH;
const s = Math.min(sx, sy); this.mapScale = Math.min(sx, sy);
this.mapScale = s; this.mapScaleBig = Math.max(sx, sy);
// this.mapScale = sx; // this.mapScale = sx;
// this.mapScale = sy; // this.mapScale = sy;
...@@ -502,88 +523,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -502,88 +523,7 @@ export class PlayComponent implements OnInit, OnDestroy {
* 初始化试图 * 初始化试图
*/ */
initView() { initView() {
this.game._initView();
this.initPic();
this.initBottomPart();
}
initBottomPart() {
const btnLeft = new MySprite();
btnLeft.init(this.images.get('btn_left'));
btnLeft.x = this.canvasWidth - 150 * this.mapScale;
btnLeft.y = this.canvasHeight - 100 * this.mapScale;
btnLeft.setScaleXY(this.mapScale);
this.renderArr.push(btnLeft);
this.btnLeft = btnLeft;
const btnRight = new MySprite();
btnRight.init(this.images.get('btn_right'));
btnRight.x = this.canvasWidth - 50 * this.mapScale;
btnRight.y = this.canvasHeight - 100 * this.mapScale;
btnRight.setScaleXY(this.mapScale);
this.renderArr.push(btnRight);
this.btnRight = btnRight;
}
initPic() {
const maxW = this.canvasWidth * 0.7;
const pic1 = new MySprite();
pic1.init(this.images.get(this.data.pic_url));
pic1.x = this.canvasWidth / 2;
pic1.y = this.canvasHeight / 2;
pic1.setScaleXY(maxW / pic1.width);
this.renderArr.push(pic1);
this.pic1 = pic1;
const label1 = new Label();
label1.text = this.data.text;
label1.textAlign = 'center';
label1.fontSize = 50;
label1.fontName = 'BRLNSDB';
label1.fontColor = '#ffffff';
pic1.addChild(label1);
const pic2 = new MySprite();
pic2.init(this.images.get(this.data.pic_url_2));
pic2.x = this.canvasWidth / 2 + this.canvasWidth;
pic2.y = this.canvasHeight / 2;
pic2.setScaleXY(maxW / pic2.width);
this.renderArr.push(pic2);
this.pic2 = pic2;
this.curPic = pic1;
}
btnLeftClicked() {
this.lastPage();
}
btnRightClicked() {
this.nextPage();
} }
lastPage() { lastPage() {
...@@ -595,8 +535,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -595,8 +535,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = false; this.canTouch = false;
const moveLen = this.canvasWidth; const moveLen = this.canvasWidth;
tweenChange(this.pic1, {x: this.pic1.x + moveLen}, 1); tweenChange(this.pic1, { x: this.pic1.x + moveLen }, 1);
tweenChange(this.pic2, {x: this.pic2.x + moveLen}, 1, () => { tweenChange(this.pic2, { x: this.pic2.x + moveLen }, 1, () => {
this.canTouch = true; this.canTouch = true;
this.curPic = this.pic1; this.curPic = this.pic1;
}); });
...@@ -611,8 +551,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -611,8 +551,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = false; this.canTouch = false;
const moveLen = this.canvasWidth; const moveLen = this.canvasWidth;
tweenChange(this.pic1, {x: this.pic1.x - moveLen}, 1); tweenChange(this.pic1, { x: this.pic1.x - moveLen }, 1);
tweenChange(this.pic2, {x: this.pic2.x - moveLen}, 1, () => { tweenChange(this.pic2, { x: this.pic2.x - moveLen }, 1, () => {
this.canTouch = true; this.canTouch = true;
this.curPic = this.pic2; this.curPic = this.pic2;
}); });
...@@ -631,39 +571,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -631,39 +571,15 @@ export class PlayComponent implements OnInit, OnDestroy {
mapDown(event) { mapDown(event) {
this.game._onTouchBegan({ x: this.mx, y: this.my });
if (!this.canTouch) {
return;
}
if ( this.checkClickTarget(this.btnLeft) ) {
this.btnLeftClicked();
return;
}
if ( this.checkClickTarget(this.btnRight) ) {
this.btnRightClicked();
return;
}
if ( this.checkClickTarget(this.pic1) ) {
this.pic1Clicked();
return;
}
if ( this.checkClickTarget(this.pic2) ) {
this.pic2Clicked();
return;
}
} }
mapMove(event) { mapMove(event) {
this.game._onTouchMove({ x: this.mx, y: this.my });
} }
mapUp(event) { mapUp(event) {
this.game._onTouchEnd({ x: this.mx, y: this.my });
} }
......
const res = [ const res = [
['Img_point', "assets/play/Img_point.png"],
// ['bg', "assets/play/bg.jpg"], ['btn_pause', "assets/play/btn_pause.png"],
['btn_left', "assets/play/btn_left.png"], ['btn_switch', "assets/play/btn_switch.png"],
['btn_right', "assets/play/btn_right.png"], ['img_group_bg_1', "assets/play/img_group_bg_1.png"],
// ['text_bg', "assets/play/text_bg.png"], ['img_line_black', "assets/play/img_line_black.png"],
['img_line_purple', "assets/play/img_line_purple.png"],
['img_oval_bg', "assets/play/img_oval_bg.png"],
['img_white_bg', "assets/play/img_white_bg.png"],
['btn_close', "assets/play/btn_close.png"],
['btn_play', "assets/play/btn_play.png"],
['img_grey_bg', "assets/play/img_grey_bg.png"],
['img_group_bg_2', "assets/play/img_group_bg_2.png"],
['img_line_grey', "assets/play/img_line_grey.png"],
['img_line_red', "assets/play/img_line_red.png"],
['img_title_bg', "assets/play/img_title_bg.png"],
['img_title_bg2', "assets/play/img_title_bg2.png"],
['img_win_bg', "assets/play/img_win_bg.png"],
['btn_eye_open', "assets/play/btn_eye_open.png"],
['btn_eye_close', "assets/play/btn_eye_close.png"],
]; ];
const resAudio = [ const resAudio = [
['click', "assets/play/music/click.mp3"], // ['click', "assets/play/music/click.mp3"],
]; ];
export {res, resAudio}; export { res, resAudio };
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