Search
getProfileProfilePage
@elliotbraem
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import ReactMarkdown from "https://esm.sh/react-markdown@8.0.7";
// Left side confetti
// Right side confetti
<ReactMarkdown>{profile?.description || ""}</ReactMarkdown>
export function client(accountId: string) {
import { client } from "${import.meta.url}";
client("${accountId}");
codecommenter
@JamesAndrew
Code Commenter Code Commenter is a web application that automatically adds concise and useful comments to your code using OpenAI's language model. It supports JavaScript, TypeScript, and C# languages. Features Two-panel interface: Input code on the left, view commented code on the right Language selection: Choose between JavaScript, TypeScript, and C# Syntax highlighting: Commented code is displayed with proper syntax highlighting Loading indicator: A spinner animation shows when the AI is processing your code Responsive design: The app adjusts to fit various screen sizes How It Works The user pastes their code into the left panel The user selects the appropriate language from the dropdown menu When the "Add Comments" button is clicked, the code is sent to the server The server uses OpenAI's API to generate comments for the code The commented code is returned and displayed in the right panel with syntax highlighting Technology Stack Frontend: React: For building the user interface Prism.js: For syntax highlighting Backend: Deno: Runtime environment Val Town: Hosting platform OpenAI API: For generating code comments Usage Open the application in your web browser Paste your code into the left panel Select the appropriate language from the dropdown menu Click the "Add Comments" button Wait for the AI to process your code (a spinner will indicate that it's working) View the commented code in the right panel Limitations The maximum length of code that can be processed is limited by the OpenAI API's token limit The quality of comments may vary depending on the complexity of the code and the AI model's capabilities Internet connection is required to use the application Privacy Considerations Please note that the code you submit is sent to OpenAI's servers for processing. Do not submit sensitive or proprietary code that you don't want to be processed by a third-party service. Future Improvements Add support for more programming languages Implement user authentication for personalized experiences Add the ability to save and share commented code snippets Improve error handling and user feedback Feedback and Contributions This project is hosted on Val Town. If you have any suggestions, bug reports, or want to contribute to the project, please contact the Val Town team or the val's creator.
HTTP
### Frontend:
- React: For building the user interface
- Prism.js: For syntax highlighting
- Internet connection is required to use the application
## Privacy Considerations
Please note that the code you submit is sent to OpenAI's servers for processing. Do not submit sensitive or proprietary code that you don't want to be processed by a third-party service.
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import Prism from "https://esm.sh/prismjs@1.29.0";
<script type="module">
import React from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import { App } from "${import.meta.url}";
createRoot(document.getElementById("root")).render(React.createElement(App));
</script>
randomHealthyMealGenerator
@semisemsem
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useEffect } from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react-dom@18.2.0,react@18.2.0";
const HEALTHY_MEALS = [
recipe: [
"Cook brown rice and set aside",
"Marinate beef or tofu in soy sauce and sesame oil",
// Rest of the code remains unchanged from previous implementation
// (App component, client function, and server function)
function App() {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
flaapyclone
@veddevv
a Flappy Bird clone but with a slot machine deciding random effects ranging from Slow motion to.. idk.
HTTP
// This val creates a Flappy Bird game with a slot machine feature that randomly activates
// and adds new features throughout the game. It uses React for rendering the UI and
// manages game state on the client-side. The game logic is implemented using
// requestAnimationFrame for smooth animation.
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect, useRef } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
const GAME_WIDTH = 400;
{pipes.map((pipe, index) => (
<React.Fragment key={index}>
<Pipe x={pipe.x} height={pipe.height} isTop={true} isGhost={pipe.isGhost} />
<Pipe x={pipe.x} height={GAME_HEIGHT - pipe.height - PIPE_GAP} isTop={false} isGhost={pipe.isGhost} />
</React.Fragment>
<div style={{ position: 'absolute', top: '10px', left: '10px', fontSize: '24px' }}>
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
cerebras_coder
@toowired
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY Todos I'm looking for collaborators to help. Fork & send me PRs! [ ] Experiment with two prompt chain (started here )
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
<h3 className="font-bold text-green-800">Recommended Lures:</h3>
<ul className="list-disc list-inside">
{recommendation.split(", ").map((lure, index) => (
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
// Server-side code
export default async function server(req: Request): Promise<Response> {
splendidAzureKiwi
@Ravikumarraj
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useMemo, useEffect } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
// Symptom tracking interface
setSymptomHistory(updatedHistory);
// Persist symptoms (server-side blob storage)
try {
</div>
function client() {
createRoot(document.getElementById("root")).render(<PeriodCalculator />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
cors_example
@stevekrouse
CORS issues are the bane of frontend engineers. In Val Town, if you don't customize any CORS headers, we add these defaults: Access-Control-Allow-Origin: "*"
Access-Control-Allow-Methods: "GET,HEAD,PUT,PATCH,POST,DELETE" You can override them if you wish to disallow CORS. This val is a client-side-rendered React app that makes requests to @stevekrouse/cors_example_backend. The backend is in a different val because CORS applies to requests on different domains. The backend has examples of the default permissive CORS behavior and disabled CORS.
HTTP
You can override them if you wish to disallow CORS.
This val is a client-side-rendered React app that makes requests to @stevekrouse/cors_example_backend. The backend is in a different val because CORS applies to requests on different domains. The backend has examples of the default permissive CORS behavior and disabled CORS.
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { useState } from "https://esm.sh/react@18.2.0";
import react_http from "https://esm.town/v/stevekrouse/react_http?v=3";
const BASE_URL = "https://stevekrouse-cors_example_backend.web.val.run";
</div>
export default react_http(App, import.meta.url);
FanFicScraper
@willthereader
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
// last stable version is v138
</div>
function client() {
console.log("Initializing client-side React application");
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
async function scrapePage(url) {
colorRequestSender
@magistris
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
// Define the color entry type
timestamp: string;
// Client-side React Component
function App() {
</div>
// Client-side rendering function
function client() {
const rootElement = document.getElementById("root");
createRoot(rootElement).render(<App />);
// Ensure client-side rendering only happens in browser
if (typeof document !== "undefined") {
client();
// Server-side function for handling requests
async function server(request: Request): Promise<Response> {
thrillingAmaranthKiwi
@bladesquad
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, {
} from "https://esm.sh/react";
import ReactDOM from "https://esm.sh/react-dom";
const root = ReactDOM.createRoot(rootElement);
// Run client-side rendering
import React from 'https://esm.sh/react';
import ReactDOM from 'https://esm.sh/react-dom';
window.React = React;
window.ReactDOM = ReactDOM;
SKHomesTenantManagement
@skhomes
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
// [Previous code remains unchanged]
const SCHEMA_VERSION = 3;
// CSS definition moved inside the server function
const css = `
reasoninghelper
@prashamtrivedi
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { jsPDF } from "https://esm.sh/jspdf@2.5.1";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useCallback, useEffect, useState } from "https://esm.sh/react@18.2.0";
const topics = [
1. Explain why the correct answer is correct, focusing on the reasoning behind it. Use simple, clear English.
2. If the user's answer is different, analyze their logic to explain where they went wrong, using their own reasoning to highlight the mistake. Be empathetic and consider potential language barriers.
3. Provide a specific trick for this question type, explained in straightforward terms.
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
export default async function server(request: Request): Promise<Response> {
timeZoneCompareTool
@paulkinlan
// This timezone comparison tool will use the Luxon library for date and time manipulation.
HTTP
// It will create a React app that displays current times in different timezones and works in both server and client environments.
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect, useCallback, useMemo } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
// client-side only code
const client = () => {
// Execute client-side code after the script has loaded
window.addEventListener('load', client);
import React from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
powerfulLimeGuppy
@movienerd
* This clicker game allows users to earn virtual money by clicking.
* It includes an upgrade system where users can purchase multiple auto-clickers and dime-smithers.
* Each upgrade adds to the overall effect, increasing earnings per second.
* Upgrades are hidden until they are unlocked for the first time.
* The game state is stored client-side using localStorage for persistence.
* React is used for the UI, and setInterval for the auto-upgrade functionality.
HTTP
* Upgrades are hidden until they are unlocked for the first time.
* The game state is stored client-side using localStorage for persistence.
* React is used for the UI, and setInterval for the auto-upgrade functionality.
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
dbpediaenhanced
@ejfox
An API and basic interface for entity searching from DBPedia, enhanced with images
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
return React.createElement(
React.createElement("h1", { className: "text-3xl font-bold text-center mb-8" }, "DBpedia Entity Search"),
React.createElement(
React.createElement("input", {
React.createElement(
loading && React.createElement("p", { className: "text-center" }, "Loading..."),
error && React.createElement("p", { className: "text-red-500 text-center" }, error),
results.length > 0 && React.createElement(