add Firefox support

This commit is contained in:
底层用户 2022-01-29 16:46:29 +08:00
parent d07179342c
commit 3817e6e43d
3 changed files with 39 additions and 0 deletions

22
css/firefox.css Normal file
View File

@ -0,0 +1,22 @@
#section {
background-image: url(../img/background.jpg) !important;
}
.message,
.time,
.hitokoto,
.music,
.link-card,
.more,
.box-wrapper,
footer {
background: rgba(0, 0, 0, 0.5);
}
.link-card:hover {
background: rgb(0, 0, 0, 0.6);
}
.progress {
background: rgba(0, 0, 0, 0.5) !important;
}

View File

@ -308,6 +308,7 @@ i#next {
}
.music-text {
margin-top: 6px;
font-size: 1.10rem;
text-overflow: ellipsis;
max-width: 220px;

View File

@ -34,6 +34,22 @@ iziToast.settings({
iconColor: '#efefef',
});
//火狐浏览器独立样式
if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.href = './css/firefox.css';
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link);
iziToast.info({
timeout: 8000,
iconUrl: './img/warn.png',
title: '兼容提醒',
message: '您正在使用火狐浏览器,部分功能可能不支持'
});
}
//获取一言
fetch('https://v1.hitokoto.cn?max_length=24')
.then(response => response.json())