Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Dice Roller

A simple, interactive dice rolling application built with React and hosted on Val Town.

Features

  • Roll various types of dice (d4, d6, d8, d10, d12, d20).
  • See the results of your rolls instantly.
  • Clean and intuitive user interface.

How it Works

This application is a server-side rendered (SSR) React application.

  • http.tsx: The main entry point that serves the application. It renders the App component on the server and sends it as an HTML response.
  • client.tsx: This script hydrates the React application in the browser, making it interactive.
  • App.tsx: The root component of the React app, containing the dice rolling logic and UI.

Usage

  1. Open the application in your web browser.
  2. Click on the dice icons to roll the corresponding dice.
  3. The result of each roll will be displayed on the screen.

Development

To get started with development:

  1. Remix this project on Val Town.
  2. Edit the App.tsx file to add new features or modify existing ones.
  3. The application will automatically update with your changes.