Commit 9fa8b6aa authored by Chen Jiping's avatar Chen Jiping

feat:增加标题字体缩放

parent da264751
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="content"> <div class="content">
<input type="hidden" id='keyWord'> <input type="hidden" id='keyWord'>
<div style="position: absolute; top: 0.25rem; left: 10%; z-index: 99;"> <div style="position: absolute; top: 0.25rem; left: 10%; z-index: 99;">
<span class="title">请同学们根据视频复述课文</span> <p class="title">请同学们根据视频复述课文</p>
</div> </div>
<div role="tea" id="tea"> <div role="tea" id="tea">
......
...@@ -280,6 +280,9 @@ class PlayView { ...@@ -280,6 +280,9 @@ class PlayView {
$(".title").append(this.data.title); $(".title").append(this.data.title);
} }
//改变字体大小
changeFontSize($(".title"));
$("#keyWord").val(this.data.keyWord); $("#keyWord").val(this.data.keyWord);
if (ROLE == "tea") { if (ROLE == "tea") {
...@@ -314,6 +317,23 @@ class PlayView { ...@@ -314,6 +317,23 @@ class PlayView {
} }
} }
function changeFontSize(_dom){
const txtLen = _dom.width();
console.log("text length:", txtLen);
if(txtLen < 520){
_dom.css("font-size", "0.7rem");
} else if (txtLen < 600) {
_dom.css("font-size", "0.60rem");
} else if (txtLen < 700) {
_dom.css("font-size", "0.55rem");
} else if (txtLen < 800) {
_dom.css("font-size", "0.50rem");
} else {
_dom.css("font-size", "0.45rem");
}
}
/** /**
* *
* @param {*} aspect 断线恢复 * @param {*} aspect 断线恢复
......
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