Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg%20%22Optional%20title%22?q=function&page=2484&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 28075 results for "function"(1982ms)

5 */
6
7export default async function main(req: Request): Promise<Response> {
8
9 const html = `
73 let row = 0;
74
75 function createGrid() {
76 for (let i = 0; i < 30; i++) {
77 const cell = document.createElement('div');
81 }
82
83 function handleInput(e) {
84 const key = e.key.toUpperCase();
85
99 }
100
101 function updateGrid() {
102 const cells = document.querySelectorAll('.cell');
103 let base = row * 5;
110 }
111
112 function checkGuess() {
113 const cells = document.querySelectorAll('.cell');
114 let base = row * 5;
1// This implementation creates a basic Wordle game with quirky CSS and HTML.
2// It uses built-in Deno functions and some simple CSS animations to make it
3// lively. The game will function as the standard Wordle but with a fun twist.
4
5export default async function (req: Request): Promise<Response> {
6 // HTML structure and CSS styles
7 const htmlContent = `
1export default async function main(req: Request): Promise<Response> {
2 const styles = `
3 <style>
72 let currentRow = 0;
73
74 function createBoard() {
75 const board = document.querySelector('.board');
76 for (let i = 0; i < 30; i++) {
81 }
82
83 function handleInput(event) {
84 const input = event.target;
85 const value = input.value.toUpperCase();
1// This val renders a fully functioning Wordle game in HTML with unique and fun CSS styles.
2
3function generateHTML() {
4 return `
5 <!DOCTYPE html>
82 let currentRow = 0;
83
84 function createBoard() {
85 const board = document.getElementById('board');
86 for (let i = 0; i < 6; i++) {
96 }
97
98 function submitGuess() {
99 const guessInput = document.getElementById('guessInput');
100 const guess = guessInput.value.toLowerCase();
130}
131
132export default function main() {
133 return new Response(generateHTML(), {
134 headers: {
60 const rows = [['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', '']];
61
62 function updateBoard() {
63 let html = '';
64 for (row of rows) {
95);
96
97export default function main(): Response {
98 return html(<WebPage />);
99}
3// and receive feedback on which letters are correct and in the correct/wrong place.
4
5export default function handler() {
6 const htmlContent = `
7<!DOCTYPE html>
46 <script>
47 const targetWord = "CRAZY";
48 function checkGuess() {
49 const guess = document.getElementById('guessInput').value.toUpperCase();
50 const guessInput = document.getElementById('guessInput');
6 */
7
8export default async function main(req: Request): Promise<Response> {
9 const html = `
10<!DOCTYPE html>
89 let currentRow = 0;
90
91 function makeGuess() {
92 const guess = document.getElementById('guess').value.toUpperCase();
93 if (guess.length !== 5) {
5 */
6
7export default async function main(req: Request): Response {
8 const htmlContent = `
9<!DOCTYPE html>
60 let gameContainer = document.getElementById('game');
61
62 function createGrid() {
63 for (let i = 0; i < 6; i++) {
64 let row = document.createElement('div');
73 }
74
75 function handleKeyPress(e) {
76 let row = gameContainer.children[currentRow];
77 let cells = Array.from(row.children);
90 }
91
92 function checkWord(cells) {
93 let guess = cells.map(cell => cell.textContent).join('');
94 for (let i = 0; i < 5; i++) {
5import { serve } from "https://deno.land/std@0.120.0/http/server.ts";
6
7export default async function main(req: Request): Promise<Response> {
8 const html = `
9<!DOCTYPE html>
82 const gameElement = document.getElementById('game');
83
84 function createGrid() {
85 for (let i = 0; i < 30; i++) {
86 const cell = document.createElement('div');
91 }
92
93 function handleGuess(guess, row) {
94 for (let i = 0; i < 5; i++) {
95 const cell = gameElement.querySelector(\`[data-index="\${row * 5 + i}"]\`);
106
107 let currentRow = 0;
108 document.getElementById('guessInput').addEventListener('keypress', function(event) {
109 if (event.key === 'Enter') {
110 const guess = event.target.value.toLowerCase();
4*/
5
6export default async function main(req: Request): Promise<Response> {
7 const htmlContent = `
8<!DOCTYPE html>
78 let currentRow = 0;
79
80 function createBoard() {
81 const wordle = document.getElementById('wordle');
82 for (let i = 0; i < 30; i++) {
87 }
88
89 function guessWord() {
90 const guess = document.getElementById('guess').value.toUpperCase();
91 if (guess.length !== 5) {

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.