From d98d0aee9701e15ee04ac0d75535a9b0af6944a8 Mon Sep 17 00:00:00 2001 From: XPoet Date: Sun, 2 Oct 2022 14:00:54 +0800 Subject: [PATCH] style(tooltip): format js and stylus code --- source/css/common/basic.styl | 8 ++++---- source/js/utils.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/css/common/basic.styl b/source/css/common/basic.styl index 3c764c4..51cdd2a 100644 --- a/source/css/common/basic.styl +++ b/source/css/common/basic.styl @@ -204,11 +204,11 @@ button { .tooltip-content { position absolute - box-sizing border-box top -0.4rem left 50% z-index $z-index-9 display none + box-sizing border-box padding 0.2rem 0.6rem color var(--fourth-text-color) font-size 0.8rem @@ -234,20 +234,20 @@ button { .tooltip-img-box { position absolute - box-sizing border-box top -0.4rem left 50% z-index $z-index-8 display none - justify-content center align-items center + justify-content center + box-sizing border-box + min-height 6rem padding 0.2rem background var(--fourth-text-color) border-radius 0.3rem transform translateX(-50%) translateY(-100%) transition-t("display", "0", "0.2", "ease") disable-user-select() - min-height 6rem img { display block diff --git a/source/js/utils.js b/source/js/utils.js index 7e9b555..7647348 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -389,16 +389,16 @@ KEEP.initUtils = () => { imgsSet[nameIdx] = { imgLoaded: false, - isShowImg: false, + isShowImg: false } - dom.insertAdjacentHTML( - 'afterbegin', - imgTooltipBox - ) + dom.insertAdjacentHTML('afterbegin', imgTooltipBox) dom.addEventListener('click', (e) => { if (!imgsSet[nameIdx].imgLoaded) { - loadImg(document.querySelector(`.tooltip-img-box img.${imgDomClass}`), imgsSet[nameIdx].imgLoaded) + loadImg( + document.querySelector(`.tooltip-img-box img.${imgDomClass}`), + imgsSet[nameIdx].imgLoaded + ) } imgsSet[nameIdx].isShowImg = !imgsSet[nameIdx].isShowImg dom.classList.toggle('show-img')