Commit 4784aa24 authored by limingzhe's avatar limingzhe

feat: 资源压缩

parent 825a121d
...@@ -13,7 +13,6 @@ import {Subject} from 'rxjs'; ...@@ -13,7 +13,6 @@ 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 {text} from "@fortawesome/fontawesome-svg-core";
@Component({ @Component({
...@@ -61,20 +60,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -61,20 +60,12 @@ export class PlayComponent implements OnInit, OnDestroy {
saveKey = 'pu14'; saveKey = 'pu14';
btnLeft;
btnRight;
pic1;
pic2;
canTouch = true; canTouch = true;
curPic;
private bg: any; private bg: any;
private hotZoneArr: any[]; private hotZoneArr: any[];
private magnifier: MySprite;
private isMagnifierTouched: boolean;
private curHotZoneItem: any;
private photoAnima: MyAnimation;
private hotZoneRate: number; private hotZoneRate: number;
private oldHotMapScale: number; private oldHotMapScale: number;
private textLabelArr: any; private textLabelArr: any;
...@@ -467,7 +458,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -467,7 +458,6 @@ export class PlayComponent implements OnInit, OnDestroy {
const saveRect = data.rect; const saveRect = data.rect;
let item; let item;
console.log('data~~~: ', data);
if (data.itemType === 'rect') { if (data.itemType === 'rect') {
item = new ShapeRect(this.ctx); item = new ShapeRect(this.ctx);
item.fillColor = '#ff0000'; item.fillColor = '#ff0000';
...@@ -530,37 +520,47 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -530,37 +520,47 @@ export class PlayComponent implements OnInit, OnDestroy {
initDefaultData() { initDefaultData() {
if (!this.data.bgItem && !this.data.hotZoneItemArr) { if (!this.data.bgItem && !this.data.hotZoneItemArr) {
this.data.questionType = '2';
this.data.text = 'This is a test question.';
this.data.bgItem = { this.data.bgItem = {
rect: {height: 892, width: 1585, x: 392, y: 0}, rect: {height: 735, width: 1306, x: 320, y: 0},
url: 'assets/play/default/pic.jpg' url: 'assets/play/default/pic.jpg'
}; };
this.data.hotZoneItemArr = [ this.data.hotZoneItemArr = [
{ {
audio_url: 'assets/play/default/audio.mp3',
fontColor: "#8f3758", fontColor: "#8f3758",
fontName: "BRLNSR_1", fontName: "BRLNSDB_1",
fontScale: 1.85, fontScale: 1.521875,
fontSize: 50, fontSize: 50,
imgScale: 1, imgScale: 1,
index: 0, index: 0,
itemType: "text", itemType: "rect",
mapScale: 1.85, mapScale: 1.521,
rect: {x: 391.84, y: 446.02, width: 244.05, height: 244.05}, rect: {
text: "test_1" height: 148.55,
width: 148.55,
x: 385.42,
y: 275
}
}, },
{ {
audio_url: 'assets/play/default/audio.mp3',
fontColor: "#8f3758", fontColor: "#8f3758",
fontName: "BRLNSR_1", fontName: "BRLNSDB_1",
fontScale: 1.85, fontScale: 1.521875,
fontSize: 50, fontSize: 50,
imgScale: 1, imgScale: 1,
index: 1, index: 1,
itemType: "text", itemType: "rect",
mapScale: 1.85, mapScale: 1.521875,
rect: {x: 961.36, y: 450.36, width: 244.05, height: 244.05}, rect: {
text: 'test_2' height: 200,
width: 370,
x: 902.33,
y: 268.5
}
} }
]; ];
} }
...@@ -1053,7 +1053,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1053,7 +1053,7 @@ export class PlayComponent implements OnInit, OnDestroy {
private updateTime() { private updateTime() {
if (!this.isClickedProgress) { if (!this.isClickedProgress && this.curAudio) {
const progress = this.curAudio.currentTime / this.curAudio.duration; const progress = this.curAudio.currentTime / this.curAudio.duration;
this.setAudioProgress(this.progressBarBg, progress); this.setAudioProgress(this.progressBarBg, progress);
} }
...@@ -1080,6 +1080,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1080,6 +1080,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
// ------- 播放器 -------- // ------- 播放器 --------
if (this.curAudio) {
if (this.checkClickTarget(this.progressBarBg)) { if (this.checkClickTarget(this.progressBarBg)) {
this.isClickedProgress = true; this.isClickedProgress = true;
this.touchDownProgressBar(this.progressBarBg); this.touchDownProgressBar(this.progressBarBg);
...@@ -1089,6 +1090,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1089,6 +1090,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.touchDownAudioBtn(this.curAudio); this.touchDownAudioBtn(this.curAudio);
return; return;
} }
}
// ------------------------ // ------------------------
if (this.checkClickTarget(this.bg)) { if (this.checkClickTarget(this.bg)) {
...@@ -1150,8 +1152,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1150,8 +1152,6 @@ export class PlayComponent implements OnInit, OnDestroy {
private initBg() { private initBg() {
console.log('data:', this.data);
const bg = this.createSprite('bg'); const bg = this.createSprite('bg');
const sx = this.canvasWidth / bg.width; const sx = this.canvasWidth / bg.width;
const sy = this.canvasHeight / bg.height; const sy = this.canvasHeight / bg.height;
......
src/assets/play/bg.png

517 KB | W: | H:

src/assets/play/bg.png

288 KB | W: | H:

src/assets/play/bg.png
src/assets/play/bg.png
src/assets/play/bg.png
src/assets/play/bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/btn_current_position.png

4.2 KB | W: | H:

src/assets/play/big/btn_current_position.png

1.75 KB | W: | H:

src/assets/play/big/btn_current_position.png
src/assets/play/big/btn_current_position.png
src/assets/play/big/btn_current_position.png
src/assets/play/big/btn_current_position.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/btn_pause.png

6.18 KB | W: | H:

src/assets/play/big/btn_pause.png

3.07 KB | W: | H:

src/assets/play/big/btn_pause.png
src/assets/play/big/btn_pause.png
src/assets/play/big/btn_pause.png
src/assets/play/big/btn_pause.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/btn_play.png

6.37 KB | W: | H:

src/assets/play/big/btn_play.png

3.42 KB | W: | H:

src/assets/play/big/btn_play.png
src/assets/play/big/btn_play.png
src/assets/play/big/btn_play.png
src/assets/play/big/btn_play.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/player_bg.png

45.9 KB | W: | H:

src/assets/play/big/player_bg.png

17.6 KB | W: | H:

src/assets/play/big/player_bg.png
src/assets/play/big/player_bg.png
src/assets/play/big/player_bg.png
src/assets/play/big/player_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/player_top.png

3.74 KB | W: | H:

src/assets/play/big/player_top.png

1.08 KB | W: | H:

src/assets/play/big/player_top.png
src/assets/play/big/player_top.png
src/assets/play/big/player_top.png
src/assets/play/big/player_top.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/progressbar_bg.png

8.14 KB | W: | H:

src/assets/play/big/progressbar_bg.png

3.1 KB | W: | H:

src/assets/play/big/progressbar_bg.png
src/assets/play/big/progressbar_bg.png
src/assets/play/big/progressbar_bg.png
src/assets/play/big/progressbar_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/progressbar_played.png

6.05 KB | W: | H:

src/assets/play/big/progressbar_played.png

2.16 KB | W: | H:

src/assets/play/big/progressbar_played.png
src/assets/play/big/progressbar_played.png
src/assets/play/big/progressbar_played.png
src/assets/play/big/progressbar_played.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/big/text_bg.png

45.1 KB | W: | H:

src/assets/play/big/text_bg.png

20.2 KB | W: | H:

src/assets/play/big/text_bg.png
src/assets/play/big/text_bg.png
src/assets/play/big/text_bg.png
src/assets/play/big/text_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/crack.png

18 KB | W: | H:

src/assets/play/crack.png

6.93 KB | W: | H:

src/assets/play/crack.png
src/assets/play/crack.png
src/assets/play/crack.png
src/assets/play/crack.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/pic_bg.png

91.2 KB | W: | H:

src/assets/play/pic_bg.png

28.2 KB | W: | H:

src/assets/play/pic_bg.png
src/assets/play/pic_bg.png
src/assets/play/pic_bg.png
src/assets/play/pic_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/shadow.png

5.13 KB | W: | H:

src/assets/play/shadow.png

4.89 KB | W: | H:

src/assets/play/shadow.png
src/assets/play/shadow.png
src/assets/play/shadow.png
src/assets/play/shadow.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/btn_current_position.png

4.26 KB | W: | H:

src/assets/play/small/btn_current_position.png

1.77 KB | W: | H:

src/assets/play/small/btn_current_position.png
src/assets/play/small/btn_current_position.png
src/assets/play/small/btn_current_position.png
src/assets/play/small/btn_current_position.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/btn_pause.png

6.18 KB | W: | H:

src/assets/play/small/btn_pause.png

3.07 KB | W: | H:

src/assets/play/small/btn_pause.png
src/assets/play/small/btn_pause.png
src/assets/play/small/btn_pause.png
src/assets/play/small/btn_pause.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/btn_play.png

6.37 KB | W: | H:

src/assets/play/small/btn_play.png

3.42 KB | W: | H:

src/assets/play/small/btn_play.png
src/assets/play/small/btn_play.png
src/assets/play/small/btn_play.png
src/assets/play/small/btn_play.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/player_bg.png

40.2 KB | W: | H:

src/assets/play/small/player_bg.png

16.1 KB | W: | H:

src/assets/play/small/player_bg.png
src/assets/play/small/player_bg.png
src/assets/play/small/player_bg.png
src/assets/play/small/player_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/player_top.png

2.76 KB | W: | H:

src/assets/play/small/player_top.png

851 Bytes | W: | H:

src/assets/play/small/player_top.png
src/assets/play/small/player_top.png
src/assets/play/small/player_top.png
src/assets/play/small/player_top.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/progressbar_bg.png

5.24 KB | W: | H:

src/assets/play/small/progressbar_bg.png

1.82 KB | W: | H:

src/assets/play/small/progressbar_bg.png
src/assets/play/small/progressbar_bg.png
src/assets/play/small/progressbar_bg.png
src/assets/play/small/progressbar_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/progressbar_played.png

4.74 KB | W: | H:

src/assets/play/small/progressbar_played.png

2.03 KB | W: | H:

src/assets/play/small/progressbar_played.png
src/assets/play/small/progressbar_played.png
src/assets/play/small/progressbar_played.png
src/assets/play/small/progressbar_played.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/small/text_bg.png

33.8 KB | W: | H:

src/assets/play/small/text_bg.png

15.1 KB | W: | H:

src/assets/play/small/text_bg.png
src/assets/play/small/text_bg.png
src/assets/play/small/text_bg.png
src/assets/play/small/text_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/star.png

797 Bytes | W: | H:

src/assets/play/star.png

666 Bytes | W: | H:

src/assets/play/star.png
src/assets/play/star.png
src/assets/play/star.png
src/assets/play/star.png
  • 2-up
  • Swipe
  • Onion skin
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