mirror of https://github.com/zer0bin-dev/zer0bin
✨ feature: Okay should be good now
This commit is contained in:
parent
788235d411
commit
b983bc352f
|
@ -19,7 +19,6 @@ head
|
|||
meta(property='twitter:description' content='🖊 Just a place to paste')
|
||||
meta(property='twitter:image' content='https://raw.githubusercontent.com/zer0bin-dev/.github/main/zer0bin.png')
|
||||
script(defer='' type='module' src='src/index.ts')
|
||||
script(defer='' type='module' src='src/icons.ts')
|
||||
|
||||
ul.noselect#messages
|
||||
.button-wrapper.noselect()
|
||||
|
|
|
@ -6,7 +6,8 @@ import {
|
|||
ForkOutlined,
|
||||
HeartOutlined,
|
||||
StarOutlined,
|
||||
EyeOutlined
|
||||
EyeOutlined,
|
||||
EyeInvisibleOutlined
|
||||
} from "@ant-design/icons-svg"
|
||||
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers"
|
||||
import tippy from "tippy.js"
|
||||
|
@ -37,7 +38,7 @@ copyButton.innerHTML += renderIconDefinitionToSVGElement(CopyOutlined, {
|
|||
githubButton.innerHTML += renderIconDefinitionToSVGElement(GithubOutlined, {
|
||||
extraSVGAttrs: extraSVGAttrs,
|
||||
})
|
||||
hideButton.innerHTML += renderIconDefinitionToSVGElement(EyeOutlined, {
|
||||
hideButton.innerHTML += renderIconDefinitionToSVGElement(EyeInvisibleOutlined, {
|
||||
extraSVGAttrs: extraSVGAttrs,
|
||||
})
|
||||
|
||||
|
@ -109,3 +110,15 @@ function callback() {
|
|||
observer.observe(document.getElementById("code-view-pre"), {
|
||||
attributes: true,
|
||||
})
|
||||
|
||||
export function toggleHiddenIcon(hidden: boolean) {
|
||||
if (!hidden) {
|
||||
hideButton.innerHTML = renderIconDefinitionToSVGElement(EyeInvisibleOutlined, {
|
||||
extraSVGAttrs: extraSVGAttrs,
|
||||
})
|
||||
} else {
|
||||
hideButton.innerHTML = renderIconDefinitionToSVGElement(EyeOutlined, {
|
||||
extraSVGAttrs: extraSVGAttrs,
|
||||
})
|
||||
}
|
||||
}
|
|
@ -5,7 +5,10 @@ import { marked } from "marked"
|
|||
import JSConfetti from "js-confetti"
|
||||
import Scrollbar from "smooth-scrollbar"
|
||||
|
||||
import "./icons"
|
||||
|
||||
import config from "../config.json"
|
||||
import { toggleHiddenIcon } from "./icons"
|
||||
const apiUrl = config.api_url
|
||||
const confettiChance = parseInt(config.confetti_chance)
|
||||
let rawContent = ""
|
||||
|
@ -274,6 +277,8 @@ hideButton.addEventListener("click", function () {
|
|||
buttonPaneHidden = false
|
||||
show(buttonWrapper)
|
||||
}
|
||||
|
||||
toggleHiddenIcon(buttonPaneHidden)
|
||||
})
|
||||
|
||||
async function handlePopstate() {
|
||||
|
|
Loading…
Reference in New Issue