mirror of
https://github.com/stevenjoezhang/live2d-widget.git
synced 2024-11-25 14:21:28 +08:00
Update waifu-tips.js
This commit is contained in:
parent
aecffb2db9
commit
4d89c96e0e
@ -194,18 +194,18 @@ function loadWidget(config) {
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
window.addEventListener("mouseover", event => {
|
||||
for (let tips of result.mouseover) {
|
||||
if (!event.target.matches(tips.selector)) continue;
|
||||
let text = randomSelection(tips.text);
|
||||
for (let { selector, text } of result.mouseover) {
|
||||
if (!event.target.matches(selector)) continue;
|
||||
text = randomSelection(tips.text);
|
||||
text = text.replace("{text}", event.target.innerText);
|
||||
showMessage(text, 4000, 8);
|
||||
return;
|
||||
}
|
||||
});
|
||||
window.addEventListener("click", event => {
|
||||
for (let tips of result.click) {
|
||||
if (!event.target.matches(tips.selector)) continue;
|
||||
let text = randomSelection(tips.text);
|
||||
for (let { selector, text } of result.click) {
|
||||
if (!event.target.matches(selector)) continue;
|
||||
text = randomSelection(tips.text);
|
||||
text = text.replace("{text}", event.target.innerText);
|
||||
showMessage(text, 4000, 8);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user