thehost-mapboxscript.js21 matches
20map.on("load", function() {
21// Ajout de l'icône custom PNG blanc (hébergée sur Webflow, doit être blanc pur sur fond transparent)
22map.loadImage(
23"https://cdn.prod.website-files.com/680b45cea1d474e42a333f71/6849450d1f21ddfdce96b8bd_Vector.png",
24(error, image) => {
25if (error) throw error;
26if (!map.hasImage("custom-marker")) {
27map.addImage("custom-marker", image, { sdf: true });
28}
2980mapLocations.features = [];
81locationItems.forEach((item, idx) => {
82// Récupère l'URL de l'image principale de la card
83let image = item.getAttribute("data-image");
84if (!image) {
85const imgEl = item.querySelector(".image-card-results");
86if (imgEl) {
87image = imgEl.getAttribute("src");
88}
89}
90if (!image) {
91image = "https://uploads-ssl.webflow.com/placeholder.jpg";
92}
93const lat = parseFloat(item.getAttribute("data-lat"));
110name: name,
111city: city,
112image: image,
113description: description,
114url: url,
158<div id="popup-close-btn-${feature.id}" class="popup-close-btn"></div>
159<div class="popup-content-inner">
160<div class="popup-image">
161<img src="${feature.properties.image}" loading="lazy" alt="${feature.properties.name}" class="popup-image">
162</div>
163<div class="popup-title">${feature.properties.name}</div>
277const newFeatures = [];
278visibleItems.forEach((item, idx) => {
279let image = item.getAttribute("data-image");
280if (!image) {
281const imgEl = item.querySelector(".image-card-results");
282if (imgEl) {
283image = imgEl.getAttribute("src");
284}
285}
286if (!image) {
287image = "https://uploads-ssl.webflow.com/placeholder.jpg"; // Mets ici l'URL de ton image par défaut
288}
289const lat = parseFloat(item.getAttribute("data-lat"));
310name: name,
311city: city,
312image: image,
313description: description,
314url: url,
17// },
18// }),
19// { headers: { "Content-Type": "image/jpeg" } }
20// );
21}
3* It uses a textarea for HTML input and a button to trigger the conversion.
4* To calculate the required SVG dimensions, it renders the input HTML into an off-screen div and measures its bounding box.
5* The resulting SVG, containing the HTML in a <foreignObject>, is then displayed in four formats: raw SVG code, an SVG data URL, an HTML <img> tag, and a Markdown image link.
6*/
7import { serve } from "https://esm.town/v/g/serveUtils";
3940<div class="output-group">
41<label>3. HTML Image Preview</label>
42<div id="outputImageContainer"></div>
43<label for="outputImageCode">HTML <code><img></code> Code</label>
44<textarea id="outputImageCode" readonly rows="3"></textarea>
45</div>
46127margin-bottom: 8px;
128}
129#outputImageContainer {
130padding: 15px;
131border: 1px dashed #ccc;
148const outputSvgCode = document.getElementById("outputSvgCode");
149const outputDataUrl = document.getElementById("outputDataUrl");
150const outputImageContainer = document.getElementById("outputImageContainer");
151const outputImageCode = document.getElementById("outputImageCode");
152const outputMarkdown = document.getElementById("outputMarkdown");
153190191// 3. Create the various output formats
192const svgDataUrl = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(svgString)))}`;
193const htmlImgTag = `<img src="${svgDataUrl}" alt="Generated from HTML" width="${width}" height="${height}">`;
194const markdown = ``;
195196// 4. Display the outputs
200outputDataUrl.value = svgDataUrl;
201202outputImageContainer.innerHTML = htmlImgTag;
203outputImageCode.value = htmlImgTag;
204205outputMarkdown.value = markdown;
206});
207208[outputSvgCode, outputDataUrl, outputImageCode, outputMarkdown].forEach(textarea => {
209textarea.addEventListener('click', () => {
210textarea.select();
mcp-servermain.ts3 matches
19date: string;
20doc: string;
21image: string;
22tags: string;
23title: string;
81sequences: item.sequences,
82date: item.date,
83image: item.image,
84backlinks: item.backlinks,
85category: extractPostCategory(item),
130(page.sequences?.length > 0 ? `- sequences: ${page.sequences.map(seq => `[Sequence ${seq.id} on ${seq.topic}](${SITE_URL}/sequences#${seq.id})`).join(", ")}` : null),
131(page.book ? `- book_id: ${page.book}` : null),
132(page.image ? `- image: ${page.image}` : null),
133(page.score ? `- relevance: ${page.score.toFixed(3)}` : null),
134].filter((a) => a !== null).join("\n");
basic-html-starterindex.html1 match
1112<!-- reference the webpage's favicon. note: currently only svg is supported in val town files -->
13<link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml">
1415<!-- import the webpage's javascript file -->
FarcasterSpacesSpace.tsx6 matches
295// console.log("User", uid, user);
296297const image =
298user?.pfp_url ||
299userImageUrl(uid) ||
300'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjmD59ugIABXQB5tNl2LwAAAAASUVORK5CYII='
301302const goToProfile = (uid) => {
329<img
330className="rounded-full w-14 h-14 object-cover bg-neutral-500/10"
331src={image}
332onClick={() => setShowMenu(true)}
333/>
346<img
347className="rounded-full w-14 h-14 object-cover bg-neutral-500/10"
348src={image}
349onClick={() => setShowMenu(true)}
350/>
411}
412413function userImageUrl(address) {
414if (!address) return null
415return 'https://cdn.stamp.fyi/avatar/' + address + '?s=140'
FarcasterSpacesindex.tsx3 matches
6import { handleAnalyticsEndpoints } from './analytics.ts'
7import { embedMetadata, handleFarcasterEndpoints, name } from './farcaster.ts'
8import { handleImageEndpoints } from './image.tsx'
9import { fetchNeynarGet } from './neynar.ts'
1011const app = new Hono()
1213handleImageEndpoints(app)
14handleFarcasterEndpoints(app)
15handleAgoraEndpoints(app)
54<meta name="fc:frame" content={JSON.stringify(embedMetadata(baseUrl, path))} />
55<link rel="icon" href={baseUrl + '/icon'} />
56<meta property="og:image" content={baseUrl + '/image'} />
57</head>
58<body class="bg-white text-black dark:bg-black dark:text-white">
FarcasterSpacesimage.tsx16 matches
8import { fetchUsersById } from './neynar.ts'
910export function handleImageEndpoints(app: Hono) {
11const headers = {
12'Content-Type': 'image/png',
13'cache-control': 'public, max-age=3600', // 86400
14}
15app.get('/image', async (c) => {
16const channel = c.req.query('channel')
17if (channel) return c.body(await spaceImage(channel), 200, headers)
18return c.body(await homeImage(), 200, headers)
19})
20app.get('/icon', async (c) => {
21const rounded = !!c.req.query('rounded')
22return c.body(await iconImage(rounded), 200, headers)
23})
24}
2526export async function homeImage() {
27return await ogImage(
28<div tw="w-full h-full flex justify-start items-end text-[100px] bg-black text-white p-[50px]">
29<div tw="flex flex-col items-start">
37}
3839export async function spaceImage(channel: string) {
40const space = await fetchSpace(channel)
41if (!space) return await homeImage()
4243const users = await fetchUsersById([space.created_by, ...space.hosts, ...space.speakers].join(','))
48const speakers = users?.filter((u) => speakerFids.includes(u.fid))
4950return await ogImage(
51<div tw="w-full h-full flex justify-start items-start text-[100px] bg-black text-white p-[50px]">
52<div tw="flex flex-col items-start ">
84}
8586export async function iconImage(rounded = false) {
87const roundedClass = rounded ? 'rounded-[96px]' : ''
88return await ogImage(
89<div tw={`w-full h-full flex justify-center items-center text-[100px] bg-[#7c65c1] text-white p-[50px] ${roundedClass}`}>
90<img tw="w-[350px] h-[350px]" src={base64Icon(Mic)} />
99//////////
100101export async function ogImage(body, options = {}) {
102const svg = await satori(body, {
103width: 945,
109if (code === 'emoji') {
110const unicode = segment.codePointAt(0).toString(16).toUpperCase()
111return `data:image/svg+xml;base64,` + btoa(await loadEmoji(unicode))
112}
113return ''
145const base64 = Buffer.from(svg).toString('base64')
146// console.log('getIconDataUrl', name, svg, base64)
147return `data:image/svg+xml;base64,${base64}`
148}
149
GlancergeneratePDF.ts7 matches
1// Convert image URL to base64
2async function getImageBase64(url: string): Promise<string> {
3const res = await fetch(url);
4const buffer = await res.arrayBuffer();
5const base64 = btoa(String.fromCharCode(...new Uint8Array(buffer)));
6const contentType = res.headers.get("content-type") || "image/png";
7return `data:${contentType};base64,${base64}`;
8}
20const { applyPlugin } = await import("npm:jspdf-autotable");
2122const logoDataUrl = await getImageBase64(
23"https://www.glance.cx/hs-fs/hubfs/raw_assets/public/Glance/images/gradientLogo.png"
24);
2544let y = 20;
4546// Add image: (imageData, format, x, y, width, height)
47doc.addImage(logoDataUrl, "PNG", 20, y, 30, 10);
48y += 30;
49
untitled-4042main.js1 match
9"User-Agent":
10"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
11"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
12"Accept-Language": "en-US,en;q=0.9",
13"Accept-Encoding": "gzip, deflate, br",