Skip to content

Commit

Permalink
修理名字框閃現的問題
Browse files Browse the repository at this point in the history
  • Loading branch information
RimoChan committed Jun 30, 2019
1 parent 2443cb9 commit 82c2254
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
8 changes: 5 additions & 3 deletions html/樣式/主樣式.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ video {
}

#名字框 {
display: none;
/*防止一開始閃現*/
opacity: 0;
transition: opacity 0.3s, width 0.3s;
position: absolute;
top: 0px;
left: 80px;
/*height:25%;*/
}

#話語框 {
Expand Down Expand Up @@ -143,6 +142,9 @@ video {
#話語{
white-space: pre-line;
}
.旁白:before{
content: '  ';
}
.對話:before{
content: '「';
display: block;
Expand Down
9 changes: 5 additions & 4 deletions html/演出.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,20 @@ window.演出 =
this.換圖('bg', 背景圖片, 淡入時間, 漸變方法)

換人名: (語者, 名字) ->
$('#名字').html(名字)
if 名字
$('#名字').html(名字)
$('#名字框').css('opacity', 1)
else
$('#名字框').css('opacity', 0)
$('#對話歷史').append(名字+'<br/>')
$('#對話框').attr('class','人物--' + 語者)

淡入過期時間: 0,
換對話: (text, 名字) ->
if 名字 != ''
$('#名字框').fadeIn(200)
$('#話語').attr('class','對話')
else
$('#名字框').fadeOut(200)
$('#話語').attr('class','旁白')
text = '  ' + text
淡入字 = 演出.文字淡入(text)
$('#話語').html(淡入字.內容)
演出.淡入過期時間 = Date.now() + 淡入字.總時間 * 1000
Expand Down
12 changes: 6 additions & 6 deletions html/演出.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82c2254

Please sign in to comment.