{"id":6,"date":"2026-05-28T14:26:12","date_gmt":"2026-05-28T12:26:12","guid":{"rendered":"http:\/\/barometrwedkarski.you2.pl\/?page_id=6"},"modified":"2026-05-28T14:26:13","modified_gmt":"2026-05-28T12:26:13","slug":"6-2","status":"publish","type":"page","link":"https:\/\/barometrwedkarski.you2.pl\/index.php\/6-2\/","title":{"rendered":""},"content":{"rendered":"    <div id=\"barometr-8595\" class=\"bw-app\">\n        <div class=\"bw-loading\">\n            <div class=\"bw-fish\">\ud83d\udc1f<\/div>\n            <div class=\"bw-loading-text\">Sprawdzam warunki na \u0142owisku\u2026<\/div>\n        <\/div>\n    <\/div>\n\n    <style>\n    @import url('https:\/\/fonts.googleapis.com\/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap');\n\n    .bw-app {\n        font-family: 'DM Sans', sans-serif;\n        max-width: 480px;\n        margin: 0 auto;\n        border-radius: 20px;\n        overflow: hidden;\n        background: #f8f5f0;\n    }\n    .bw-loading {\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        min-height: 200px;\n        gap: 16px;\n    }\n    .bw-fish { font-size: 40px; animation: bw-swim 1.5s ease-in-out infinite; }\n    @keyframes bw-swim {\n        0%,100%{transform:translateX(-10px) rotate(-5deg);}\n        50%{transform:translateX(10px) rotate(5deg);}\n    }\n    .bw-loading-text { font-size: 15px; color: #6b6b6b; }\n    .bw-sky {\n        padding: 36px 20px 48px;\n        position: relative;\n        overflow: hidden;\n    }\n    .bw-sky-good  { background: linear-gradient(160deg,#0c3547 0%,#1a5276 60%,#2e86ab 100%); }\n    .bw-sky-warn  { background: linear-gradient(160deg,#1a1a2e 0%,#3d3d5c 60%,#7b7fa3 100%); }\n    .bw-sky-bad   { background: linear-gradient(160deg,#1c0a0a 0%,#4a1515 60%,#7f1d1d 100%); }\n    .bw-sky::after {\n        content:'';\n        position:absolute;\n        bottom:-1px;left:0;right:0;\n        height:36px;\n        background:#f8f5f0;\n        border-radius:36px 36px 0 0;\n    }\n    .bw-app-label {\n        font-family:'DM Serif Display',serif;\n        font-size:12px;\n        letter-spacing:3px;\n        text-transform:uppercase;\n        color:rgba(255,255,255,0.55);\n        margin-bottom:20px;\n    }\n    .bw-verdict-zone { text-align:center; position:relative; z-index:1; }\n    .bw-verdict-emoji {\n        font-size:60px;\n        display:block;\n        margin-bottom:10px;\n        filter:drop-shadow(0 4px 12px rgba(0,0,0,0.3));\n        animation:bw-float 4s ease-in-out infinite;\n    }\n    @keyframes bw-float {\n        0%,100%{transform:translateY(0);}\n        50%{transform:translateY(-8px);}\n    }\n    .bw-verdict-text {\n        font-family:'DM Serif Display',serif;\n        font-size:30px;\n        color:#fff;\n        text-shadow:0 2px 8px rgba(0,0,0,0.3);\n    }\n    .bw-verdict-sub { font-size:13px; color:rgba(255,255,255,0.72); margin-top:6px; font-weight:300; }\n    .bw-location { font-size:12px; color:rgba(255,255,255,0.55); margin-top:6px; }\n    .bw-content { padding:20px 16px; }\n    .bw-card {\n        background:#fff;\n        border-radius:16px;\n        padding:18px;\n        margin-bottom:14px;\n        box-shadow:0 1px 4px rgba(0,0,0,0.06);\n    }\n    .bw-card-title {\n        font-size:10px;\n        font-weight:500;\n        letter-spacing:2px;\n        text-transform:uppercase;\n        color:#6b6b6b;\n        margin-bottom:14px;\n    }\n    .bw-pressure-big { display:flex; align-items:baseline; gap:6px; margin-bottom:14px; }\n    .bw-pressure-val { font-family:'DM Serif Display',serif; font-size:48px; line-height:1; color:#1c1c1e; }\n    .bw-pressure-unit { font-size:15px; color:#6b6b6b; }\n    .bw-trend-badge {\n        display:inline-flex;\n        align-items:center;\n        gap:6px;\n        padding:5px 12px;\n        border-radius:100px;\n        font-size:13px;\n        font-weight:500;\n    }\n    .bw-trend-stable { background:#e8f5e9; color:#2d6a4f; }\n    .bw-trend-rising { background:#fff8e1; color:#b5740a; }\n    .bw-trend-falling { background:#fce4ec; color:#c62828; }\n    .bw-trend-fast-fall { background:#fee2e2; color:#7f1d1d; }\n    .bw-trend-fast-rise { background:#fef3c7; color:#78350f; }\n    .bw-gauge { height:7px; background:#efefef; border-radius:8px; margin-top:14px; overflow:hidden; }\n    .bw-gauge-fill { height:100%; border-radius:8px; background:linear-gradient(90deg,#52b788,#2d6a4f); transition:width 1s ease; }\n    .bw-gauge-labels { display:flex; justify-content:space-between; margin-top:4px; }\n    .bw-gauge-label { font-size:10px; color:#6b6b6b; }\n    .bw-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }\n    .bw-tile {\n        background:#fff;\n        border-radius:14px;\n        padding:14px;\n        box-shadow:0 1px 3px rgba(0,0,0,0.05);\n    }\n    .bw-tile-icon { font-size:20px; margin-bottom:6px; display:block; }\n    .bw-tile-label { font-size:10px; color:#6b6b6b; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:3px; }\n    .bw-tile-val { font-family:'DM Serif Display',serif; font-size:19px; color:#1c1c1e; }\n    .bw-tip {\n        border-radius:14px;\n        padding:16px 18px;\n        margin-bottom:14px;\n        border-left:4px solid;\n    }\n    .bw-tip-good { background:#d8f3dc; border-color:#52b788; }\n    .bw-tip-warn { background:#fef3c7; border-color:#f59e0b; }\n    .bw-tip-bad  { background:#fee2e2; border-color:#ef4444; }\n    .bw-tip-title { font-weight:500; font-size:13px; margin-bottom:5px; }\n    .bw-tip-good .bw-tip-title { color:#2d6a4f; }\n    .bw-tip-warn .bw-tip-title { color:#b5740a; }\n    .bw-tip-bad  .bw-tip-title { color:#7f1d1d; }\n    .bw-tip-body { font-size:13px; line-height:1.6; font-weight:300; }\n    .bw-tip-good .bw-tip-body { color:#1b4332; }\n    .bw-tip-warn .bw-tip-body { color:#78350f; }\n    .bw-tip-bad  .bw-tip-body { color:#7f1d1d; }\n    .bw-history { background:#fff; border-radius:16px; padding:18px; margin-bottom:14px; box-shadow:0 1px 3px rgba(0,0,0,0.05); }\n    .bw-bars { display:flex; align-items:flex-end; gap:8px; height:56px; }\n    .bw-bar-wrap { flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; height:100%; justify-content:flex-end; }\n    .bw-bar { width:100%; border-radius:4px 4px 0 0; background:#dce8ff; min-height:4px; }\n    .bw-bar.bw-bar-current { background:#1a5276; }\n    .bw-bar-time { font-size:10px; color:#6b6b6b; }\n    .bw-refresh-btn {\n        width:100%;\n        padding:14px;\n        background:#0c3547;\n        color:#fff;\n        border:none;\n        border-radius:14px;\n        font-family:'DM Sans',sans-serif;\n        font-size:14px;\n        font-weight:500;\n        cursor:pointer;\n        margin-bottom:8px;\n    }\n    .bw-refresh-btn:active { opacity:0.8; }\n    .bw-updated { font-size:11px; color:#6b6b6b; text-align:center; margin-bottom:4px; }\n    .bw-error { padding:24px; text-align:center; }\n    .bw-error-icon { font-size:36px; margin-bottom:12px; }\n    .bw-error-title { font-family:'DM Serif Display',serif; font-size:20px; margin-bottom:8px; }\n    .bw-error-msg { font-size:13px; color:#6b6b6b; line-height:1.6; }\n    <\/style>\n\n    <script>\n    (function() {\n        const appId = \"barometr-8595\";\n        const app = document.getElementById(appId);\n        const HIST_KEY = 'bw_hist_' + appId;\n\n        function saveHist(hPa) {\n            let h = JSON.parse(localStorage.getItem(HIST_KEY) || '[]');\n            h.push({ t: Date.now(), p: hPa });\n            h = h.filter(x => Date.now() - x.t < 12 * 3600 * 1000).slice(-8);\n            localStorage.setItem(HIST_KEY, JSON.stringify(h));\n            return h;\n        }\n\n        function calcTrend(hist, hPa) {\n            if (hist.length < 2) return { type: 'stable', delta: 0 };\n            const delta = hPa - hist[0].p;\n            const hours = (Date.now() - hist[0].t) \/ 3600000 || 1;\n            const rate = delta \/ hours;\n            if (Math.abs(rate) < 0.3) return { type: 'stable', delta };\n            if (rate >= 1.5)  return { type: 'fast-rise', delta };\n            if (rate > 0.3)   return { type: 'rising', delta };\n            if (rate <= -1.5) return { type: 'fast-fall', delta };\n            return { type: 'falling', delta };\n        }\n\n        function verdict(hPa, trend) {\n            const good = hPa >= 1010 && hPa <= 1025;\n            const low  = hPa < 1005;\n            const high = hPa > 1030;\n            if (trend.type === 'stable' && good)   return { emoji:'\ud83c\udfa3', text:'Czas na \u0142owisko!',   sub:'Ci\u015bnienie stabilne i optymalne', cls:'good' };\n            if (trend.type === 'fast-fall' || low)  return { emoji:'\u26c8\ufe0f', text:'Zosta\u0144 w domu',     sub:'Ci\u015bnienie spada szybko \u2014 ryby przestaj\u0105 bra\u0107', cls:'bad' };\n            if (trend.type === 'falling')            return { emoji:'\ud83c\udf27\ufe0f', text:'Nie najlepiej',     sub:'Ci\u015bnienie opada, aktywno\u015b\u0107 ryb spada', cls:'bad' };\n            if (trend.type === 'fast-rise')          return { emoji:'\u26a1', text:'Poczekaj chwil\u0119',   sub:'Gwa\u0142towny wzrost \u2014 ryby si\u0119 adaptuj\u0105', cls:'warn' };\n            if (trend.type === 'rising' && !good)    return { emoji:'\ud83c\udf24\ufe0f', text:'Mo\u017ce by\u0107 nie\u017ale',  sub:'Ci\u015bnienie ro\u015bnie ku optimum', cls:'warn' };\n            if (high)                                return { emoji:'\u2600\ufe0f', text:'Mo\u017ce by\u0107 nie\u017ale',   sub:'Wysokie ci\u015bnienie \u2014 dobre, ale bierno\u015b\u0107 w po\u0142udnie', cls:'warn' };\n            return { emoji:'\ud83c\udfa3', text:'Czas na \u0142owisko!', sub:'Warunki sprzyjaj\u0105 w\u0119dkowaniu', cls:'good' };\n        }\n\n        function trendLabel(type, delta) {\n            const d = Math.abs(delta).toFixed(1);\n            const s = delta.toFixed(1);\n            const map = {\n                'stable':    { text:'Stabilne ('+s+' hPa)',         arrow:'\u2192', cls:'bw-trend-stable' },\n                'rising':    { text:'Ro\u015bnie (+'+d+' hPa)',          arrow:'\u2191', cls:'bw-trend-rising' },\n                'falling':   { text:'Spada ('+s+' hPa)',            arrow:'\u2193', cls:'bw-trend-falling' },\n                'fast-rise': { text:'Gwa\u0142townie ro\u015bnie (+'+d+' hPa)', arrow:'\u21c8', cls:'bw-trend-fast-rise' },\n                'fast-fall': { text:'Gwa\u0142townie spada ('+s+' hPa)', arrow:'\u21ca', cls:'bw-trend-fast-fall' }\n            };\n            return map[type] || map['stable'];\n        }\n\n        function tipText(cls, trend) {\n            if (cls === 'good') return { title:'\u2705 Dobry czas na w\u0119dkowanie', body:'Stabilne ci\u015bnienie mi\u0119dzy 1010\u20131025 hPa to optimum. Ryby s\u0105 aktywne i ch\u0119tnie \u017ceruj\u0105. Najlepsza aktywno\u015b\u0107 rano i wieczorem.' };\n            if (cls === 'bad')  return trend.type === 'fast-fall'\n                ? { title:'\u274c S\u0142abe warunki', body:'Gwa\u0142towny spadek ci\u015bnienia powoduje, \u017ce ryby chowaj\u0105 si\u0119 przy dnie i przestaj\u0105 je\u015b\u0107. Odczekaj a\u017c ci\u015bnienie si\u0119 ustabilizuje.' }\n                : { title:'\u274c S\u0142abe warunki', body:'Niskie lub szybko spadaj\u0105ce ci\u015bnienie. Ryby s\u0105 ma\u0142o aktywne. Lepiej poczeka\u0107 na popraw\u0119.' };\n            return trend.type === 'rising'\n                ? { title:'\u26a0\ufe0f Warunki przeci\u0119tne', body:'Ci\u015bnienie ro\u015bnie \u2014 ryby mog\u0105 by\u0107 nieco sp\u0142oszone, ale za kilka godzin aktywno\u015b\u0107 wzro\u015bnie. Spr\u00f3buj p\u00f3\u017anym popo\u0142udniem.' }\n                : { title:'\u26a0\ufe0f Warunki przeci\u0119tne', body:'Zmienne ci\u015bnienie. Ryby mog\u0105 bra\u0107 nieregularnie. Warto pr\u00f3bowa\u0107, ale bez gwarancji.' };\n        }\n\n        function hToTime(ts) {\n            const d = new Date(ts);\n            return d.getHours() + ':' + String(d.getMinutes()).padStart(2,'0');\n        }\n\n        function gaugePercent(hPa) {\n            return Math.min(100, Math.max(0, ((hPa - 990) \/ 50) * 100));\n        }\n\n        function render(data) {\n            const { pressure, temp, humidity, windspeed, location } = data;\n            const hPa = Math.round(pressure);\n            const hist = saveHist(hPa);\n            const trend = calcTrend(hist, hPa);\n            const v = verdict(hPa, trend);\n            const tl = trendLabel(trend.type, trend.delta);\n            const tip = tipText(v.cls, trend);\n            const now = new Date().toLocaleTimeString('pl-PL', { hour:'2-digit', minute:'2-digit' });\n\n            const allP = hist.map(h => h.p);\n            const minP = Math.min(...allP, hPa) - 1;\n            const maxP = Math.max(...allP, hPa) + 1;\n            const range = maxP - minP || 1;\n\n            const barsHtml = hist.map((h, i) =>\n                '<div class=\"bw-bar-wrap\">' +\n                '<div class=\"bw-bar ' + (i === hist.length-1 ? 'bw-bar-current' : '') + '\" style=\"height:' + Math.max(((h.p - minP)\/range)*100, 8) + '%\"><\/div>' +\n                '<div class=\"bw-bar-time\">' + hToTime(h.t) + '<\/div>' +\n                '<\/div>'\n            ).join('');\n\n            app.innerHTML =\n                '<div class=\"bw-sky bw-sky-' + v.cls + '\">' +\n                    '<div class=\"bw-app-label\">\ud83c\udfa3 Barometr W\u0119dkarski<\/div>' +\n                    '<div class=\"bw-verdict-zone\">' +\n                        '<span class=\"bw-verdict-emoji\">' + v.emoji + '<\/span>' +\n                        '<div class=\"bw-verdict-text\">' + v.text + '<\/div>' +\n                        '<div class=\"bw-verdict-sub\">' + v.sub + '<\/div>' +\n                        (location ? '<div class=\"bw-location\">\ud83d\udccd ' + location + '<\/div>' : '') +\n                    '<\/div>' +\n                '<\/div>' +\n                '<div class=\"bw-content\">' +\n                    '<div class=\"bw-card\">' +\n                        '<div class=\"bw-card-title\">Ci\u015bnienie atmosferyczne<\/div>' +\n                        '<div class=\"bw-pressure-big\"><div class=\"bw-pressure-val\">' + hPa + '<\/div><div class=\"bw-pressure-unit\">hPa<\/div><\/div>' +\n                        '<span class=\"bw-trend-badge ' + tl.cls + '\"><span>' + tl.arrow + '<\/span> ' + tl.text + '<\/span>' +\n                        '<div class=\"bw-gauge\"><div class=\"bw-gauge-fill\" style=\"width:' + gaugePercent(hPa) + '%\"><\/div><\/div>' +\n                        '<div class=\"bw-gauge-labels\"><span class=\"bw-gauge-label\">990 hPa<\/span><span class=\"bw-gauge-label\">1015 (optymalne)<\/span><span class=\"bw-gauge-label\">1040<\/span><\/div>' +\n                    '<\/div>' +\n                    '<div class=\"bw-info-grid\">' +\n                        '<div class=\"bw-tile\"><span class=\"bw-tile-icon\">\ud83c\udf21\ufe0f<\/span><div class=\"bw-tile-label\">Temperatura<\/div><div class=\"bw-tile-val\">' + Math.round(temp) + '\u00b0C<\/div><\/div>' +\n                        '<div class=\"bw-tile\"><span class=\"bw-tile-icon\">\ud83d\udca7<\/span><div class=\"bw-tile-label\">Wilgotno\u015b\u0107<\/div><div class=\"bw-tile-val\">' + Math.round(humidity) + '%<\/div><\/div>' +\n                        '<div class=\"bw-tile\"><span class=\"bw-tile-icon\">\ud83c\udf2c\ufe0f<\/span><div class=\"bw-tile-label\">Wiatr<\/div><div class=\"bw-tile-val\">' + Math.round(windspeed) + ' km\/h<\/div><\/div>' +\n                        '<div class=\"bw-tile\"><span class=\"bw-tile-icon\">\ud83d\udcca<\/span><div class=\"bw-tile-label\">Zakres optymalny<\/div><div class=\"bw-tile-val\">1010\u20131025<\/div><\/div>' +\n                    '<\/div>' +\n                    '<div class=\"bw-tip bw-tip-' + v.cls + '\"><div class=\"bw-tip-title\">' + tip.title + '<\/div><div class=\"bw-tip-body\">' + tip.body + '<\/div><\/div>' +\n                    (hist.length > 1 ? '<div class=\"bw-history\"><div class=\"bw-card-title\">Historia ostatnich odczyt\u00f3w<\/div><div class=\"bw-bars\">' + barsHtml + '<\/div><\/div>' : '') +\n                    '<div class=\"bw-updated\">Ostatnia aktualizacja: ' + now + '<\/div>' +\n                    '<button class=\"bw-refresh-btn\" onclick=\"bwStart_' + appId.replace(\/-\/g,'_') + '()\">\ud83d\udd04 Od\u015bwie\u017c dane<\/button>' +\n                '<\/div>';\n        }\n\n        function showError(msg) {\n            app.innerHTML =\n                '<div class=\"bw-sky bw-sky-bad\"><div class=\"bw-app-label\">\ud83c\udfa3 Barometr W\u0119dkarski<\/div><\/div>' +\n                '<div class=\"bw-content\"><div class=\"bw-error\">' +\n                '<div class=\"bw-error-icon\">\ud83d\ude15<\/div>' +\n                '<div class=\"bw-error-title\">Co\u015b posz\u0142o nie tak<\/div>' +\n                '<div class=\"bw-error-msg\">' + msg + '<\/div>' +\n                '<\/div><button class=\"bw-refresh-btn\" onclick=\"bwStart_' + appId.replace(\/-\/g,'_') + '()\">\ud83d\udd04 Spr\u00f3buj ponownie<\/button><\/div>';\n        }\n\n        async function reverseGeocode(lat, lon) {\n            try {\n                const r = await fetch('https:\/\/nominatim.openstreetmap.org\/reverse?lat=' + lat + '&lon=' + lon + '&format=json');\n                const d = await r.json();\n                return d.address?.city || d.address?.town || d.address?.village || d.address?.county || '';\n            } catch { return ''; }\n        }\n\n        async function startApp() {\n            app.innerHTML = '<div class=\"bw-loading\"><div class=\"bw-fish\">\ud83d\udc1f<\/div><div class=\"bw-loading-text\">Sprawdzam warunki na \u0142owisku\u2026<\/div><\/div>';\n\n            let lat = 52.2297, lon = 21.0122, location = 'Warszawa (domy\u015blna)';\n            try {\n                const pos = await new Promise((res, rej) => navigator.geolocation.getCurrentPosition(res, rej, { timeout: 10000 }));\n                lat = pos.coords.latitude;\n                lon = pos.coords.longitude;\n                location = await reverseGeocode(lat, lon);\n            } catch(e) {}\n\n            try {\n                const url = 'https:\/\/api.open-meteo.com\/v1\/forecast?latitude=' + lat + '&longitude=' + lon + '&current=temperature_2m,relative_humidity_2m,surface_pressure,wind_speed_10m&timezone=auto';\n                const res = await fetch(url);\n                const d = await res.json();\n                const c = d.current;\n                const elevation = d.elevation || 0;\n                const tempK = c.temperature_2m + 273.15;\n                const seaLevelPressure = c.surface_pressure * Math.exp((9.80665 * 0.0289644 * elevation) \/ (8.31432 * tempK));\n                render({ pressure: seaLevelPressure, temp: c.temperature_2m, humidity: c.relative_humidity_2m, windspeed: c.wind_speed_10m, location });\n            } catch(e) {\n                showError('Nie mo\u017cna pobra\u0107 danych pogodowych. Sprawd\u017a po\u0142\u0105czenie z internetem i spr\u00f3buj ponownie.');\n            }\n        }\n\n        \/\/ Eksportuj funkcj\u0119 globalnie \u017ceby przycisk Od\u015bwie\u017c dzia\u0142a\u0142\n        window['bwStart_' + appId.replace(\/-\/g,'_')] = startApp;\n\n        startApp();\n    })();\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/pages\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":1,"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/pages\/6\/revisions"}],"predecessor-version":[{"id":8,"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/pages\/6\/revisions\/8"}],"wp:attachment":[{"href":"https:\/\/barometrwedkarski.you2.pl\/index.php\/wp-json\/wp\/v2\/media?parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}