Search

Results include substring matches and semantically similar vals. Learn more
jxnblk avatar
jxnblkioVanillaJS
@jxnblk
Vanilla JS for https://val.town/v/jxnblk/dotcom – https://jxnblk.com
Script
// vanilla js client script for jxnblk.com
const API = "https://jxnblk-jxnblkio.web.val.run/";
let color = localStorage.getItem("color") || "light";
stevekrouse avatar
dateme_browse_react
@stevekrouse
@jsxImportSource https://esm.sh/react@18.2.0
Script
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import isPointWithinRadius from "https://esm.sh/geolib/es/isPointWithinRadius";
import { useLoaderData } from "https://esm.sh/react-router-dom@6.23.0?deps=react@18.2.0,react-dom@18.2.0";
import date_me_doc_locations_geo from "https://esm.town/v/stevekrouse/date_me_doc_locations_geo";
return url;
// TODO - refactor this into a Cell React component
function renderCell(header, row) {
anthonyec avatar
spotify
@anthonyec
// Uncomment this line for one run of the Val to create the DB lol
HTTP (deprecated)
export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
"Authorization": "Basic " + (new Buffer(client_id + ":" + client_secret).toString("base64")),
export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
"Authorization": "Basic " + (new Buffer(client_id + ":" + client_secret).toString("base64")),
`https://accounts.spotify.com/authorize?response_type=code&client_id=${
encodeURIComponent(Deno.env.get("SPOTIFY_CLIENT_ID"))
client_id: Deno.env.get("SPOTIFY_CLIENT_ID"),
client_secret: Deno.env.get("SPOTIFY_CLIENT_SECRET"),
client_id: Deno.env.get("SPOTIFY_CLIENT_ID"),
client_secret: Deno.env.get("SPOTIFY_CLIENT_SECRET"),
g avatar
dataUriGenApp
@g
* This application creates a client-side data URI generator with the following features: * - File upload through input and drag-and-drop * - Automatic MIME type detection * - Preview of the uploaded file (image, video, audio, or text) * - Copy button to easily copy the generated data URI * * We'll use the FileReader API for file handling and data URI generation. * The application will be built using HTML, CSS, and JavaScript, served by a Hono app.
HTTP
* This application creates a client-side data URI generator with the following features:
* - File upload through input and drag-and-drop
* - Automatic MIME type detection
iamseeley avatar
multirouteSvelte
@iamseeley
🌐 Multi-Route Website with Svelte
HTTP (deprecated)
* @title Multi-Route Website with Svelte
* @description Create a personal portfolio website with multiple pages using Svelte and server-side rendering.
import * as svelte from 'npm:svelte/compiler';
<p>${personalData.summary}</p>
<p><strong>This website is rendered server-side with Svelte.</strong></p>
<p>Check out the <a href='https://www.val.town/v/iamseeley/multirouteSvelte'>source</a> and start building your own sit
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${personalData.name} | Server-side Svelte</title>
<style>
jxnblk avatar
JxnblkApp
@jxnblk
React components for https://val.town/v/jxnblk/dotcom – https://jxnblk.com
Script
React components for <https://val.town/v/jxnblk/dotcom><https://jxnblk.com>
// core react component for jxnblkio
/** @jsxImportSource https://esm.sh/react */
import { MdContrast } from "https://esm.sh/react-icons/md";
import React from "https://esm.sh/react@18.3.1";
import { useMemo, useState } from "https://esm.sh/react@18.3.1";
import { Avatar } from "https://esm.town/v/jxnblk/avatar";
import { colors, css } from "https://esm.town/v/jxnblk/JxnblkCSS";
import { GoogleFonts } from "https://esm.town/v/jxnblk/reactGoogleFonts";
import { Vantom } from "https://esm.town/v/jxnblk/vantom";
color?: number;
export const routes: Record<Route, React.FunctionComponent> = {
[Route.Home]: Home,
pomdtr avatar
circles
@pomdtr
Multiplayer Circles Move circles around. State is synced with the server. Open a window in another tab and watch the circles update as you move them .
HTTP (deprecated)
changes.push(row2);
return changes;
const clientCode = () => {
const height = 600;
const width = 600;
<script>
const circles = ${JSON.stringify(circles)};
(${clientCode.toString()})()
</script>
</body>
movienerd avatar
randomMovieQuiz
@movienerd
@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";
// List of popular movies
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
async function server(request: Request): Promise<Response> {
timqian avatar
slogan_history
@timqian
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { ArrowDownIcon, ChevronRightIcon } from "npm:@heroicons/react/20/solid";
import { Hono } from "npm:hono@3";
import { renderToString } from "npm:react-dom/server";
const timeline = [
maxm avatar
infiniteSVGGraph
@maxm
Infinite SVG Graph A connected graph of AI-generated SVG images. Ask it to make any kind of SVG. Add your contribution to the graph. Make it POP!
HTTP
await sqlite.execute(`SELECT * FROM ${tableName} ORDER BY heart_count DESC, RANDOM() LIMIT 100`),
// Client side javascript and template functions.
const clientJavascript = async () => {
window.switchTab = (event, tabName) => {
const buttonContainer = button.closest(".heart-button-container");
const buttonRect = button.getBoundingClientRect();
fetch(`/${button.attributes["data-id"].value}/heart`, { method: "POST" });
<script src="hhttps://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-markup.min.js"></script>
<script>(${clientJavascript.toString()})()</script>
</body>
tmcw avatar
reactExample
@tmcw
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export const reactExample = (request: Request) =>
new Response(renderToString(<div>Test {1 + 1}</div>), {
ttodosi avatar
infiniteSVGGraph
@ttodosi
Infinite SVG Graph A connected graph of AI-generated SVG images. Ask it to make any kind of SVG. Add your contribution to the graph. Make it POP!
HTTP
await sqlite.execute(`SELECT * FROM ${tableName} ORDER BY heart_count DESC, RANDOM() LIMIT 100`),
// Client side javascript and template functions.
const clientJavascript = async () => {
window.switchTab = (event, tabName) => {
const buttonContainer = button.closest(".heart-button-container");
const buttonRect = button.getBoundingClientRect();
fetch(`/${button.attributes["data-id"].value}/heart`, { method: "POST" });
<script src="hhttps://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-markup.min.js"></script>
<script>(${clientJavascript.toString()})()</script>
</body>
kajgod avatar
manage_users
@kajgod
@jsxImportSource https://esm.sh/preact
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact */
import css from "https://esm.town/v/kajgod/manage_users_css";
import { getDatabaseStructure, getFormData, getUsersList } from "https://esm.town/v/kajgod/manage_users_db";
import js from "https://esm.town/v/kajgod/manage_users_js";
import { render } from "npm:preact-render-to-string";
const UserRow = ({ user }) => {
const [id, name, surname, email, timestamp] = user;
shreyasmakes avatar
linkInBioTemplate
@shreyasmakes
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
return new Response(
muhammad_owais_warsi avatar
Badge_Generator
@muhammad_owais_warsi
val.town Badge Generator Generate your own val.town badge to embed onto your websites.
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import React from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import { renderToString } from "https://esm.sh/react-dom/server";
function Badge({ username, title }) {
function App() {
const [username, setUsername] = React.useState("");
const [title, setTitle] = React.useState("");
const [embedCode, setEmbedCode] = React.useState("");
const generateEmbedCode = () => {