添加了圣诞小镇有掉落物时的颜色渐变效果

This commit is contained in:
woohoo 2021-12-22 01:30:30 +08:00
parent 058bbd8c8e
commit 4e78d137df

View File

@ -1,8 +1,8 @@
// ==UserScript== // ==UserScript==
// @lastmodified 202112212145 // @lastmodified 202112220130
// @name Torn翻译 // @name Torn翻译
// @namespace WOOH // @namespace WOOH
// @version 0.1.1221b // @version 0.1.1222a
// @description Torn UI翻译 // @description Torn UI翻译
// @author Woohoo-[2687093] sabrina_devil[2696209] // @author Woohoo-[2687093] sabrina_devil[2696209]
// @match https://www.torn.com/* // @match https://www.torn.com/*
@ -23,6 +23,11 @@
todo: true, todo: true,
cont: `baza npc商店 imarket及imarket搜索结果`, cont: `baza npc商店 imarket及imarket搜索结果`,
}, },
{
ver: '0.1.1222a',
date: '20211222',
cont: `添加了圣诞小镇有掉落物时的颜色渐变效果`,
},
{ {
ver: '0.1.1221b', ver: '0.1.1221b',
date: '20211221', date: '20211221',
@ -1215,6 +1220,7 @@
'{$} is currently traveling': '{$} 目前正在飞行', '{$} is currently traveling': '{$} 目前正在飞行',
'{$} has no items in their bazaar': '{$} 的集市上没有物品', '{$} has no items in their bazaar': '{$} 的集市上没有物品',
'View {$}\'s bazaar': '{$} 的集市上没有物品', 'View {$}\'s bazaar': '{$} 的集市上没有物品',
'{$} is currently in hospital': '{$} 在住院中',
'Place a bounty on {$}': '悬赏 {$}', 'Place a bounty on {$}': '悬赏 {$}',
'Report {$} to staff': '向 Torn City 工作人员举报 {$}', 'Report {$} to staff': '向 Torn City 工作人员举报 {$}',
'Attack {$}': '攻击 {$}', 'Attack {$}': '攻击 {$}',
@ -5470,13 +5476,19 @@ margin: 0 0 3px;
if (!$wh_loot_container) { if (!$wh_loot_container) {
const insert_html = `<div id="wh-loot-container" class="m-bottom10"> const insert_html = `<div id="wh-loot-container" class="m-bottom10">
<div class="title-black"><span>附近物品</span></div> <div class="title-black"><span>附近物品</span></div>
<div id="wh-loot-container-main" class="cont-gray" style="padding: 0.5em"> <div id="wh-loot-container-main" class="cont-gray" style="">
<b>物品</b><span id="wh-loot-item-count"></span> <b>物品</b><span id="wh-loot-item-count"></span>
<div id="wh-loot-container-items" style="overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;"></div> <div id="wh-loot-container-items" style="overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;"></div>
<b>箱子</b><span id="wh-loot-chest-count"></span> <b>箱子</b><span id="wh-loot-chest-count"></span>
<div id="wh-loot-container-chests" style="overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;"></div> <div id="wh-loot-container-chests" style="overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;"></div>
</div> </div>
</div>`; </div>
<style>#wh-loot-container-main{padding: 0.5em;}
@keyframes lootFoundAlert {
0% {background: #f2f2f2}
50% {background: #2e8b57}
100% {background: #f2f2f2}
}</style>`;
$($city_wrapper).before(insert_html); $($city_wrapper).before(insert_html);
} }
let item_list = []; let item_list = [];
@ -5516,7 +5528,12 @@ margin: 0 0 3px;
} }
}); });
$root.querySelector('#wh-loot-item-count').innerText = `(${item_count})`; $root.querySelector('#wh-loot-item-count').innerText = `(${item_count})`;
if (item_count === 0) $wh_loot_container_items.innerText = `暂无`; if (item_count === 0) {
$wh_loot_container_items.innerText = `暂无`;
$root.querySelector('#wh-loot-container-main').style.animation ='';
} else {
$root.querySelector('#wh-loot-container-main').style.animation = 'lootFoundAlert 2s infinite';
}
$root.querySelector('#wh-loot-chest-count').innerText = `(${chest_count})`; $root.querySelector('#wh-loot-chest-count').innerText = `(${chest_count})`;
if (chest_count === 0) $wh_loot_container_chests.innerText = `暂无`; if (chest_count === 0) $wh_loot_container_chests.innerText = `暂无`;
} }