PageSourceSearch

https://www.ekomedica.cz/user/documents/upload/ekomedica-october-popup.js?v=1.0

js ekomedica.cz collected 2026-10-06 12:23:26 UTC 18,329 bytes, 627 lines download raw bytes

1/*
2 * EkoMedica - WOW rijnovy popup 2026
3 * Tento soubor je JavaScript ulozeny jako .txt jen pro pohodlne stazeni.
4 *
5 * POSTUP:
6 * 1) prejmenujte na: ekomedica-october-popup.js
7 * 2) nahrajte do: /user/documents/upload/
8 * 3) do zapati pridejte:
9 *    <script src="/user/documents/upload/ekomedica-october-popup.js?v=1.0"></script>
10 *
11 * Popup se zobrazi pouze na homepage a maximalne 1x za 3 dny.
12 */
13
14(function () {
15    "use strict";
16
17    var CONFIG = {
18        actionUrl: "/vsechny-produkty/?dd=1",
19        imageUrl: "/user/documents/upload/ekomedica-rijen-20-hero.png",
20        delayMs: 3800,
21        repeatAfterDays: 3,
22        storageKey: "ekm_oct_popup_2026_seen"
23    };
24
25    function isHomepage() {
26        return document.body && document.body.classList.contains("type-index");
27    }
28
29    function canUseStorage() {
30        try {
31            var testKey = "__ekm_test__";
32            localStorage.setItem(testKey, "1");
33            localStorage.removeItem(testKey);
34            return true;
35        } catch (e) {
36            return false;
37        }
38    }
39
40    function wasSeenRecently() {
41        if (!canUseStorage()) return false;
42
43        var value = localStorage.getItem(CONFIG.storageKey);
44        if (!value) return false;
45
46        var seenAt = parseInt(value, 10);
47        if (!seenAt) return false;
48
49        var maxAge = CONFIG.repeatAfterDays * 24 * 60 * 60 * 1000;
50        return (Date.now() - seenAt) < maxAge;
51    }
52
53    function markSeen() {
54        if (!canUseStorage()) return;
55
56        try {
57            localStorage.setItem(CONFIG.storageKey, String(Date.now()));
58        } catch (e) {}
59    }
60
61    function addStyles() {
62        if (document.getElementById("ekm-oct-popup-style")) return;
63
64        var css = `
65        #ekm-oct-popup{
66            position:fixed;
67            inset:0;
68            z-index:999999;
69            display:flex;
70            align-items:center;
71            justify-content:center;
72            padding:24px;
73            box-sizing:border-box;
74            background:rgba(15,45,32,.56);
75            backdrop-filter:blur(8px);
76            -webkit-backdrop-filter:blur(8px);
77            opacity:0;
78            visibility:hidden;
79            transition:opacity .28s ease,visibility .28s ease
80        }
81
82        #ekm-oct-popup.is-visible{
83            opacity:1;
84            visibility:visible
85        }
86
87        #ekm-oct-popup .ekm-pop-card{
88            position:relative;
89            display:grid;
90            grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);
91            width:min(900px,94vw);
92            max-height:min(620px,90vh);
93            overflow:hidden;
94            background:#fffefa;
95            border:1px solid rgba(255,255,255,.75);
96            border-radius:24px;
97            box-shadow:
98                0 34px 90px rgba(4,35,23,.28),
99                0 8px 24px rgba(4,35,23,.12);
100            transform:translateY(18px) scale(.975);
101            opacity:0;
102            transition:
103                transform .42s cubic-bezier(.2,.8,.2,1),
104                opacity .32s ease
105        }
106
107        #ekm-oct-popup.is-visible .ekm-pop-card{
108            transform:translateY(0) scale(1);
109            opacity:1
110        }
111
112        #ekm-oct-popup .ekm-pop-copy{
113            position:relative;
114            z-index:2;
115            padding:46px 44px 40px;
116            background:
117                radial-gradient(circle at 8% 10%,rgba(139,178,139,.18) 0 70px,transparent 71px),
118                linear-gradient(145deg,#fffefa 0%,#f7f4ea 100%)
119        }
120
121        #ekm-oct-popup .ekm-pop-copy::after{
122            content:"";
123            position:absolute;
124            right:-70px;
125            bottom:-70px;
126            width:190px;
127            height:190px;
128            border-radius:50%;
129            background:rgba(234,241,231,.72);
130            pointer-events:none
131        }
132
133        #ekm-oct-popup .ekm-pop-kicker{
134            display:inline-flex;
135            align-items:center;
136            gap:8px;
137            margin-bottom:13px;
138            padding:7px 11px;
139            border-radius:999px;
140            background:#eaf1e7;
141            color:#0f5a3c;
142            font-size:11px;
143            font-weight:800;
144            line-height:1;
145            letter-spacing:.105em;
146            text-transform:uppercase
147        }
148
149        #ekm-oct-popup .ekm-pop-kicker::before{
150            content:"";
151            width:7px;
152            height:7px;
153            border-radius:50%;
154            background:#4f7d57;
155            box-shadow:0 0 0 4px rgba(79,125,87,.12)
156        }
157
158        #ekm-oct-popup .ekm-pop-discount{
159            margin:0;
160            color:#0f5a3c;
161            font-size:clamp(72px,8vw,108px);
162            font-weight:850;
163            line-height:.88;
164            letter-spacing:-.065em
165        }
166
167        #ekm-oct-popup .ekm-pop-title{
168            max-width:470px;
169            margin:11px 0 12px;
170            color:#24352d;
171            font-size:31px;
172            font-weight:800;
173            line-height:1.06;
174            letter-spacing:-.035em
175        }
176
177        #ekm-oct-popup .ekm-pop-lead{
178            max-width:500px;
179            margin:0 0 20px;
180            color:#52645a;
181            font-size:14.5px;
182            line-height:1.55
183        }
184
185        #ekm-oct-popup .ekm-pop-benefits{
186            display:grid;
187            grid-template-columns:repeat(3,minmax(0,1fr));
188            gap:8px;
189            margin:0 0 22px
190        }
191
192        #ekm-oct-popup .ekm-pop-benefit{
193            display:flex;
194            align-items:center;
195            gap:8px;
196            min-width:0;
197            padding:10px 9px;
198            background:rgba(255,255,255,.78);
199            border:1px solid #dfe7dc;
200            border-radius:11px;
201            color:#405349;
202            font-size:10.5px;
203            font-weight:750;
204            line-height:1.2
205        }
206
207        #ekm-oct-popup .ekm-pop-benefit i{
208            position:relative;
209            flex:0 0 27px;
210            width:27px;
211            height:27px;
212            border-radius:50%;
213            background:#e4eee1
214        }
215
216        #ekm-oct-popup .ekm-pop-benefit i::before{
217            content:"";
218            position:absolute;
219            left:50%;
220            top:50%;
221            width:13px;
222            height:13px;
223            border:2px solid #0f5a3c;
224            border-radius:50%;
225            transform:translate(-50%,-50%);
226            box-sizing:border-box
227        }
228
229        #ekm-oct-popup .ekm-pop-benefit:nth-child(1) i::after{
230            content:"";
231            position:absolute;
232            left:13px;
233            top:6px;
234            width:6px;
235            height:13px;
236            border-right:2px solid #0f5a3c;
237            transform:rotate(36deg);
238            transform-origin:center
239        }
240
241        #ekm-oct-popup .ekm-pop-benefit:nth-child(2) i::before{
242            width:13px;
243            height:9px;
244            border-radius:2px
245        }
246
247        #ekm-oct-popup .ekm-pop-benefit:nth-child(2) i::after{
248            content:"";
249            position:absolute;
250            left:8px;
251            top:8px;
252            width:10px;
253            height:2px;
254            background:#0f5a3c;
255            box-shadow:0 4px 0 #0f5a3c,0 8px 0 #0f5a3c
256        }
257
258        #ekm-oct-popup .ekm-pop-benefit:nth-child(3) i::before{
259            width:12px;
260            height:12px;
261            border-radius:3px;
262            transform:translate(-50%,-50%) rotate(45deg)
263        }
264
265        #ekm-oct-popup .ekm-pop-actions{
266            position:relative;
267            z-index:3;
268            display:flex;
269            align-items:center;
270            gap:12px;
271            flex-wrap:wrap
272        }
273
274        #ekm-oct-popup .ekm-pop-btn{
275            display:inline-flex;
276            align-items:center;
277            justify-content:center;
278            min-height:48px;
279            padding:12px 22px;
280            border-radius:10px;
281            background:#0f5a3c;
282            color:#fff!important;
283            text-decoration:none!important;
284            font-size:14px;
285            font-weight:800;
286            box-shadow:0 7px 18px rgba(15,90,60,.18);
287            transition:
288                transform .16s ease,
289                background .16s ease,
290                box-shadow .16s ease
291        }
292
293        #ekm-oct-popup .ekm-pop-btn:hover{
294            background:#08452e;
295            transform:translateY(-2px);
296            box-shadow:0 10px 22px rgba(15,90,60,.22)
297        }
298
299        #ekm-oct-popup .ekm-pop-date{
300            color:#617168;
301            font-size:11px;
302            font-weight:700;
303            line-height:1.35
304        }
305
306        #ekm-oct-popup .ekm-pop-fineprint{
307            position:relative;
308            z-index:3;
309            margin:14px 0 0;
310            color:#78847d;
311            font-size:10px;
312            line-height:1.45
313        }
314
315        #ekm-oct-popup .ekm-pop-visual{
316            position:relative;
317            min-height:500px;
318            overflow:hidden;
319            background:
320                linear-gradient(180deg,rgba(13,78,52,.08),rgba(13,78,52,.18)),
321                url("${CONFIG.imageUrl}") center center / cover no-repeat,
322                #eaf1e7
323        }
324
325        #ekm-oct-popup .ekm-pop-visual::before{
326            content:"";
327            position:absolute;
328            inset:0;
329            background:
330                linear-gradient(90deg,rgba(255,254,250,.18) 0%,rgba(255,254,250,0) 38%),
331                linear-gradient(180deg,rgba(0,0,0,0) 55%,rgba(5,48,31,.20) 100%)
332        }
333
334        #ekm-oct-popup .ekm-pop-badge{
335            position:absolute;
336            left:22px;
337            bottom:22px;
338            z-index:2;
339            display:inline-flex;
340            align-items:center;
341            gap:8px;
342            padding:9px 12px;
343            border:1px solid rgba(255,255,255,.45);
344            border-radius:999px;
345            background:rgba(15,90,60,.82);
346            color:#fff;
347            font-size:10.5px;
348            font-weight:800;
349            letter-spacing:.025em;
350            backdrop-filter:blur(6px);
351            -webkit-backdrop-filter:blur(6px);
352            box-shadow:0 8px 18px rgba(0,0,0,.14)
353        }
354
355        #ekm-oct-popup .ekm-pop-badge::before{
356            content:"";
357            width:7px;
358            height:7px;
359            border-radius:50%;
360            background:#d8ead6;
361            box-shadow:0 0 0 3px rgba(255,255,255,.14)
362        }
363
364        #ekm-oct-popup .ekm-pop-close{
365            position:absolute;
366            top:14px;
367            right:14px;
368            z-index:5;
369            display:flex;
370            align-items:center;
371            justify-content:center;
372            width:38px;
373            height:38px;
374            padding:0;
375            border:1px solid rgba(255,255,255,.60);
376            border-radius:50%;
377            background:rgba(255,255,255,.88);
378            color:#24352d;
379            font-size:23px;
380            font-weight:300;
381            line-height:1;
382            cursor:pointer;
383            box-shadow:0 5px 16px rgba(0,0,0,.12);
384            transition:transform .15s ease,background .15s ease
385        }
386
387        #ekm-oct-popup .ekm-pop-close:hover{
388            background:#fff;
389            transform:rotate(4deg) scale(1.05)
390        }
391
392        @media (max-width:760px){
393            #ekm-oct-popup{
394                align-items:flex-end;
395                padding:10px
396            }
397
398            #ekm-oct-popup .ekm-pop-card{
399                grid-template-columns:1fr;
400                width:100%;
401                max-height:94vh;
402                border-radius:20px
403            }
404
405            #ekm-oct-popup .ekm-pop-copy{
406                order:2;
407                padding:24px 20px 20px
408            }
409
410            #ekm-oct-popup .ekm-pop-visual{
411                order:1;
412                min-height:185px;
413                background-position:center 55%
414            }
415
416            #ekm-oct-popup .ekm-pop-discount{
417                font-size:62px
418            }
419
420            #ekm-oct-popup .ekm-pop-title{
421                margin-top:7px;
422                font-size:25px
423            }
424
425            #ekm-oct-popup .ekm-pop-lead{
426                margin-bottom:15px;
427                font-size:13px
428            }
429
430            #ekm-oct-popup .ekm-pop-benefits{
431                grid-template-columns:1fr 1fr 1fr;
432                gap:6px;
433                margin-bottom:16px
434            }
435
436            #ekm-oct-popup .ekm-pop-benefit{
437                display:block;
438                padding:8px 6px;
439                text-align:center;
440                font-size:9.5px
441            }
442
443            #ekm-oct-popup .ekm-pop-benefit i{
444                display:block;
445                margin:0 auto 6px
446            }
447
448            #ekm-oct-popup .ekm-pop-actions{
449                display:grid;
450                grid-template-columns:1fr
451            }
452
453            #ekm-oct-popup .ekm-pop-btn{
454                width:100%;
455                box-sizing:border-box
456            }
457
458            #ekm-oct-popup .ekm-pop-date{
459                text-align:center
460            }
461
462            #ekm-oct-popup .ekm-pop-badge{
463                left:14px;
464                bottom:14px
465            }
466
467            #ekm-oct-popup .ekm-pop-close{
468                top:12px;
469                right:12px
470            }
471        }
472
473        @media (max-width:390px){
474            #ekm-oct-popup .ekm-pop-copy{
475                padding:21px 16px 17px
476            }
477
478            #ekm-oct-popup .ekm-pop-visual{
479                min-height:155px
480            }
481
482            #ekm-oct-popup .ekm-pop-discount{
483                font-size:55px
484            }
485
486            #ekm-oct-popup .ekm-pop-title{
487                font-size:22px
488            }
489
490            #ekm-oct-popup .ekm-pop-benefits{
491                grid-template-columns:1fr 1fr
492            }
493
494            #ekm-oct-popup .ekm-pop-benefit:last-child{
495                grid-column:1/-1
496            }
497        }
498
499        @media (prefers-reduced-motion:reduce){
500            #ekm-oct-popup,
501            #ekm-oct-popup .ekm-pop-card,
502            #ekm-oct-popup .ekm-pop-btn{
503                transition:none!important
504            }
505        }`;
506
507        var style = document.createElement("style");
508        style.id = "ekm-oct-popup-style";
509        style.textContent = css;
510        document.head.appendChild(style);
511    }
512
513    function buildPopup() {
514        if (document.getElementById("ekm-oct-popup")) return null;
515
516        var overlay = document.createElement("div");
517        overlay.id = "ekm-oct-popup";
518        overlay.setAttribute("role", "dialog");
519        overlay.setAttribute("aria-modal", "true");
520        overlay.setAttribute("aria-labelledby", "ekm-pop-title");
521
522        overlay.innerHTML =
523            '<div class="ekm-pop-card">' +
524                '<button class="ekm-pop-close" type="button" aria-label="Zavřít">×</button>' +
525
526                '<div class="ekm-pop-copy">' +
527                    '<div class="ekm-pop-kicker">Říjnová akce</div>' +
528                    '<div class="ekm-pop-discount">−20 %</div>' +
529                    '<h2 class="ekm-pop-title" id="ekm-pop-title">na téměř celý sortiment</h2>' +
530                    '<p class="ekm-pop-lead">Objevte přírodní sílu EkoMedica za výhodnější ceny. Šťávy, doplňky stravy, smoothie a další produkty pro každodenní péči.</p>' +
531
532                    '<div class="ekm-pop-benefits">' +
533                        '<div class="ekm-pop-benefit"><i></i><span>Přírodní síla</span></div>' +
534                        '<div class="ekm-pop-benefit"><i></i><span>Přehledné složení</span></div>' +
535                        '<div class="ekm-pop-benefit"><i></i><span>Každodenní péče</span></div>' +
536                    '</div>' +
537
538                    '<div class="ekm-pop-actions">' +
539                        '<a class="ekm-pop-btn" href="' + CONFIG.actionUrl + '">Prohlédnout akci →</a>' +
540                        '<span class="ekm-pop-date">1.–31. 10. 2026</span>' +
541                    '</div>' +
542
543                    '<p class="ekm-pop-fineprint">Sleva je již započtena v cenách. Nevztahuje se na kategorii Sušené plody.</p>' +
544                '</div>' +
545
546                '<div class="ekm-pop-visual" aria-hidden="true">' +
547                    '<div class="ekm-pop-badge">EkoMedica • říjen 2026</div>' +
548                '</div>' +
549            '</div>';
550
551        document.body.appendChild(overlay);
552        return overlay;
553    }
554
555    function showPopup() {
556        if (!isHomepage()) return;
557        if (wasSeenRecently()) return;
558
559        addStyles();
560
561        var overlay = buildPopup();
562        if (!overlay) return;
563
564        var closeButton = overlay.querySelector(".ekm-pop-close");
565        var actionButton = overlay.querySelector(".ekm-pop-btn");
566        var previousOverflow = document.body.style.overflow;
567
568        function closePopup(mark) {
569            if (mark !== false) markSeen();
570
571            overlay.classList.remove("is-visible");
572            document.body.style.overflow = previousOverflow;
573
574            window.setTimeout(function () {
575                if (overlay && overlay.parentNode) {
576                    overlay.parentNode.removeChild(overlay);
577                }
578            }, 320);
579
580            document.removeEventListener("keydown", onKeydown);
581        }
582
583        function onKeydown(event) {
584            if (event.key === "Escape") {
585                closePopup(true);
586            }
587        }
588
589        closeButton.addEventListener("click", function () {
590            closePopup(true);
591        });
592
593        actionButton.addEventListener("click", function () {
594            markSeen();
595        });
596
597        overlay.addEventListener("click", function (event) {
598            if (event.target === overlay) {
599                closePopup(true);
600            }
601        });
602
603        document.addEventListener("keydown", onKeydown);
604
605        document.body.style.overflow = "hidden";
606
607        requestAnimationFrame(function () {
608            requestAnimationFrame(function () {
609                overlay.classList.add("is-visible");
610            });
611        });
612    }
613
614    function init() {
615        if (!isHomepage()) return;
616        if (wasSeenRecently()) return;
617
618        window.setTimeout(showPopup, CONFIG.delayMs);
619    }
620
621    if (document.readyState === "loading") {
622        document.addEventListener("DOMContentLoaded", init, { once: true });
623    } else {
624        init();
625    }
626
627})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.