-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript_elements.py
48 lines (43 loc) · 1.54 KB
/
script_elements.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# script_elements.py
#旁白
def Narration(content):
return f"""
<div class="narration">{content}</div>"""
#字幕
def Sticker(content,alignment):
# 如果 alignment 为空,则将其默认设置为 "left"
alignment_style = f"text-align: {alignment};" if alignment else "text-align: left;"
return f"""
<div class="sticker" style="{alignment_style}">{content}</div>"""
#插图,包括background和各种
def Image(content):
return f"""
<img src="{content}" alt="{content}">"""
#单头像对话
def Dialogue_with_one_avatar(character_name, avatar, content):
#<img src="{avatar}" alt="{character_name}">/* 头像没截,暂时留空 */
return f"""
<div class="dialogue">
<div class="avatar-container">
</div>
<div class="info">
<span class="character-name">{character_name}</span>
<span class="content">{content}</span>
</div>
</div>"""
#无头像对话
def Dialogue_without_avatar(character_name,content):
return f"""
<div class="dialogue">
<div class="avatar-container"></div>
<div class="info">
<span class="character-name">{character_name}</span>
<span class="content">{content}</span>
</div>
</div>"""
#选项,右置对话
def Dialogue_right(content):
return f"""
<div class="dialogue_right">
<span class="content_right">{content}</span>
</div>"""