From ced0d67c87857bbbeeeac5adcfa4c3b1132b20e0 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sat, 8 Aug 2026 13:32:28 +0200 Subject: [PATCH] use native Lampa card classes (card__img/card__title/card__age); fix framework contract create(body)+render() without double-render --- plugin.js | 75 ++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/plugin.js b/plugin.js index b91254a..8e1f1b6 100644 --- a/plugin.js +++ b/plugin.js @@ -42,21 +42,41 @@ } } + // Inject plugin styles (only the grid layout; cards use native Lampa classes) + function injectStyles() { + if (window.__mymovies_css_injected) return; + window.__mymovies_css_injected = true; + var css = '' + + '.mymovies{padding:2.2em 3.4em;overflow-y:auto;height:100%;box-sizing:border-box}' + + '.movies-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1.4em}' + + '.mymovies-detail{padding:3em;max-width:900px}' + + '.detail-head{display:flex;gap:2em;flex-wrap:wrap}' + + '.detail-poster{width:220px;border-radius:10px}' + + '.detail-info h1{margin:0 0 .4em;font-size:1.8em}' + + '.detail-info>div{margin:.3em 0;opacity:.85}' + + '.detail-actions{margin-top:1.5em}' + + '.mymovies-empty{padding:2em;opacity:.6;font-size:1.2em}'; + $('