Skip to content

Commit

Permalink
實現奇怪的CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
RimoChan committed Feb 28, 2020
1 parent 4925f84 commit 9608baa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Librian本體/前端/dist/_統合.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Librian本體/前端/dist/bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Librian本體/前端/src/主樣式.sass
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ div
#話語
white-space: pre-line
&[對話類型=旁白] #話語
&:before
content: '  '
// text-indent: 2em each-line
--幹你娘老子就是要每行都縮進: 2
&[對話類型=對話] #話語
&:before
content: ''
Expand Down
12 changes: 8 additions & 4 deletions Librian本體/前端/src/演出.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ export default 演出 =
else if 位置 != this.現在背景[1]
$('#bg').css('background-position', 位置)
this.現在背景 = [背景圖片, 位置]


換人名: (語者, 名字) ->
名字 = this.翻譯(名字)
Expand All @@ -247,18 +246,23 @@ export default 演出 =
換對話: (話語, 名字, 瞬間化) ->
話語 = this.翻譯(話語)
名字 = this.翻譯(名字)
$('#對話歷史').append(話語+'<br/><br/>')

if 名字 != ''
$('#對話框').attr('對話類型','對話')
else
$('#對話框').attr('對話類型','旁白')


if $("#話語").css("--幹你娘老子就是要每行都縮進")
縮進 = ' '.repeat(parseInt($("#話語").css("--幹你娘老子就是要每行都縮進")))
話語 = 話語.replace(/(^|\n)/g, "$1#{縮進}")

if 瞬間化
$('#話語').html(話語 + '<span></span>')
else
淡入字 = 演出.文字淡入(話語)
$('#話語').html(淡入字.內容)
演出.淡入過期時間 = Date.now() + 淡入字.文字時間 * 1000
$('#對話歷史').append(話語+'<br/><br/>')
早泄: ->
$('#話語 *').css('animation','None')
$('#話語 *').css('opacity','1')
Expand Down Expand Up @@ -310,7 +314,7 @@ export default 演出 =

文字淡入: (s, 動畫名 = '_淡入') ->
時間間隔 = v.用戶設置.文字速度.值 / 800
group = s.replace(/((<.*?>)|(.))/g, "$2$3\0").split('\0')
group = s.replace(/(\s*((<.*?>)|(.)))/g, "$1\0").split('\0')
動畫時間 = 時間間隔 * 8
時間 = 0
內容 = (for i in group
Expand Down

0 comments on commit 9608baa

Please sign in to comment.