<script type="module">import draw from '/content/fb13c2ef50866951b1fd064a355125dd228daa1e84d4ee13bc612a1c96042b6ci0';
import source from '/content/63d3feee80ddfc0325ced9abc0ded7878b8447077c1aa2264749d2ce9a0bcab7i0';
import getSeedByInscriptionId from '/content/d5e65e2613fdeff85d40c2fe209c9c9d2e78cd3cf251fd3bc53236882a90f480i0';
const stringToSeed = (str) => {
return str.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0)
}
const getInscription = () => {
const fragments = window.location.pathname.split('/')
const inscriptionId = fragments[fragments.length - 1]
return inscriptionId
}
function main() {
document.addEventListener('DOMContentLoaded', async () => {
const inscriptionId = getInscription()
const seed = await getSeedByInscriptionId(inscriptionId)
const _s = stringToSeed(`${inscriptionId}-${seed}`)
const svg = await draw(source, _s)
const c = document.createElement('div')
c.setAttribute('id', 'pizza-face')
c.innerHTML = svg
const style = document.createElement('style')
style.type = 'text/css'
style.innerHTML = `body{display:flex;justify-content:center;align-items:center;height:100vh;margin:0}#pizza-face{width:800px;height:800px;max-width:100vw;max-height:100vw;}#pizza-face svg{display:block;width:100%;height:100%}`
document.head.appendChild(style)
document.body.appendChild(c)
})
}
main()</script>