修改友链

This commit is contained in:
2020-09-26 19:03:34 +08:00
parent dbebc68cb0
commit 0e2e8ca254
13 changed files with 100 additions and 631 deletions

View File

@ -2,11 +2,11 @@ import '~/layouts/common.styl'
import vditor from 'vditor'
import 'vditor/dist/index.css'
const $tags = document.getElementById('tags')
let floatTop = null
if ($tags) {
floatTop = $tags.offsetTop + $tags.scrollHeight + 30
}
// const $tags = document.getElementById('tags')
// let floatTop = null
// if ($tags) {
// floatTop = $tags.offsetTop + $tags.scrollHeight + 30
// }
function addEvent (obj, type, fn) {
if (obj.attachEvent) {
@ -25,35 +25,35 @@ window.onload = function () {
alert('您的浏览器版本过低,继续访问将会出现问题,请升级浏览器版本!') // eslint-disable-line
}
// 底部返回顶部按钮
const top = document.getElementById('gotop')
if (top) {
// 滚动一屏幕时显示回到顶部
addEvent(window, 'scroll', function () {
const currentPosition = document.documentElement.scrollTop || document.body.scrollTop
currentPosition > window.screen.availHeight ? top.style.display = 'block' : top.style.display = 'none'
// // 底部返回顶部按钮
// const top = document.getElementById('gotop')
// if (top) {
// // 滚动一屏幕时显示回到顶部
// addEvent(window, 'scroll', function () {
// const currentPosition = document.documentElement.scrollTop || document.body.scrollTop
// currentPosition > window.screen.availHeight ? top.style.display = 'block' : top.style.display = 'none'
// 左部导航自动浮动
if (currentPosition > floatTop && document.body.clientWidth > 768) {
document.getElementById('navication').style.position = 'fixed'
} else {
document.getElementById('navication').style.position = 'static'
}
})
// // 左部导航自动浮动
// if (currentPosition > floatTop && document.body.clientWidth > 768) {
// document.getElementById('navication').style.position = 'fixed'
// } else {
// document.getElementById('navication').style.position = 'static'
// }
// })
top.onclick = function () {
var timer = setInterval(function () { // eslint-disable-line
let currentPosition = document.documentElement.scrollTop || document.body.scrollTop
currentPosition -= 100
if (currentPosition > 0) {
window.scrollTo(0, currentPosition)
} else {
window.scrollTo(0, 0)
clearInterval(timer)
}
}, 10)
}
}
// top.onclick = function () {
// var timer = setInterval(function () { // eslint-disable-line
// let currentPosition = document.documentElement.scrollTop || document.body.scrollTop
// currentPosition -= 100
// if (currentPosition > 0) {
// window.scrollTo(0, currentPosition)
// } else {
// window.scrollTo(0, 0)
// clearInterval(timer)
// }
// }, 10)
// }
// }
let _hmt = _hmt || [] // eslint-disable-line
const hm = document.createElement('script')

View File

@ -31,7 +31,6 @@ import {
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import hljs from 'highlight.js'
import { Loading } from 'element-ui'
import Swiper from '../components/Swiper'
import Slide from '../components/Slide'
library.add(
@ -60,7 +59,6 @@ library.add(
)
Vue.component('Icon', FontAwesomeIcon)
Vue.component('Swiper', Vue.extend(Swiper))
Vue.component('Slide', Vue.extend(Slide))
Vue.use(Loading.directive)