style(tooltip): format js and stylus code

This commit is contained in:
XPoet 2022-10-02 14:00:54 +08:00
parent c08868297b
commit d98d0aee97
2 changed files with 10 additions and 10 deletions

View File

@ -204,11 +204,11 @@ button {
.tooltip-content { .tooltip-content {
position absolute position absolute
box-sizing border-box
top -0.4rem top -0.4rem
left 50% left 50%
z-index $z-index-9 z-index $z-index-9
display none display none
box-sizing border-box
padding 0.2rem 0.6rem padding 0.2rem 0.6rem
color var(--fourth-text-color) color var(--fourth-text-color)
font-size 0.8rem font-size 0.8rem
@ -234,20 +234,20 @@ button {
.tooltip-img-box { .tooltip-img-box {
position absolute position absolute
box-sizing border-box
top -0.4rem top -0.4rem
left 50% left 50%
z-index $z-index-8 z-index $z-index-8
display none display none
justify-content center
align-items center align-items center
justify-content center
box-sizing border-box
min-height 6rem
padding 0.2rem padding 0.2rem
background var(--fourth-text-color) background var(--fourth-text-color)
border-radius 0.3rem border-radius 0.3rem
transform translateX(-50%) translateY(-100%) transform translateX(-50%) translateY(-100%)
transition-t("display", "0", "0.2", "ease") transition-t("display", "0", "0.2", "ease")
disable-user-select() disable-user-select()
min-height 6rem
img { img {
display block display block

View File

@ -389,16 +389,16 @@ KEEP.initUtils = () => {
imgsSet[nameIdx] = { imgsSet[nameIdx] = {
imgLoaded: false, imgLoaded: false,
isShowImg: false, isShowImg: false
} }
dom.insertAdjacentHTML( dom.insertAdjacentHTML('afterbegin', imgTooltipBox)
'afterbegin',
imgTooltipBox
)
dom.addEventListener('click', (e) => { dom.addEventListener('click', (e) => {
if (!imgsSet[nameIdx].imgLoaded) { 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 imgsSet[nameIdx].isShowImg = !imgsSet[nameIdx].isShowImg
dom.classList.toggle('show-img') dom.classList.toggle('show-img')