Public
Like
Daily_quotes
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.
quote-of-the-day.ts
https://Lovor--4dd1390e34c811f0acf49e149126039e.web.val.run
A simple website that displays a new inspirational quote each day in multiple languages. The quote changes automatically based on the current date.
- Displays a different inspirational quote each day
- Supports multiple languages: English, German (Deutsch), and Slovenian (Slovenščina)
- Language selection with URL parameter persistence
- Shows the current date in the appropriate format for each language
- Clean, responsive design
- No external API dependencies (quotes are stored in the code)
The website uses a deterministic algorithm to select a quote based on the day of the year. This ensures:
- The same quote is shown throughout the entire day
- A different quote appears each day
- The quotes cycle through the collection over time
The language selection is handled via URL parameters (e.g., ?lang=de for German). The website will:
- Remember your language preference through the URL
- Format dates according to the selected language's conventions
- Display UI text and quotes in the selected language
- Built with TypeScript
- Multilingual support with language-specific formatting
- Uses Twind for styling
- Includes error catching for better debugging
- Responsive design works on mobile and desktop
- No database required - quotes are stored in the code
To add or modify quotes, edit the quotes object in the main file. Quotes are organized by language code:
quotes = {
en: [ /* English quotes */ ],
de: [ /* German quotes */ ],
sl: [ /* Slovenian quotes */ ]
}
Each quote should have:
text: The quote textauthor: The name of the person who said or wrote the quote
To add a new language:
- Add quotes for the new language
- Add UI translations in the
translationsobject - Add the language to the
LANGUAGESobject
Potential improvements that could be added:
- Share buttons for social media
- Option to view previous quotes
- Categories of quotes
- User-submitted quotes