A simple weather widget that shows current conditions in a window-style display with animated effects.
Include the JavaScript file and add the HTML tag:
<script src="https://raw.githack.com/DevManSam777/weather-widget/main/weather-widget.js"></script>
<weather-widget location="New York, New York"></weather-widget>
<!-- City names -->
<weather-widget location="New York, New York"></weather-widget>
<weather-widget location="London, UK"></weather-widget>
<!-- ZIP codes -->
<weather-widget location="10001"></weather-widget>
<weather-widget location="90210"></weather-widget>
<!-- Coordinates -->
<weather-widget location="40.7128,-74.0060"></weather-widget>
<!-- Airport codes -->
<weather-widget location="LAX"></weather-widget>
<!-- With Fahrenheit -->
<weather-widget location="Miami, FL" units="F"></weather-widget>
<!-- With Celsius -->
<weather-widget location="London, UK" units="C"></weather-widget>
- Shows current temperature, weather condition, and local time
- Updates weather data every 15 minutes automatically
- Changes between day/night themes based on actual sunrise/sunset times
- Animated effects for different weather (rain, snow, clouds, etc.)
Works in modern browsers that support Web Components (Chrome, Firefox, Safari, Edge).
The widget is 280px wide by 200px tall. You can scale it with CSS:
weather-widget {
transform: scale(1.5);
}
Copyright (c) 2025 DevManSam