Commit f3824d68 authored by 李维's avatar 李维

dev done

parent f3e33862
......@@ -52,7 +52,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="5" nzFor="item.text_main">正确选项</nz-form-label>
<nz-form-control [nzSpan]="10">
<nz-select [(ngModel)]="item.rightSide">
<nz-select [(ngModel)]="item.rightSide" (ngModelChange)="saveItem()">
<nz-option nzValue="left" nzLabel="左选项" default></nz-option>
<nz-option nzValue="right" nzLabel="右选项"></nz-option>
</nz-select>
......@@ -93,7 +93,7 @@
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option>
<nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select>
</td>
</tr>
......@@ -147,7 +147,7 @@
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option>
<nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select>
</td>
</tr>
......@@ -201,7 +201,7 @@
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option>
<nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select>
</td>
</tr>
......
......@@ -105,6 +105,11 @@
font-family: 'FuturaBT Medium';
src: url("../../assets/play/font/FuturaBT Medium.ttf") ;
}
@font-face{
font-family: 'Century Gothic Bold';
src: url("../../assets/play/font/Century Gothic Bold.ttf") ;
}
// @font-face{
// font-family: 'FuturaStd-Medium';
// src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
......
......@@ -180,6 +180,7 @@ export class PlayComponent implements OnInit, OnDestroy {
contentObj.long_audio.audio_url && array.push(contentObj.long_audio.audio_url)
contentObj.title.mainTextAudio_url && array.push(contentObj.title.mainTextAudio_url)
contentObj.dataArray.forEach(element => {
element.audio_url_main && array.push(element.audio_url_main)
element.audio_url_left && array.push(element.audio_url_left)
element.audio_url_right && array.push(element.audio_url_right)
});
......@@ -378,7 +379,7 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer.ref.alpha = 0;
let baseX = 0;
for(let wi=0; wi<dataItem.letters_main.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_main[wi].letter_val, "FuturaBT-Bold", dataItem.letters_main[wi].letter_color, 48 * 1, baseX, 50, "left")
let letter = this.g_cartoon.createLabel(dataItem.letters_main[wi].letter_val, "Century Gothic Bold", dataItem.letters_main[wi].letter_color, 48 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox();
baseX += bd.width + 1
textMainContainer.ref.addChild(letter)
......@@ -388,28 +389,36 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer.ref.y = pos[len].textMain.y - 50;
let textLeftContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-left-${i}-container`, 386, 100, "#FFFF00");
let lettersLeft = []
bgCard.ref.addChild(textLeftContainer.ref);
textLeftContainer.ref.alpha = 0;
baseX = 0;
for(let wi=0; wi<dataItem.letters_left.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_left[wi].letter_val, "FuturaBT-Bold", dataItem.letters_left[wi].letter_color, 42 * 1, baseX, 50, "left")
let letter = this.g_cartoon.createLabel(dataItem.letters_left[wi].letter_val, "FuturaBT-Bold", "#363333", 42 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox();
baseX += bd.width + 1
textLeftContainer.ref.addChild(letter)
textLeftContainer.ref.addChild(letter);
if(dataItem.letters_left[wi].letter_color=="#c8161e") {
lettersLeft.push(letter)
}
}
textLeftContainer.ref.width = baseX;
textLeftContainer.ref.x = pos[len].textLeft.x - baseX / 2;
textLeftContainer.ref.y = pos[len].textLeft.y - 50;
let textRightContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-right-${i}-container`, 386, 100, "#FFFF00");
let lettersRight = []
bgCard.ref.addChild(textRightContainer.ref);
textRightContainer.ref.alpha = 0;
baseX = 0;
for(let wi=0; wi<dataItem.letters_right.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_right[wi].letter_val, "FuturaBT-Bold", dataItem.letters_right[wi].letter_color, 42 * 1, baseX, 50, "left")
let letter = this.g_cartoon.createLabel(dataItem.letters_right[wi].letter_val, "FuturaBT-Bold", "#363333", 42 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox();
baseX += bd.width + 1
textRightContainer.ref.addChild(letter)
if(dataItem.letters_right[wi].letter_color=="#c8161e") {
lettersRight.push(letter)
}
}
textRightContainer.ref.width = baseX;
textRightContainer.ref.x = pos[len].textRight.x - baseX / 2;
......@@ -513,27 +522,79 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
this.subscribeMapDownEvent(textMainContainer.id, ()=>{
if(dataItem.audio_url_main) {
this.g_cartoon.playAudio(dataItem.audio_url_main, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
this.subscribeMapDownEvent(textLeftContainer.id, ()=>{
if(dataItem.audio_url_left) {
this.g_cartoon.playAudio(dataItem.audio_url_left, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
this.subscribeMapDownEvent(textRightContainer.id, ()=>{
if(dataItem.audio_url_right) {
this.g_cartoon.playAudio(dataItem.audio_url_right, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
bgCard.selected = false;
this.subscribeMapDownEvent(targetRight.id, ()=>{
this.subscribeMapDownEvent(radioButtonRight_out.id, ()=>{
if(!bgCard.selected) {
bgCard.switchSelect("right")
if(dataItem.rightSide == "right") {
this.g_cartoon.playAudio("sm-correct", false, ()=>{
this.g_enableMapDown = true;
})
circleRight.ref.alpha = 255;
lettersRight.forEach(le=>{
le.fontColor = "#c8161e"
})
bgCard.selected = true;
} else {
this.g_cartoon.playAudio("sm-wrong", false, ()=>{
this.g_enableMapDown = true;
})
}
} else {
this.g_enableMapDown = true;
}
this.g_enableMapDown = true;
})
this.subscribeMapDownEvent(targetLeft.id, ()=>{
this.subscribeMapDownEvent(radioButtonLeft_out.id, ()=>{
if(!bgCard.selected) {
bgCard.switchSelect("left")
if(dataItem.rightSide == "left") {
this.g_cartoon.playAudio("sm-correct", false, ()=>{
this.g_enableMapDown = true;
})
circleLeft.ref.alpha = 255;
lettersLeft.forEach(le=>{
le.fontColor = "#c8161e"
})
bgCard.selected = true;
} else {
this.g_cartoon.playAudio("sm-wrong", false, ()=>{
this.g_enableMapDown = true;
})
}
} else {
this.g_enableMapDown = true;
}
this.g_enableMapDown = true;
})
cardContainer.ref.addChild(bgCard.ref)
......
export const defaultData = {
version: "1.0",
dataKey: "YM5-11",
dataKey: "YM5-20",
title: {
NO: "",
mainText: "",
......@@ -11,110 +11,488 @@ export const defaultData = {
};
export const demoData = {
version: "1.0",
dataKey: "YM5-11",
title: {
NO: "C",
mainText: "Read and point.",
mainTextAudio_url: "",
},
dataArray: [
{
bgColorType: "",
letters_left: [
{ letter_val: "f", letter_color: "#363333", is_: "0" },
{ letter_val: "i", letter_color: "#363333", is_: "0" },
{ letter_val: "l", letter_color: "#363333", is_: "0" },
{ letter_val: "l", letter_color: "#363333", is_: "0" },
],
letters_right: [
{ letter_val: "r", letter_color: "#c8161d", is_: "0" },
{ letter_val: "e", letter_color: "#c8161d", is_: "0" },
{ letter_val: "f", letter_color: "#363333", is_: "0" },
{ letter_val: "i", letter_color: "#363333", is_: "0" },
{ letter_val: "l", letter_color: "#363333", is_: "0" },
{ letter_val: "l", letter_color: "#363333", is_: "0" },
],
image_url_left: "",
image_url_right: "",
audio_url_left: "",
audio_url_right: "",
text_left: "fill",
text_right: "refill",
},
{
bgColorType: "",
letters_left: [
{ letter_val: "t", letter_color: "#363333", is_: "0" },
{ letter_val: "i", letter_color: "#363333", is_: "0" },
{ letter_val: "d", letter_color: "#363333", is_: "0" },
{ letter_val: "y", letter_color: "#363333", is_: "0" },
],
letters_right: [
{ letter_val: "u", letter_color: "#c8161d", is_: "0" },
{ letter_val: "n", letter_color: "#c8161d", is_: "0" },
{ letter_val: "t", letter_color: "#363333", is_: "0" },
{ letter_val: "i", letter_color: "#363333", is_: "0" },
{ letter_val: "d", letter_color: "#363333", is_: "0" },
{ letter_val: "y", letter_color: "#363333", is_: "0" },
],
image_url_left: "",
image_url_right: "",
audio_url_left: "",
audio_url_right: "",
text_left: "tidy",
text_right: "untidy",
},
{
bgColorType: "",
letters_left: [
{ letter_val: "a", letter_color: "#363333", is_: "0" },
{ letter_val: "g", letter_color: "#363333", is_: "0" },
{ letter_val: "r", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
],
letters_right: [
{ letter_val: "d", letter_color: "#c8161d", is_: "0" },
{ letter_val: "i", letter_color: "#c8161d", is_: "0" },
{ letter_val: "s", letter_color: "#c8161d", is_: "0" },
{ letter_val: "a", letter_color: "#363333", is_: "0" },
{ letter_val: "g", letter_color: "#363333", is_: "0" },
{ letter_val: "r", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
],
image_url_left: "",
image_url_right: "",
audio_url_left: "",
audio_url_right: "",
text_left: "agree",
text_right: "disagree",
},
{
bgColorType: "",
letters_left: [
{ letter_val: "l", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
{ letter_val: "a", letter_color: "#363333", is_: "0" },
{ letter_val: "d", letter_color: "#363333", is_: "0" },
],
letters_right: [
{ letter_val: "m", letter_color: "#c8161d", is_: "0" },
{ letter_val: "i", letter_color: "#c8161d", is_: "0" },
{ letter_val: "s", letter_color: "#c8161d", is_: "0" },
{ letter_val: "l", letter_color: "#363333", is_: "0" },
{ letter_val: "e", letter_color: "#363333", is_: "0" },
{ letter_val: "a", letter_color: "#363333", is_: "0" },
{ letter_val: "d", letter_color: "#363333", is_: "0" },
],
image_url_left: "",
image_url_right: "",
audio_url_left: "",
audio_url_right: "",
text_left: "lead",
text_right: "mislead",
},
],
long_audio: { audio_url: "" },
"version": "1.0",
"dataKey": "YM5-20",
"title": {
"NO": "C",
"mainText": "Read and point",
"mainTextAudio_url": ""
},
"dataArray": [
{
"rightSide": "left",
"letters_main": [
{
"letter_val": "n",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "a",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "p",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "k",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_left": [
{
"letter_val": "r",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "a",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "b",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "b",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_right": [
{
"letter_val": "u",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "l",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "c",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "k",
"letter_color": "#363333",
"is_": "0"
}
],
"image_url_main": "",
"image_url_left": "",
"image_url_right": "",
"audio_url_main": "",
"audio_url_left": "",
"audio_url_right": "",
"text_main": "napkin",
"text_left": "rabbit",
"text_right": "unlock"
},
{
"rightSide": "right",
"letters_main": [
{
"letter_val": "m",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "s",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "l",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "a",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "d",
"letter_color": "#c8161e",
"is_": "0"
}
],
"letters_left": [
{
"letter_val": "b",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "r",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_right": [
{
"letter_val": "r",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "h",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "a",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#c8161e",
"is_": "0"
}
],
"image_url_main": "",
"image_url_left": "",
"image_url_right": "",
"audio_url_main": "",
"audio_url_left": "",
"audio_url_right": "",
"text_main": "mislead",
"text_left": "better",
"text_right": "reheat"
},
{
"rightSide": "right",
"letters_main": [
{
"letter_val": "c",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "l",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "r",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "f",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "u",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "l",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_left": [
{
"letter_val": "c",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "m",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "p",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "r",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_right": [
{
"letter_val": "u",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
}
],
"image_url_main": "",
"image_url_left": "",
"image_url_right": "",
"audio_url_main": "",
"audio_url_left": "",
"audio_url_right": "",
"text_main": "colorful",
"text_left": "competer",
"text_right": "unit"
},
{
"rightSide": "left",
"letters_main": [
{
"letter_val": "d",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "e",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "c",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "s",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_left": [
{
"letter_val": "n",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "f",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "c",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "t",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "i",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "o",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#363333",
"is_": "0"
}
],
"letters_right": [
{
"letter_val": "s",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "u",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#c8161e",
"is_": "0"
},
{
"letter_val": "n",
"letter_color": "#363333",
"is_": "0"
},
{
"letter_val": "y",
"letter_color": "#363333",
"is_": "0"
}
],
"image_url_main": "",
"image_url_left": "",
"image_url_right": "",
"audio_url_main": "",
"audio_url_left": "",
"audio_url_right": "",
"text_main": "decision",
"text_left": "nonfiction",
"text_right": "sunny"
}
],
"long_audio": {
"audio_url": ""
}
};
\ No newline at end of file
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