• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
shapedlines

shapedlines

horizon

Public
Like
horizon
Home
Code
5
backend
1
shared
AGENTS.md
README.md
deno.json
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
/
x
/
shapedlines
/
horizon
/
branch
/
main
/
version
/
6
/
code
/
README.md
/
README.md
Code
/
/
x
/
shapedlines
/
horizon
/
branch
/
main
/
version
/
6
/
code
/
README.md
/
README.md
Search
…
Viewing readonly version of main branch: v6
View latest version
README.md

Horizon Val

πŸŒ… The current sky at your approximate location, rendered as a CSS gradient. Refreshes every minute.

Endpoints

GET /

Full HTML page with sky gradient background. Auto-refreshes every 60 seconds using <meta http-equiv="Refresh">.

Query Parameters:

  • lat (optional): Latitude override
  • lon (optional): Longitude override

GET /api/gradient

JSON API returning just the CSS gradient data. Perfect for integrating the sky gradient into your own website.

Query Parameters:

  • lat (optional): Latitude override
  • lon (optional): Longitude override

Response:

{ "css": { "background": "linear-gradient(to bottom, rgb(135, 206, 235) 0%, ...)", "themeColor": "rgb(135, 206, 235)", "fallbackColor": "rgb(70, 130, 180)" }, "sun": { "altitudeDegrees": 45.2, "azimuthDegrees": 180.5 }, "location": { "latitude": 30.26, "longitude": -97.74 }, "generatedAt": "2024-01-15T12:00:00.000Z", "cacheHint": "Gradient changes every minute based on sun position" }

Usage on Your Personal Website

To use this gradient as your website background, fetch the API and apply the CSS:

async function updateSkyBackground() { // Use your location or a fixed location const lat = 30.26; // Your latitude const lon = -97.74; // Your longitude const res = await fetch(`https://YOUR_VAL_URL/api/gradient?lat=${lat}&lon=${lon}`); const data = await res.json(); document.body.style.background = data.css.background; document.body.style.backgroundColor = data.css.fallbackColor; // Update theme-color meta tag const themeColor = document.querySelector('meta[name="theme-color"]'); if (themeColor) { themeColor.content = data.css.themeColor; } } // Update immediately and then every minute updateSkyBackground(); setInterval(updateSkyBackground, 60000);

Attribution

  • Physical model and parameter choices from "A Scalable and Production Ready Sky and Atmosphere Rendering Technique" (SΓ©bastien Hillaire)
  • Implementation derived from "Production Sky Rendering" (Andrew Helmer, MIT License)
  • Originally created for HTML Day 2025
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.