SHOWING: First 60
/*
* NOTE: THIS IS A MODIFICATION FOR TRUMP MUGSHOT CARDS, UNRELATED TO Ordinals Wallet
*
* Modded from Ordinals Wallet <-> Recursive Pepe Card Model
* Copyright 2023 Ordinals Wallet
* Original Inscriber: harry.xbt
* see tx id dfa451c046202077e3464932cc8ebce099be4da7789095d5a805e36930d29d8ci0
*/
import * as fflate from '/content/f815bd5c566c6e46de5cdb6ccb3a7043c63deeba61f4234baea84b602b0d4440i0'
import transform from '/content/7d3dd64f6598ea371aeff4d70b0f1728af0f57dd1747b58a190f7e52a9f5cd30i0'
const PADDING = 100
const WIDTH = 2048
const TOP_OFFSET = 1255
const ATTRIBUTE_OFFSET = TOP_OFFSET + PADDING + 220
export default async function(props, element, style) {
const res = await fetch(
'/content/83b2e90431c87df3045b80e774a747fa745f655132d25a6ab1600ce1b8307d98i0'
)
const compressed = new Uint8Array(await res.arrayBuffer())
const inflated = await fflate.decompressSync(compressed)
const base64 = btoa(inflated.reduce((data, byte) => data + String.fromCharCode(byte), ''))
const url = `data:model/gltf-binary;base64,${base64}`
const modelViewer = document.createElement('model-viewer')
modelViewer.src = url
Object.keys(style).forEach((key) => {
modelViewer.style[key] = style[key]
})
let transformations = [
// Border
{
material: 0,
type: 'image',
coords: [0, 0],
size: [WIDTH, WIDTH],
image: '/content/d3db144f47c42f6221ea0e98e7b4fcc2376cc184b40163f02e5c77cc0e97f807i0'
},
// Back
{
material: 3,
type: 'image',
coords: [0, 0],
size: [WIDTH, WIDTH],
image: '/content/482b3a960190d790cad443c3b6c3c9b75824bfae19152433d805d0842376258bi0'
},
// Body
{
material: 1,
type: 'image',
coords: [0, 0],
size: [WIDTH, WIDTH],
image: props.image
},
{
material: 2,
type: 'text',
font: 'bold 120px Helvetica',
text: props.title,
coords: [PADDING, TOP_OFFSET + PADDING + 103],
color: 'white'
},
{
material: 2,
type: 'text',
font: '500 60px Helvetica',
text: `Inscription #${props.inscription_num}`,
coords: [PADDING, ATTRIBUTE_OFFSET],
color: 'white'
}
]
props.attributes.forEach((a, index) => {
let TOP_OFFSET = ATTRIBUTE_OFFSET + (index + 1) * 72
const leftOffset = index % 2 === 0 ? PADDING : PADDING + 800
if (index > 0) {
TOP_OFFSET -= 72 * (index / 2)
}
if (index % 2 === 1) {
TOP_OFFSET -= 36
}
transformations.push({
material: 2,
type: 'text',
font: '52px Helvetica',
text: `${a.trait_type}: ${a.value}`,
coords: [leftOffset, TOP_OFFSET],
color: '#BABBC7'
})
})
modelViewer.setAttribute('ar', '')
modelViewer.setAttribute('enable-pan', '')
modelViewer.setAttribute('shadow-intensity', '1')
modelViewer.setAttribute('camera-controls', '')
modelViewer.setAttribute('touch-action', 'pan-y')
modelViewer.addEventListener('load', async () => {
transform(modelViewer, transformations)
})
element.appendChild(modelViewer)
}#26,576,977text<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Trump Mugshot Collection</title>
<style>
body {
margin: 0;
}
svg {
display: block;
max-width: 100%;
max-height: 100vh;
margin: 0 auto;
}
</style>
</head>
<body style="margin:0;padding:0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300">
<image href="/content/a6131ed28704b4f10cd34e32e757fa633e6af05c4831d69cfe3f5df06df91e1ci0"></image>
<image href="/content/44fe95d33ce272b9592997c6905b36ba3ba2426d77e6d20008d8dbc799dc4370i0"></image>
<image href="/content/1bff5071272410cde1d21186388d02c732f35cefc6fb65fc3569e1758cd822fai0"></image>
<image href="/content/ee5d66b180593c0f4caa1a86915e5ce89e09fbd969a1decb5098a8045966a659i0"></image>
</svg>
</body>
</html>#26,528,156text