19 price?: number;
20 finish_reason?: string;
21 num_images?: number;
22 our_api_token: boolean;
23}
44 price REAL,
45 finish_reason TEXT,
46 num_images INTEGER,
47 our_api_token INTEGER NOT NULL,
48 finish_timestamp INTEGER
141 model,
142 our_api_token,
143 num_images,
144 tablePrefix = "",
145}: {
149 model: string;
150 our_api_token: boolean;
151 num_images: number;
152 tablePrefix: string;
153}) {
162 model,
163 our_api_token,
164 num_images
165 ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
166 `,
173 model,
174 our_api_token ? 1 : 0,
175 num_images,
176 ],
177 );
29 model,
30 our_api_token,
31 num_images
32 ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
33 `,
47
48And so, since starting using Val Town, I've created a new
49[net](https://www.val.town/x/wolf/BingImageOfDay)
50[of](https://www.val.town/x/wolf/FileDumpThing/),
51[random](https://www.val.town/x/wolf/PassphraseAPI)
84editor, with your local tools. So simple and low-friction!
85
86
87
88But this tool was mostly built for my specific workflow and setup. There were a
192 case "divider":
193 return "<hr>";
194 case "image":
195 return renderImage(block);
196 case "video":
197 return renderVideo(block);
346}
347
348function renderImage(block: NotionBlock): string {
349 const imageData = block.image;
350 let imageUrl = "";
351 let alt = "";
352
353 if (imageData?.file?.url) {
354 imageUrl = imageData.file.url;
355 } else if (imageData?.external?.url) {
356 imageUrl = imageData.external.url;
357 }
358
359 if (imageData?.caption) {
360 alt = renderRichText(imageData.caption);
361 }
362
363 return imageUrl
364 ? `<img src="${imageUrl}" alt="${alt}" style="max-width: 100%;">`
365 : "";
366}
41 const ext = filename.toLowerCase().split('.').pop();
42 const mimeTypes: Record<string, string> = {
43 'jpg': 'image/jpeg',
44 'jpeg': 'image/jpeg',
45 'png': 'image/png',
46 'gif': 'image/gif',
47 'webp': 'image/webp',
48 'svg': 'image/svg+xml',
49 'pdf': 'application/pdf',
50 'txt': 'text/plain',
4
5:root {
6 /* Color palette inspired by the reference image */
7 --bg-primary: #1e1e2e;
8 --bg-secondary: #181825;
6 <title>TownieTokens Terminal Emulator</title>
7 <link rel="stylesheet" href="/frontend/style.css">
8 <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🏘️</text></svg>">
9 <script src="https://esm.town/v/std/catch"></script>
10</head>
554}
555
556/* Images */
557.notion-content img {
558 max-width: 100%;
20 map.on("load", function() {
21 // Ajout de l'icône custom PNG blanc (hébergée sur Webflow, doit être blanc pur sur fond transparent)
22 map.loadImage(
23 "https://cdn.prod.website-files.com/680b45cea1d474e42a333f71/6849450d1f21ddfdce96b8bd_Vector.png",
24 (error, image) => {
25 if (error) throw error;
26 if (!map.hasImage("custom-marker")) {
27 map.addImage("custom-marker", image, { sdf: true });
28 }
29 initializePoints();
74 mapLocations.features = [];
75 locationItems.forEach((item, idx) => {
76 // Récupère l'URL de l'image principale de la card
77 let image = item.getAttribute("data-image");
78 if (!image) {
79 const imgEl = item.querySelector(".image-card-results");
80 if (imgEl) {
81 image = imgEl.getAttribute("src");
82 }
83 }
84 if (!image) {
85 image = "https://uploads-ssl.webflow.com/placeholder.jpg";
86 }
87 const lat = parseFloat(item.getAttribute("data-lat"));
104 name: name,
105 city: city,
106 image: image,
107 description: description,
108 url: url,
152 <div id="popup-close-btn-${feature.id}" class="popup-close-btn"></div>
153 <div class="popup-content-inner">
154 <div class="popup-image">
155 <img src="${feature.properties.image}" loading="lazy" alt="${feature.properties.name}" class="popup-image">
156 </div>
157 <div class="popup-title">${feature.properties.name}</div>
271 const newFeatures = [];
272 visibleItems.forEach((item, idx) => {
273 let image = item.getAttribute("data-image");
274 if (!image) {
275 const imgEl = item.querySelector(".image-card-results");
276 if (imgEl) {
277 image = imgEl.getAttribute("src");
278 }
279 }
280 if (!image) {
281 image = "https://uploads-ssl.webflow.com/placeholder.jpg"; // Mets ici l'URL de ton image par défaut
282 }
283 const lat = parseFloat(item.getAttribute("data-lat"));
304 name: name,
305 city: city,
306 image: image,
307 description: description,
308 url: url,