Commit 18c897cd authored by liujiangnan's avatar liujiangnan

feat: 添加背景图

parent 8898c4b3
<div class="player-preview-content"> <div class="body-bg"></div>
<div class="player-border">
<div class="player-preview-content">
<div <div
#pic #pic
class="p-courseware-image-audio" class="p-courseware-image-audio"
...@@ -23,4 +25,5 @@ ...@@ -23,4 +25,5 @@
> >
</div> </div>
</div> </div>
</div>
</div> </div>
@import '../../app/style/123common_mixin.scss'; @import '../../app/style/123common_mixin.scss';
.body-bg {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background-image: url('../../assets/player-bg.png') !important;
background-size: 100%;
}
.player-border{
position: absolute;
left: calc((100% - 100vh * 1.36)/ 2);
top: 5vh;
right: calc((100% - 100vh * 1.36)/ 2);
bottom: 5vh;
text-align: center;
// box-shadow: 0 2px 12px 0 rgba(0,0,0,.3);
border-radius: 11px;
border: 20px solid #23b1c2;
background-color: #fff;
overflow: hidden;
color: #303133;
transition: .3s;
}
.player-preview-content { .player-preview-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core'; import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit, ApplicationRef, ChangeDetectorRef } from '@angular/core';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { import {
Label, Label,
...@@ -52,6 +52,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -52,6 +52,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
@Input() sid; @Input() sid;
showQuestion: boolean; showQuestion: boolean;
constructor(private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef) {
}
ngOnInit() { ngOnInit() {
this.data = { this.data = {
contentObj: { contentObj: {
...@@ -129,5 +134,14 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -129,5 +134,14 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this.showQuestion = !this.showQuestion; this.showQuestion = !this.showQuestion;
} }
/**
* 刷新 渲染页面
*/
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
} }
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