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 {
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

View File

@ -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')