46 return new Response(svg, {
47 headers: {
48 "Content-Type": "image/svg+xml;charset=utf-8",
49 },
50 });
1import { openaiImages } from "https://esm.town/v/ale_annini/openaiImages";
2
3export const images = openaiImages({ prompt: "a dog", n: 2 });
4) {
5 let html =
6 `<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Editor.js 🤩🧦🤨 example</title> <link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet"> <link href="../public/assets/demo.css" rel="stylesheet"> <script src="../public/assets/json-preview.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /></head><body> <div class="ce-example"> <div class="ce-example__header"> <a class="ce-example__header-logo" href="https://codex.so/editor">Editor.js 🤩🧦🤨</a> <div class="ce-example__header-menu"> <a href="https://github.com/editor-js" target="_blank">Plugins</a> <a href="https://editorjs.io/usage" target="_blank">Usage</a> <a href="https://editorjs.io/configuration" target="_blank">Configuration</a> <a href="https://editorjs.io/creating-a-block-tool" target="_blank">API</a> </div> </div> <div class="ce-example__content _ce-example__content--small"> <div id="editorjs"></div> <div class="ce-example__button" id="saveButton"> editor.save() </div> <div class="ce-example__statusbar"> Readonly: <b id="readonly-state"> Off </b> <div class="ce-example__statusbar-button" id="toggleReadOnlyButton"> toggle </div> </div> </div> <div class="ce-example__output"> <pre class="ce-example__output-content" id="output"></pre> <div class="ce-example__output-footer"> <a href="https://codex.so" style="font-weight: bold;">Made by CodeX</a> </div> </div> </div> <!-- Load Tools --> <!-- You can upload Tools to your project's directory and connect them by relative links. Also you can load each Tool from CDN or use NPM/Yarn packages. Read more at Tools Connection doc: https://editorjs.io/getting-started#tools-connection --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script><!-- Header --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/simple-image@latest"></script><!-- Image --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/delimiter@latest"></script><!-- Delimiter --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script><!-- List --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/checklist@latest"></script><!-- Checklist --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/quote@latest"></script><!-- Quote --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script><!-- Code --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script><!-- Embed --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/table@latest"></script><!-- Table --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/link@latest"></script><!-- Link --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/warning@latest"></script><!-- Warning --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/marker@latest"></script><!-- Marker --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/inline-code@latest"></script><!-- Inline Code --> <!-- Load Editor.js's Core --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script><script>var editor=new EditorJS({readOnly:!1,holder:'editorjs',tools:{header:{class:Header,inlineToolbar:['marker','link'],config:{placeholder:'Header'},shortcut:'CMD+SHIFT+H'},image:SimpleImage,list:{class:List,inlineToolbar:!0,shortcut:'CMD+SHIFT+L'},checklist:{class:Checklist,inlineToolbar:!0,},quote:{class:Quote,inlineToolbar:!0,config:{quotePlaceholder:'Enter a quote',captionPlaceholder:'Quote\'s author',},shortcut:'CMD+SHIFT+O'},warning:Warning,marker:{class:Marker,shortcut:'CMD+SHIFT+M'},code:{class:CodeTool,shortcut:'CMD+SHIFT+C'},delimiter:Delimiter,inlineCode:{class:InlineCode,shortcut:'CMD+SHIFT+C'},linkTool:LinkTool,embed:Embed,table:{class:Table,inlineToolbar:!0,shortcut:'CMD+ALT+T'},},data:{},onReady:function(){saveButton.click()},onChange:function(api,event){console.log('something changed',event)}});const saveButton=document.getElementById('saveButton');const toggleReadOnlyButton=document.getElementById('toggleReadOnlyButton');const readOnlyIndicator=document.getElementById('readonly-state');saveButton.addEventListener('click',function(){editor.save().then((savedData)=>{cPreview.show(savedData,document.getElementById("output"))}).catch((error)=>{console.error('Saving error',error)})});toggleReadOnlyButton.addEventListener('click',async()=>{const readOnlyState=await editor.readOnly.toggle();readOnlyIndicator.textContent=readOnlyState?'On':'Off'})</script></body></html>`;
7 res.send(html);
8}
1import process from "node:process";
2
3export let twitterOpenGraphImage = (async (req: Request) => {
4 const query = new URL(req.url).searchParams;
5 const site = query.get("site");
60 return new Response(screenshotBuffer, {
61 headers: {
62 "Content-Type": "image/png",
63 "Content-Length": screenshotBuffer.length,
64 },
1# ☔️ Umbrella reminder if there's rain today
2
3
4
5## Setup
7This feedback form is linked on our docs site.
8
9
10
11This val renders an HTML form, including pre-fills the user's email address if they've submitted the form in the past (via a cookie), and pre-fills the URL by grabbing it out of the query params.
4
5```
6https://api.val.town/v1/run/lbb00.checkBPPRequirement?args=[imageUrl,minDisplayWidth,minDisplayHeight]
7```
8
9[Example](https://api.val.town/v1/run/lbb00.checkBPPRequirement?args=[%22https://images.tusiassets.com/models/600411993916047362/P-xfmxxeYNrnq6fYtRo79.jpeg!mfit_w480_h480_jpg_webp%22,320,320])
10
11Migrated from folder: Demo/checkBPPRequirement
3This tiny smiley face is rendered by this val: 
4
5The image response is cached by the CDN, so make sure to change the image name if you make code changes. Any name with a `.png` extension will work: https://maxm-smileypng.web.val.run/-.png
1returns image URL (and only image URL) for a given NFT contract + tokenId. Uses Alchemy's NFT API
2
3to this use val, copy the [Web API](https://docs.val.town/api/web) endpoint and use ?query params to specify the contract address and tokenId you want:
4
5<https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666> - FIXME valtown is turning & into "&", you need to fix it. [even like this broken](https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666)
6
7plain text by default. for JSON add [&format=json](https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666&format=json), for an `<img>` tag use [&format=html](https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666&format=html)
8
9for other NFT metadata: https://www.val.town/v/jamiedubs.nftMetadata
11
12
13Migrated from folder: NFTs/nftImage
3Because this PWA isn't published to the Microsoft Store, if you want to try this out for yourself you'll first need to install [WinAppSDK version >= 1.2](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads), enable Developer Mode in settings following the instructions [here](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/widgets#install-winappsdk-and-enable-developer-mode), and visit https://wilt-miniWidget.web.val.run to install using a recent version of Edge.
4
5
6