diff --git a/css/firefox.css b/css/firefox.css new file mode 100644 index 0000000..ccc673d --- /dev/null +++ b/css/firefox.css @@ -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; +} diff --git a/css/style.css b/css/style.css index 4e7b782..d250a40 100644 --- a/css/style.css +++ b/css/style.css @@ -308,6 +308,7 @@ i#next { } .music-text { + margin-top: 6px; font-size: 1.10rem; text-overflow: ellipsis; max-width: 220px; diff --git a/js/main.js b/js/main.js index b743026..348b6c9 100644 --- a/js/main.js +++ b/js/main.js @@ -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())