💄 更新 daily_material 的样式

🐛 修复了材料系列名不正确的 `bug`
This commit is contained in:
Karako 2022-09-22 11:11:23 +08:00
parent 1e04cd76b6
commit 72fc828c55
No known key found for this signature in database
GPG Key ID: 5920831B0095D4A0
5 changed files with 30 additions and 12 deletions

View File

@ -82,7 +82,11 @@ def get_material_serial_name(names: Iterable[str]) -> str:
for sub_string in all_substrings(name_a):
if sub_string in ArkoWrapper(all_substrings(name_b)):
result.append(sub_string)
return ArkoWrapper(result).sort(len, reverse=True)[0].strip('')
result = ArkoWrapper(result).sort(len, reverse=True)[0]
chars = {'': 0, '': 0}
for char, k in chars.items():
result = result.split(char)[k]
return result
class DailyMaterial(Plugin, BasePlugin):
@ -183,7 +187,6 @@ class DailyMaterial(Plugin, BasePlugin):
return
notice = await update.message.reply_text("派蒙可能需要找找图标素材,还请耐心等待哦~")
self._add_delete_message_job(context, notice.chat_id, notice.message_id, 5)
await update.message.reply_chat_action(ChatAction.TYPING)
# 获取已经缓存的秘境素材信息
@ -251,6 +254,7 @@ class DailyMaterial(Plugin, BasePlugin):
character_img_data, weapon_img_data = tuple(map(lambda x: x.result(), render_tasks))
self._add_delete_message_job(context, notice.chat_id, notice.message_id, 5)
await update.message.reply_chat_action(ChatAction.UPLOAD_PHOTO)
if full: # 是否发送原图
await update.message.reply_media_group([

View File

@ -45,9 +45,11 @@
</div>
<div class="area-content">
{% for item in area.items %}
<div class="item character"
<div
{% if data.uid != none and item.level == none %}
style="filter: grayscale(80%);"
class="item character item-not-owned"
{% else %}
class="item character"
{% endif %}
>
<div class="item-icon"

View File

@ -71,14 +71,14 @@
</span>
</div>
<div class="area-content">
<div class="item character" style="filter: grayscale(80%);">
<div class="item character item-not-owned">
<div class="item-icon" style="background-image: url(./bg/rarity/full/5.png)">
<div>Lv.90</div>
<div style="background-color: rgba(255, 20, 147, 0.8); backdrop-filter: blur(3px);">6命</div>
<img src="../../assets/character/itto_057/icon.webp" alt="神里绫华"/>
<img src="../../assets/character/itto_057/icon.webp" alt="一斗"/>
</div>
<div class="item-name">
<div>神里绫华</div>
<div>一斗</div>
</div>
</div>
<div class="item character">
@ -183,7 +183,7 @@
</span>
</div>
<div class="area-content">
<div class="item character" style="filter: grayscale(80%);">
<div class="item character">
<div class="item-icon" style="background-image: url(./bg/rarity/full/5.png)">
<div>Lv.90</div>
<div style="background-color: rgba(255, 20, 147, 0.8); backdrop-filter: blur(3px);">6命</div>
@ -299,9 +299,9 @@
</span>
</div>
<div class="area-content">
<div class="item weapon">
<div class="item weapon item-not-owned">
<div class="role">
<img src="../../assets/character/shenhe_063/side.webp" alt="神里绫华"/>
<img src="../../assets/character/shenhe_063/side.webp" alt="申鹤"/>
</div>
<div class="item-icon" style="background-image: url(./bg/rarity/full/5.png)">
<div>Lv.90</div>

View File

@ -213,6 +213,16 @@ body {
justify-content: center;
}
.item-not-owned:before {
content: "";
position: absolute;
width: 150px;
height: 187px;
background-color: rgb(0 0 0 / 50%);
z-index: 2;
border-radius: 10px;
}
.item-icon {
width: inherit;
height: 152px;

View File

@ -45,9 +45,11 @@
</div>
<div class="area-content">
{% for item in area.items %}
<div class="item weapon"
<div
{% if data.uid != none and (item.level == none or item.level >= 81) %}
style="filter: grayscale(80%);"
class="item weapon item-not-owned"
{% else %}
class="item weapon"
{% endif %}
>
{% if item.c_path != none %}