Skip to content

Commit 82c2254

Browse files
committed
修理名字框閃現的問題
1 parent 2443cb9 commit 82c2254

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

html/樣式/主樣式.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,11 @@ video {
106106
}
107107

108108
#名字框 {
109-
display: none;
110-
/*防止一開始閃現*/
109+
opacity: 0;
110+
transition: opacity 0.3s, width 0.3s;
111111
position: absolute;
112112
top: 0px;
113113
left: 80px;
114-
/*height:25%;*/
115114
}
116115

117116
#話語框 {
@@ -143,6 +142,9 @@ video {
143142
#話語{
144143
white-space: pre-line;
145144
}
145+
.旁白:before{
146+
content: '  ';
147+
}
146148
.對話:before{
147149
content: '「';
148150
display: block;

html/演出.coffee

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,20 @@ window.演出 =
213213
this.換圖('bg', 背景圖片, 淡入時間, 漸變方法)
214214

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

220224
淡入過期時間: 0,
221225
換對話: (text, 名字) ->
222226
if 名字 != ''
223-
$('#名字框').fadeIn(200)
224227
$('#話語').attr('class','對話')
225228
else
226-
$('#名字框').fadeOut(200)
227229
$('#話語').attr('class','旁白')
228-
text = '  ' + text
229230
淡入字 = 演出.文字淡入(text)
230231
$('#話語').html(淡入字.內容)
231232
演出.淡入過期時間 = Date.now() + 淡入字.總時間 * 1000

html/演出.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)