mirror of
https://github.com/caojiezi2003/live2d-widget.git
synced 2024-11-22 15:19:44 +00:00
Optimize CSS
This commit is contained in:
parent
417f29519d
commit
df050c8865
@ -82,13 +82,13 @@ function loadWidget(waifuPath, apiPath) {
|
||||
var referrer = document.createElement("a");
|
||||
referrer.href = document.referrer;
|
||||
var domain = referrer.hostname.split(".")[1];
|
||||
if (location.hostname == referrer.hostname) text = `欢迎阅读<span style="color:#0099cc;">「${document.title.split(" - ")[0]}」</span>`;
|
||||
else if (domain == "baidu") text = `Hello!来自 百度搜索 的朋友<br>你是搜索 <span style="color:#0099cc;">${referrer.search.split("&wd=")[1].split("&")[0]}</span> 找到的我吗?`;
|
||||
else if (domain == "so") text = `Hello!来自 360搜索 的朋友<br>你是搜索 <span style="color:#0099cc;">${referrer.search.split("&q=")[1].split("&")[0]}</span> 找到的我吗?`;
|
||||
else if (domain == "google") text = `Hello!来自 谷歌搜索 的朋友<br>欢迎阅读<span style="color:#0099cc;">「${document.title.split(" - ")[0]}」</span>`;
|
||||
else text = `Hello!来自 <span style="color:#0099cc;">${referrer.hostname}</span> 的朋友`;
|
||||
if (location.hostname == referrer.hostname) text = `欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
|
||||
else if (domain == "baidu") text = `Hello!来自 百度搜索 的朋友<br>你是搜索 <span>${referrer.search.split("&wd=")[1].split("&")[0]}</span> 找到的我吗?`;
|
||||
else if (domain == "so") text = `Hello!来自 360搜索 的朋友<br>你是搜索 <span>${referrer.search.split("&q=")[1].split("&")[0]}</span> 找到的我吗?`;
|
||||
else if (domain == "google") text = `Hello!来自 谷歌搜索 的朋友<br>欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
|
||||
else text = `Hello!来自 <span>${referrer.hostname}</span> 的朋友`;
|
||||
} else {
|
||||
text = `欢迎阅读<span style="color:#0099cc;">「${document.title.split(" - ")[0]}」</span>`;
|
||||
text = `欢迎阅读<span>「${document.title.split(" - ")[0]}」</span>`;
|
||||
}
|
||||
showMessage(text, 7000, 8);
|
||||
}
|
||||
@ -120,7 +120,7 @@ function loadWidget(waifuPath, apiPath) {
|
||||
else fetch("https://v1.hitokoto.cn")
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
var text = `这句一言来自 <span style="color:#0099cc;">「${result.from}」</span>,是 <span style="color:#0099cc;">${result.creator}</span> 在 hitokoto.cn 投稿的。`;
|
||||
var text = `这句一言来自 <span>「${result.from}」</span>,是 <span>${result.creator}</span> 在 hitokoto.cn 投稿的。`;
|
||||
showMessage(result.hitokoto, 6000, 9);
|
||||
setTimeout(() => {
|
||||
showMessage(text, 4000, 9);
|
||||
|
@ -70,19 +70,19 @@
|
||||
"text": ["代码可以直接点击复制哟。", "GitHub!我是新手!", "PHP 是最好的语言!"]
|
||||
}, {
|
||||
"selector": ".container a[href^='http'], .nav-link .nav-text",
|
||||
"text": ["要去看看 <span style=\"color:#0099cc;\">{text}</span> 么?", "去 <span style=\"color:#0099cc;\">{text}</span> 逛逛吧。", "到 <span style=\"color:#0099cc;\">{text}</span> 看看吧。"]
|
||||
"text": ["要去看看 <span>{text}</span> 么?", "去 <span>{text}</span> 逛逛吧。", "到 <span>{text}</span> 看看吧。"]
|
||||
}, {
|
||||
"selector": "a[href^='mailto']",
|
||||
"text": ["邮件我会及时回复的!", "点击就可以发送邮件啦~"]
|
||||
}, {
|
||||
"selector": "a[href^='/tags/']",
|
||||
"text": ["要去看看 <span style=\"color:#0099cc;\">{text}</span> 标签么?", "点它可以查看此标签下的所有文章哟!"]
|
||||
"text": ["要去看看 <span>{text}</span> 标签么?", "点它可以查看此标签下的所有文章哟!"]
|
||||
}, {
|
||||
"selector": "a[href^='/categories/']",
|
||||
"text": ["要去看看 <span style=\"color:#0099cc;\">{text}</span> 分类么?", "点它可以查看此分类下的所有文章哟!"]
|
||||
"text": ["要去看看 <span>{text}</span> 分类么?", "点它可以查看此分类下的所有文章哟!"]
|
||||
}, {
|
||||
"selector": ".post-title-link",
|
||||
"text": ["要看看 <span style=\"color:#0099cc;\">{text}</span> 这篇文章吗?"]
|
||||
"text": ["要看看 <span>{text}</span> 这篇文章吗?"]
|
||||
}, {
|
||||
"selector": "a[rel='contents']",
|
||||
"text": ["点击来阅读全文哦。"]
|
||||
@ -177,39 +177,39 @@
|
||||
}],
|
||||
"seasons": [{
|
||||
"date": "01/01",
|
||||
"text": "<span style=\"color:#0099cc;\">元旦</span>了呢,新的一年又开始了,今年是{year}年~"
|
||||
"text": "<span>元旦</span>了呢,新的一年又开始了,今年是{year}年~"
|
||||
}, {
|
||||
"date": "02/14",
|
||||
"text": "又是一年<span style=\"color:#0099cc;\">情人节</span>,{year}年找到对象了嘛~"
|
||||
"text": "又是一年<span>情人节</span>,{year}年找到对象了嘛~"
|
||||
}, {
|
||||
"date": "03/08",
|
||||
"text": "今天是<span style=\"color:#0099cc;\">国际妇女节</span>!"
|
||||
"text": "今天是<span>国际妇女节</span>!"
|
||||
}, {
|
||||
"date": "03/12",
|
||||
"text": "今天是<span style=\"color:#0099cc;\">植树节</span>,要保护环境呀!"
|
||||
"text": "今天是<span>植树节</span>,要保护环境呀!"
|
||||
}, {
|
||||
"date": "04/01",
|
||||
"text": "悄悄告诉你一个秘密~<span style=\"background-color:#34495e;\">今天是愚人节,不要被骗了哦~</span>"
|
||||
"text": "悄悄告诉你一个秘密~<span>今天是愚人节,不要被骗了哦~</span>"
|
||||
}, {
|
||||
"date": "05/01",
|
||||
"text": "今天是<span style=\"color:#0099cc;\">五一劳动节</span>,计划好假期去哪里了吗~"
|
||||
"text": "今天是<span>五一劳动节</span>,计划好假期去哪里了吗~"
|
||||
}, {
|
||||
"date": "06/01",
|
||||
"text": "<span style=\"color:#0099cc;\">儿童节</span>了呢,快活的时光总是短暂,要是永远长不大该多好啊…"
|
||||
"text": "<span>儿童节</span>了呢,快活的时光总是短暂,要是永远长不大该多好啊…"
|
||||
}, {
|
||||
"date": "09/03",
|
||||
"text": "<span style=\"color:#0099cc;\">中国人民抗日战争胜利纪念日</span>,铭记历史、缅怀先烈、珍爱和平、开创未来。"
|
||||
"text": "<span>中国人民抗日战争胜利纪念日</span>,铭记历史、缅怀先烈、珍爱和平、开创未来。"
|
||||
}, {
|
||||
"date": "09/10",
|
||||
"text": "<span style=\"color:#0099cc;\">教师节</span>,在学校要给老师问声好呀~"
|
||||
"text": "<span>教师节</span>,在学校要给老师问声好呀~"
|
||||
}, {
|
||||
"date": "10/01",
|
||||
"text": "<span style=\"color:#0099cc;\">国庆节</span>到了,为祖国母亲庆生!"
|
||||
"text": "<span>国庆节</span>到了,为祖国母亲庆生!"
|
||||
}, {
|
||||
"date": "11/05-11/12",
|
||||
"text": "今年的<span style=\"color:#0099cc;\">双十一</span>是和谁一起过的呢~"
|
||||
"text": "今年的<span>双十一</span>是和谁一起过的呢~"
|
||||
}, {
|
||||
"date": "12/20-12/31",
|
||||
"text": "这几天是<span style=\"color:#0099cc;\">圣诞节</span>,主人肯定又去剁手买买买了~"
|
||||
"text": "这几天是<span>圣诞节</span>,主人肯定又去剁手买买买了~"
|
||||
}]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user