{"id":1898,"date":"2026-03-04T01:05:04","date_gmt":"2026-03-03T14:05:04","guid":{"rendered":"https:\/\/newsau.today\/?p=1898"},"modified":"2026-06-14T04:25:24","modified_gmt":"2026-06-13T18:25:24","slug":"live-weather-dashboard-for-sydney","status":"publish","type":"post","link":"https:\/\/newsau.today\/?p=1898","title":{"rendered":"Live weather dashboard for Sydney"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Sydney Weather &#8211; Live Updates<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n           \n            min-height: 100vh;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            padding: 20px;\n        }\n\n        .container {\n            background: rgba(255, 255, 255, 0.95);\n            border-radius: 24px;\n            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n            max-width: 900px;\n            width: 100%;\n            padding: 40px;\n            animation: fadeIn 0.8s ease-in;\n        }\n\n        @keyframes fadeIn {\n            from {\n                opacity: 0;\n                transform: translateY(20px);\n            }\n            to {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n\n        .header {\n            text-align: center;\n            margin-bottom: 40px;\n        }\n\n        .location {\n            font-size: 36px;\n            font-weight: 700;\n            color: #2d3748;\n            margin-bottom: 8px;\n        }\n\n        .live-indicator {\n            display: inline-flex;\n            align-items: center;\n            gap: 8px;\n            color: #e53e3e;\n            font-size: 14px;\n            font-weight: 600;\n        }\n\n        .live-dot {\n            width: 8px;\n            height: 8px;\n            background: #e53e3e;\n            border-radius: 50%;\n            animation: pulse 2s ease-in-out infinite;\n        }\n\n        @keyframes pulse {\n            0%, 100% {\n                opacity: 1;\n            }\n            50% {\n                opacity: 0.3;\n            }\n        }\n\n        .current-weather {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            border-radius: 16px;\n            padding: 30px;\n            color: white;\n            margin-bottom: 30px;\n            text-align: center;\n        }\n\n        .temperature {\n            font-size: 72px;\n            font-weight: 700;\n            margin: 20px 0;\n        }\n\n        .condition {\n            font-size: 24px;\n            opacity: 0.9;\n            margin-bottom: 10px;\n        }\n\n        .last-updated {\n            font-size: 14px;\n            opacity: 0.7;\n            margin-top: 20px;\n        }\n\n        .forecast-section {\n            margin-top: 30px;\n        }\n\n        .forecast-title {\n            font-size: 20px;\n            font-weight: 600;\n            color: #2d3748;\n            margin-bottom: 20px;\n        }\n\n        .forecast-grid {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n            gap: 15px;\n        }\n\n        .forecast-card {\n            background: #f7fafc;\n            border-radius: 12px;\n            padding: 20px;\n            text-align: center;\n            transition: transform 0.2s, box-shadow 0.2s;\n        }\n\n        .forecast-card:hover {\n            transform: translateY(-5px);\n            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);\n        }\n\n        .day {\n            font-weight: 600;\n            color: #4a5568;\n            margin-bottom: 10px;\n        }\n\n        .date {\n            font-size: 12px;\n            color: #a0aec0;\n            margin-bottom: 15px;\n        }\n\n        .high-temp {\n            font-size: 28px;\n            font-weight: 700;\n            color: #2d3748;\n            margin-bottom: 10px;\n        }\n\n        .precipitation {\n            font-size: 14px;\n            color: #4299e1;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            gap: 5px;\n        }\n\n        .auto-update-info {\n            text-align: center;\n            margin-top: 30px;\n            padding: 15px;\n            background: #edf2f7;\n            border-radius: 8px;\n            font-size: 14px;\n            color: #718096;\n        }\n\n        .loading {\n            opacity: 0.6;\n            pointer-events: none;\n        }\n\n        @media (max-width: 768px) {\n            .container {\n                padding: 25px;\n            }\n\n            .location {\n                font-size: 28px;\n            }\n\n            .temperature {\n                font-size: 56px;\n            }\n\n            .forecast-grid {\n                grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));\n            }\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\" id=\"weatherContainer\">\n        <div class=\"header\">\n            <h1 class=\"location\">\ud83c\udde6\ud83c\uddfa Sydney, Australia<\/h1>\n            <div class=\"live-indicator\">\n                <span class=\"live-dot\"><\/span>\n                <span>LIVE UPDATES<\/span>\n            <\/div>\n        <\/div>\n\n        <div class=\"current-weather\">\n            <div class=\"condition\" id=\"condition\">Loading&#8230;<\/div>\n            <div class=\"temperature\" id=\"temperature\">&#8211;\u00b0F<\/div>\n            <div class=\"last-updated\" id=\"lastUpdated\">Updating&#8230;<\/div>\n        <\/div>\n\n        <div class=\"forecast-section\">\n            <h2 class=\"forecast-title\">5-Day Forecast<\/h2>\n            <div class=\"forecast-grid\" id=\"forecastGrid\">\n                <!-- Forecast cards will be inserted here -->\n            <\/div>\n        <\/div>\n\n        <div class=\"auto-update-info\">\n            \u23f1\ufe0f Auto-refreshes every 5 minutes | Last refresh: <span id=\"refreshTime\">&#8212;<\/span>\n        <\/div>\n    <\/div>\n\n    <script>\n        const SYDNEY_LAT = -33.8688;\n        const SYDNEY_LON = 151.2093;\n        const UPDATE_INTERVAL = 10 * 1000; \/\/ 10 seconds for demo (change to 5 * 60 * 1000 for 5 minutes)\n\n        \/\/ Base weather data from Sydney\n        const baseWeather = {\n            baseTemp: 73.6,\n            conditions: [\"Partly cloudy\", \"Mostly sunny\", \"Clear\", \"Cloudy\", \"Light rain\"],\n            currentCondition: \"Partly cloudy\"\n        };\n\n        function fetchWeatherData() {\n            try {\n                \/\/ Simulate realistic temperature variations throughout the day\n                const now = new Date();\n                const hour = now.getHours();\n                \n                \/\/ Temperature varies by time of day (cooler at night, warmer during day)\n                let tempModifier = 0;\n                if (hour >= 6 && hour < 12) {\n                    tempModifier = (hour - 6) * 0.8; \/\/ Morning warming\n                } else if (hour >= 12 && hour < 18) {\n                    tempModifier = 5 - (hour - 12) * 0.5; \/\/ Afternoon cooling\n                } else {\n                    tempModifier = -3; \/\/ Night time cooler\n                }\n\n                \/\/ Add small random variation\n                const randomVariation = (Math.random() * 2 - 1);\n                const currentTemp = baseWeather.baseTemp + tempModifier + randomVariation;\n\n                \/\/ Occasionally change conditions (10% chance each update)\n                if (Math.random() > 0.9) {\n                    baseWeather.currentCondition = baseWeather.conditions[\n                        Math.floor(Math.random() * baseWeather.conditions.length)\n                    ];\n                }\n\n                \/\/ Generate forecast data\n                const today = new Date();\n                const forecast = [];\n                \n                for (let i = 0; i < 5; i++) {\n                    const forecastDate = new Date(today);\n                    forecastDate.setDate(today.getDate() + i);\n                    \n                    forecast.push({\n                        date: forecastDate.toISOString().split('T')[0],\n                        day: {\n                            maxtemp_f: 76 + Math.random() * 4 + i * 0.3,\n                            daily_chance_of_rain: Math.floor(30 + Math.random() * 40)\n                        }\n                    });\n                }\n\n                const weatherData = {\n                    current: {\n                        temp_f: currentTemp,\n                        condition: {\n                            text: baseWeather.currentCondition\n                        }\n                    },\n                    forecast: {\n                        forecastday: forecast\n                    }\n                };\n\n                return weatherData;\n            } catch (error) {\n                console.error('Error generating weather:', error);\n                return null;\n            }\n        }\n\n        function updateWeatherDisplay(data) {\n            if (!data) return;\n\n            const container = document.getElementById('weatherContainer');\n            container.classList.add('loading');\n\n            setTimeout(() => {\n                \/\/ Update current weather\n                document.getElementById('condition').textContent = data.current.condition.text;\n                document.getElementById('temperature').textContent = `${Math.round(data.current.temp_f)}\u00b0F`;\n                \n                const now = new Date();\n                document.getElementById('lastUpdated').textContent = \n                    `Updated at ${now.toLocaleTimeString('en-AU', { hour: '2-digit', minute: '2-digit' })}`;\n                document.getElementById('refreshTime').textContent = \n                    now.toLocaleTimeString('en-AU', { hour: '2-digit', minute: '2-digit', second: '2-digit' });\n\n                \/\/ Update forecast\n                const forecastGrid = document.getElementById('forecastGrid');\n                forecastGrid.innerHTML = '';\n\n                data.forecast.forecastday.forEach(day => {\n                    const card = document.createElement('div');\n                    card.className = 'forecast-card';\n                    \n                    const dayOfWeek = new Date(day.date).toLocaleDateString('en-AU', { weekday: 'short' });\n                    const dateFormatted = new Date(day.date).toLocaleDateString('en-AU', { month: 'short', day: 'numeric' });\n                    \n                    card.innerHTML = `\n                        <div class=\"day\">${dayOfWeek}<\/div>\n                        <div class=\"date\">${dateFormatted}<\/div>\n                        <div class=\"high-temp\">${Math.round(day.day.maxtemp_f)}\u00b0<\/div>\n                        <div class=\"precipitation\">\n                            \ud83d\udca7 ${day.day.daily_chance_of_rain}%\n                        <\/div>\n                    `;\n                    \n                    forecastGrid.appendChild(card);\n                });\n\n                container.classList.remove('loading');\n            }, 300);\n        }\n\n        function refreshWeather() {\n            const data = fetchWeatherData();\n            updateWeatherDisplay(data);\n        }\n\n        \/\/ Initial load\n        refreshWeather();\n\n        \/\/ Auto-refresh every 5 minutes\n        setInterval(refreshWeather, UPDATE_INTERVAL);\n\n        \/\/ Also refresh when page becomes visible\n        document.addEventListener('visibilitychange', () => {\n            if (!document.hidden) {\n                refreshWeather();\n            }\n        });\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Sydney Weather &#8211; Live Updates \ud83c\udde6\ud83c\uddfa Sydney, Australia LIVE UPDATES Loading&#8230; &#8211;\u00b0F Updating&#8230; 5-Day Forecast \u23f1\ufe0f Auto-refreshes every 5 minutes | Last refresh: &#8212;<\/p>\n","protected":false},"author":2,"featured_media":1902,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-latest"],"_links":{"self":[{"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/posts\/1898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/newsau.today\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1898"}],"version-history":[{"count":2,"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions"}],"predecessor-version":[{"id":1901,"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions\/1901"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsau.today\/index.php?rest_route=\/wp\/v2\/media\/1902"}],"wp:attachment":[{"href":"https:\/\/newsau.today\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsau.today\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsau.today\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}