Commit f89f926b authored by liujiangnan's avatar liujiangnan

圈里的字体缩放

parent 689d13b1
<div class="model-content">
<div nz-row>
<div nz-col nzOffset='4'><h1 nz-title>课程内容编辑</h1></div>
<div nz-col nzOffset='4'>
<h1 nz-title>课程内容编辑</h1>
</div>
</div>
<div nz-form>
<div id='title-anchor'>
......@@ -22,8 +24,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="t_audio_url">发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder
[audioUrl]="item.title.t_audio_url" id="t_audio_url"
<app-audio-recorder [audioUrl]="item.title.t_audio_url" id="t_audio_url"
(audioUploaded)="onAudioUploadSuccess($event, item.title, 't_audio_url')">
</app-audio-recorder>
</nz-form-control>
......@@ -31,13 +32,15 @@
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="t_font_size">字体大小</nz-form-label>
<nz-form-control [nzSpan]="6">
<nz-input-number [(ngModel)]="item.title.t_font_size" [nzMin]="1" [nzStep]="1" (blur)="save()"></nz-input-number>
<nz-input-number [(ngModel)]="item.title.t_font_size" [nzMin]="1" [nzStep]="1" (blur)="save()">
</nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="t_font">字体</nz-form-label>
<nz-form-control [nzSpan]="4">
<nz-select [(ngModel)]="item.title.t_font" [nzShowSearch]='true' nzAllowClear nzPlaceHolder="Please select the font" (ngModelChange)="save()">
<nz-select [(ngModel)]="item.title.t_font" [nzShowSearch]='true' nzAllowClear
nzPlaceHolder="Please select the font" (ngModelChange)="save()">
<nz-option nzValue="BRLNSB" nzLabel="BRLNSB"></nz-option>
<nz-option nzValue="BRLNSDB" nzLabel="BRLNSDB"></nz-option>
<nz-option nzValue="BRLNSR" nzLabel="BRLNSR"></nz-option>
......@@ -55,160 +58,158 @@
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="t_font_color">颜色</nz-form-label>
<nz-form-control [nzSpan]="4">
<nz-select [(ngModel)]="item.title.t_font_color" [nzShowSearch]='true' nzAllowClear nzPlaceHolder="Please select the color" (ngModelChange)="save()">
<nz-select [(ngModel)]="item.title.t_font_color" [nzShowSearch]='true' nzAllowClear
nzPlaceHolder="Please select the color" (ngModelChange)="save()">
<nz-option nzValue="#008000" nzLabel="绿色"></nz-option>
<nz-option nzValue="#FF0000" nzLabel="红色"></nz-option>
<nz-option nzValue="#D2691E" nzLabel="巧克力色"></nz-option>
<nz-option nzValue="#000000" nzLabel="黑色"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
<div id='listen-anchor'>
<nz-divider nzText="听力材料" nzOrientation="left"></nz-divider>
<nz-form-item>
<nz-form-control [nzSpan]="6" nzOffset="3">
<app-audio-recorder id="item.listen_audio_url"
[audioUrl]="item.listen_audio_url"
<app-audio-recorder id="item.listen_audio_url" [audioUrl]="item.listen_audio_url"
(audioUploaded)="onAudioUploadSuccess($event, item, 'listen_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</div>
<div>
<nz-divider nzText="字母(组合)" nzOrientation="left"></nz-divider>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words">字母组合一</nz-form-label>
<nz-form-control [nzSpan]="6">
<input nz-input type="text" id="words" [(ngModel)]="item.words" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_audio_url">字母组合一发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder
[audioUrl]="item.words_audio_url" id="words_audio_url"
(audioUploaded)="onAudioUploadSuccess($event,item, 'words_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<div>
<nz-divider nzText="字母(组合)" nzOrientation="left"></nz-divider>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words">字母组合一</nz-form-label>
<nz-form-control [nzSpan]="6">
<input nz-input type="text" id="words" [(ngModel)]="item.words" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_audio_url">字母组合一发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder [audioUrl]="item.words_audio_url" id="words_audio_url"
(audioUploaded)="onAudioUploadSuccess($event,item, 'words_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_two">字母组合二</nz-form-label>
<nz-form-control [nzSpan]="6">
<input nz-input type="text" id="words_two" [(ngModel)]="item.words_two" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_two_audio_url">字母组合二发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder
[audioUrl]="item.words_two_audio_url" id="words_two_audio_url"
(audioUploaded)="onAudioUploadSuccess($event,item, 'words_two_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</div>
<div>
<nz-divider nzText="单词组" nzOrientation="left"></nz-divider>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_two">字母组合二</nz-form-label>
<nz-form-control [nzSpan]="6">
<input nz-input type="text" id="words_two" [(ngModel)]="item.words_two" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="3" nzFor="words_two_audio_url">字母组合二发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder [audioUrl]="item.words_two_audio_url" id="words_two_audio_url"
(audioUploaded)="onAudioUploadSuccess($event,item, 'words_two_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</div>
<div>
<nz-divider nzText="单词组" nzOrientation="left"></nz-divider>
<nz-form-item>
<nz-form-control [nzSpan]="20" nzOffset="2">
<div *ngFor="let it of wordArr; let i = index" class="card-item" style="padding: 0.5vw;">
<div class="border">
<h5 style="width: 100%; line-height: 40px; text-align: center;"> 单词组-{{i+1}}</h5>
<nz-divider nzText="左侧单词" nzOrientation="left"></nz-divider>
<nz-divider nzText="左侧单词" nzOrientation="left"></nz-divider>
<div nz-form>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.left.word_val">单词</nz-form-label>
<nz-form-control [nzSpan]="6">
<input type="text" nz-input placeholder="请录入单词" [(ngModel)]="it.left.word_val" (blur)="saveWordItem(i,'left')">
<input type="text" nz-input placeholder="请录入单词" [(ngModel)]="it.left.word_val"
(blur)="saveWordItem(i,'left')">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.left.word_audio_url">发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder id="it.left.word_audio_url"
[audioUrl]="it.left.word_audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it.left,'word_audio_url')">
<app-audio-recorder id="it.left.word_audio_url" [audioUrl]="it.left.word_audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it.left,'word_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<div nz-col [nzSpan]="15" nzOffset="2">
<nz-table [nzData]="it.left.letters" [nzHideOnSinglePage]="true" [nzBordered]="true">
<thead>
<tr>
<th>字母</th>
<th>颜色</th>
<th>是否填空</th>
</tr>
<tr>
<th>字母</th>
<th>颜色</th>
<th>是否填空</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of it.left.letters;let j = index">
<td>{{data.letter_val}}</td>
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<!--<nz-option nzValue="C01" nzLabel="绿色"></nz-option>-->
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<!--<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>-->
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</td>
<td>
<nz-select [(ngModel)]="data.is_" (ngModelChange)="saveItem()">
<nz-option nzValue="1" nzLabel="是"></nz-option>
<nz-option nzValue="0" nzLabel="否"></nz-option>
</nz-select>
</td>
</tr>
<tr *ngFor="let data of it.left.letters;let j = index">
<td>{{data.letter_val}}</td>
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<!--<nz-option nzValue="C01" nzLabel="绿色"></nz-option>-->
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<!--<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>-->
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</td>
<td>
<nz-select [(ngModel)]="data.is_" (ngModelChange)="saveItem()">
<nz-option nzValue="1" nzLabel="是"></nz-option>
<nz-option nzValue="0" nzLabel="否"></nz-option>
</nz-select>
</td>
</tr>
</tbody>
</nz-table>
</div>
</nz-form-item>
</div>
<nz-divider nzText="右侧单词" nzOrientation="left"></nz-divider>
</div>
<nz-divider nzText="右侧单词" nzOrientation="left"></nz-divider>
<div nz-form>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.right.word_val">单词</nz-form-label>
<nz-form-control [nzSpan]="6">
<input type="text" nz-input placeholder="请录入单词" [(ngModel)]="it.right.word_val" (blur)="saveWordItem(i,'right')">
<input type="text" nz-input placeholder="请录入单词" [(ngModel)]="it.right.word_val"
(blur)="saveWordItem(i,'right')">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.right.word_audio_url">发音</nz-form-label>
<nz-form-control [nzSpan]="6">
<app-audio-recorder id="it.right.word_audio_url"
[audioUrl]="it.right.word_audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it.right,'word_audio_url')">
<app-audio-recorder id="it.right.word_audio_url" [audioUrl]="it.right.word_audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it.right,'word_audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<div nz-col [nzSpan]="22" nzOffset="1">
<nz-table [nzData]="it.right.letters" [nzHideOnSinglePage]="true" [nzBordered]="true">
<thead>
<tr>
<th>字母</th>
<th>颜色</th>
<th>是否填空</th>
</tr>
<tr>
<th>字母</th>
<th>颜色</th>
<th>是否填空</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of it.right.letters;let j = index">
<td>{{data.letter_val}}</td>
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</td>
<td>
<nz-select [(ngModel)]="data.is_" (ngModelChange)="saveItem()">
<nz-option nzValue="1" nzLabel="是"></nz-option>
<nz-option nzValue="0" nzLabel="否"></nz-option>
</nz-select>
</td>
</tr>
<tr *ngFor="let data of it.right.letters;let j = index">
<td>{{data.letter_val}}</td>
<td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</td>
<td>
<nz-select [(ngModel)]="data.is_" (ngModelChange)="saveItem()">
<nz-option nzValue="1" nzLabel="是"></nz-option>
<nz-option nzValue="0" nzLabel="否"></nz-option>
</nz-select>
</td>
</tr>
</tbody>
</nz-table>
</div>
......@@ -223,12 +224,11 @@
</nz-form-item>
<nz-form-item>
<nz-form-control [nzSpan]="3" nzOffset="3" class="add-btn-box">
<button nz-button nzType="dashed" class="add-btn" id="add-btn"
(click)="addItem()">
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addItem()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
\ No newline at end of file
</div>
\ No newline at end of file
......@@ -995,7 +995,9 @@ export class PlayComponent implements OnInit, OnDestroy {
words_content.fontColor = '#ab5a23';
words_content.refreshSize();
words_bg.addChild(words_content);
words_bg.setScaleXY(this.mapScale);
words_bg.setRadius(words_content.width/3*2);
let scale = getMinScale(words_bg, 80)*this.mapScale
words_bg.setScaleXY(scale);
const words_bg_right = new ShapeCircle();
words_bg_right.setRadius(50);
......@@ -1011,7 +1013,9 @@ export class PlayComponent implements OnInit, OnDestroy {
words_content_right.fontColor = '#fdcd00';
words_content_right.refreshSize();
words_bg_right.addChild(words_content_right);
words_bg_right.setScaleXY(this.mapScale);
words_bg_right.setRadius(words_content.width/3*2);
let scale_r = getMinScale(words_bg_right, 80)*this.mapScale
words_bg_right.setScaleXY(scale_r);
this.body_bg.addChild(words_bg);
this.words_bg = words_bg ;
......
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