Universal Theme Service API
A plug-and-play theme plug-in that allows any web application to dynamically change UI themes using a hosted API and a lightweight JS widget.
๐น What This API Do?
- Provides dynamic UI themes via API
- Allows users to switch themes from a floating widget
- Supports custom theme selection
- Allows custom positioning of the widget
- Works with any HTML/CSS based web-app
๐น How To Integrate Into Your Web App
Step 1 โ Add the Theme Widget Script
In your base.html or any html page that you'd want, Add this script before closing </body>:
<script src="https://anuragktech.me/themes-widget/themes-widget.js"></script>
Thatโs it! The theme switcher will automatically appear.
Step 2 โ (Optional) Configure Widget Position
If you want to change the widget position:
ADD below snippet before the widget JS. you may configure it as you wish.
<script>
window.UTS_CONFIG = {
bottom: "30px",
left: "25px"
};
</script>
<script src="https://anuragktech.me/themes-widget/themes-widget.js"></script>
Available positioning options:
๐น Available Themes
Currently supported themes:
- Beach
- City
- Night
- Mountain
- Lava
- Grass
More themes will be added over time.
๐น API Endpoint
Base URL
https://z1s4ahgav3.execute-api.us-east-1.amazonaws.com/prod/themes/{theme_name}
Example Request
GET /themes/lava
Example Response
{
"background": "#ff4b2b",
"text": "#ffffff",
"card": "#ff9068"
}
๐น How It Works (Architecture)
1. User clicks theme button
2. Widget calls Theme API
3. API returns color configuration
4. Widget dynamically updates CSS variables
5. Web app instantly changes theme
๐น What Developers Need To Ensure
To allow full theme control:
- Use standard HTML structure
- Avoid hardcoded background colors in CSS
- Allow body and card styling via JavaScript
๐น Deployment Stack
- Django Backend (ThemeAPI)
- AWS Elastic Beanstalk (hosting)
- Amazon API Gateway (public endpoint)
- GitHub Pages (widget hosting)
Contact
For integration help or any issues, contact the developer Anurag Khanapurkar.
khanapurkaranurag@gmail.com, x24214787@student.ncirl.ie,