mirror of https://github.com/zer0bin-dev/zer0bin
feat: ✨ Add back frontend config
This commit is contained in:
parent
294b50150f
commit
50ecb91151
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"api_url": "https://yourdomain.tld/api",
|
||||||
|
"confetti_chance": "10"
|
||||||
|
}
|
|
@ -18,8 +18,8 @@ head
|
||||||
meta(property='twitter:title' content='zer0bin')
|
meta(property='twitter:title' content='zer0bin')
|
||||||
meta(property='twitter:description' content='🖊 Just a place to paste')
|
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')
|
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='index.ts')
|
||||||
script(defer='' type='module' src='src/icons.ts')
|
script(defer='' type='module' src='icons.ts')
|
||||||
|
|
||||||
ul.noselect#messages
|
ul.noselect#messages
|
||||||
.button-wrapper.noselect(style='position: fixed')
|
.button-wrapper.noselect(style='position: fixed')
|
||||||
|
|
|
@ -4,7 +4,9 @@ import hljs from "highlight.js"
|
||||||
import JSConfetti from "js-confetti"
|
import JSConfetti from "js-confetti"
|
||||||
import Scrollbar from "smooth-scrollbar"
|
import Scrollbar from "smooth-scrollbar"
|
||||||
|
|
||||||
const apiUrl = window.location.hostname + "/api"
|
import config from "./config.json"
|
||||||
|
const apiUrl = config.api_url
|
||||||
|
const confetti_chance = config.api_url
|
||||||
let rawContent = ""
|
let rawContent = ""
|
||||||
|
|
||||||
const jsConfetti = new JSConfetti()
|
const jsConfetti = new JSConfetti()
|
||||||
|
@ -162,7 +164,7 @@ async function savePaste() {
|
||||||
rawContent = res["data"]["content"]
|
rawContent = res["data"]["content"]
|
||||||
viewPaste(rawContent, "0")
|
viewPaste(rawContent, "0")
|
||||||
|
|
||||||
const rand = Math.floor(Math.random() * 40)
|
const rand = Math.floor(Math.random() * confetti_chance * 6)
|
||||||
|
|
||||||
if (rand < 5) {
|
if (rand < 5) {
|
||||||
jsConfetti.addConfetti({
|
jsConfetti.addConfetti({
|
Loading…
Reference in New Issue