added advertising

This commit is contained in:
SlimusMinus
2026-09-23 23:38:54 +03:00
parent 3661985a6a
commit 4e20315998
33 changed files with 3351 additions and 18 deletions

228
src/styles/admin.css Normal file
View File

@@ -0,0 +1,228 @@
/* ── Admin: Рекламные кампании (desktop-only) ── */
.admp {
flex: 1;
min-width: 0;
overflow-y: auto;
padding: 28px 32px 48px;
background: var(--bg-app);
font-family: var(--font);
}
.admp-inner {
max-width: 860px;
margin: 0 auto;
}
.admp-toolbar {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 12px;
margin-bottom: 4px;
flex-wrap: wrap;
}
.admp-title {
margin: 0;
font-size: 1.1rem;
font-weight: 800;
color: var(--text-primary);
}
.admp-session-hint {
flex: 1;
font-size: .78rem;
color: var(--muted);
}
.admp-load-error {
flex: 1;
margin-top: 4px;
font-size: .78rem;
}
.admp-empty {
margin-top: 36px;
}
/* ── Карточка кампании ── */
.admp-campaign {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 18px 20px;
margin-bottom: 16px;
}
.admp-campaign-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
margin-bottom: 12px;
}
.admp-campaign-name {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
font-size: 1.05rem;
font-weight: 800;
color: var(--text-primary);
}
.admp-campaign-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.admp-meta {
display: flex;
gap: 16px;
flex-wrap: wrap;
font-size: .82rem;
color: var(--muted);
margin-bottom: 14px;
}
.admp-meta strong {
color: var(--text-primary);
font-weight: 700;
}
.admp-section-title {
font-size: .72rem;
font-weight: 800;
color: var(--muted);
letter-spacing: .5px;
text-transform: uppercase;
margin-bottom: 8px;
}
.admp-no-ads {
font-size: .8rem;
color: var(--muted);
padding: 8px 0;
}
/* ── Строка объявления ── */
.admp-ads {
display: flex;
flex-direction: column;
gap: 8px;
}
.admp-ad {
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: 12px;
padding: 10px 14px;
}
.admp-ad-type {
flex-shrink: 0;
padding: 3px 10px;
border-radius: 8px;
font-size: .68rem;
font-weight: 800;
letter-spacing: .5px;
background: rgba(var(--teal-rgb), .12);
color: var(--teal);
}
.admp-ad-info {
flex: 1;
min-width: 0;
}
.admp-ad-url {
color: var(--text-primary);
font-size: .85rem;
word-break: break-all;
}
.admp-ad-sub {
color: var(--muted);
font-size: .75rem;
margin-top: 2px;
}
/* ── Бейдж статусов ── */
.admp-badge {
display: inline-flex;
align-items: center;
padding: 3px 10px;
border-radius: 999px;
font-size: .68rem;
font-weight: 800;
letter-spacing: .4px;
text-transform: uppercase;
line-height: 1.4;
}
.admp-badge--draft { background: rgba(0,0,0,.06); color: var(--muted); }
.admp-badge--active { background: rgba(var(--teal-rgb), .13); color: var(--teal); }
.admp-badge--inactive { background: rgba(0,0,0,.08); color: var(--muted); }
.admp-badge--paused { background: rgba(250,126,30,.14); color: #fa7e1e; }
.admp-badge--finished { background: rgba(0,0,0,.08); color: var(--muted); }
.admp-badge--ready { background: rgba(var(--teal-rgb), .13); color: var(--teal); }
.admp-badge--processing { background: rgba(250,126,30,.14); color: #fa7e1e; }
.admp-badge--failed { background: rgba(237,73,86,.12); color: var(--err); }
.admp-badge--timeout { background: rgba(0,0,0,.08); color: var(--muted); }
/* ── Кнопки админ-панели ── */
.admp-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 14px;
border-radius: 10px;
background: rgba(var(--teal-rgb), .1);
border: 1px solid rgba(var(--teal-rgb), .28);
color: var(--teal);
font-family: var(--font);
font-size: .78rem;
font-weight: 800;
cursor: pointer;
transition: all .15s;
white-space: nowrap;
}
.admp-btn:hover:not(:disabled) {
background: rgba(var(--teal-rgb), .16);
}
.admp-btn:disabled {
opacity: .5;
cursor: not-allowed;
}
.admp-btn--ghost {
background: var(--bg-input);
border-color: var(--border);
color: var(--text-primary);
}
.admp-btn--ghost:hover:not(:disabled) {
border-color: var(--teal);
color: var(--teal);
}
.admp-ad-edit {
flex-shrink: 0;
padding: 5px 10px;
font-size: .72rem;
}
/* ── Смена статуса ── */
.admp-current-status { margin: 0 0 6px; }
.admp-no-transitions {
font-size: .85rem;
color: var(--muted);
line-height: 1.5;
}
/* ── Полноэкранная реклама (UploadAdModal) ── */
.fs-ad-hint {
font-size: .72rem;
color: var(--muted);
line-height: 1.5;
margin: 8px 0 4px;
}
.fs-ad-list {
margin-top: 4px;
}
.fs-ad-row {
flex-wrap: wrap;
}
.fs-ad-row .admp-campaign-actions {
margin-left: auto;
}
.fs-ad-row .f-upload-progress-text {
text-align: left;
}

View File

@@ -444,3 +444,130 @@ button.f-card-reward-btn:focus-visible {
font-size: .95rem;
}
}
/* ── Advertisement card ── */
.ad-slot-placeholder {
min-height: 250px; /* высота типичного ad-card — резервируем место, чтобы не дёргалась лента */
}
.ad-card {
position: relative;
border-radius: 12px;
overflow: hidden;
margin: 12px 0;
}
.ad-card__label {
position: absolute;
top: 8px;
left: 8px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 11px;
padding: 2px 8px;
border-radius: 4px;
z-index: 2;
}
.ad-card__media {
width: 100%;
height: auto;
display: block;
cursor: pointer;
}
.ad-card__close,
.ad-card__skip-timer {
position: absolute;
top: 8px;
right: 8px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
border: none;
border-radius: 50%;
width: 28px;
height: 28px;
font-size: 12px;
z-index: 2;
}
.ad-card__skip-timer {
border-radius: 14px;
width: auto;
padding: 0 10px;
}
/* ── Полноэкранная реклама (триггер по активному скроллу ленты) ── */
.fs-ad-overlay {
position: fixed;
inset: 0;
z-index: 300; /* выше всех модалок (.f-viewer-bg = 200, .f-modal-bg = 100) */
background: #000;
display: flex;
align-items: center;
justify-content: center;
animation: mfadeIn .2s ease;
cursor: pointer;
}
.fs-ad-video {
width: 100%;
height: 100%;
object-fit: contain;
display: block;
}
.fs-ad-label {
position: absolute;
top: 16px;
left: 16px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 11px;
padding: 2px 8px;
border-radius: 4px;
z-index: 2;
}
.fs-ad-close,
.fs-ad-skip-timer {
position: absolute;
top: 16px;
right: 16px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
border: none;
z-index: 2;
}
.fs-ad-skip-timer {
border-radius: 20px;
padding: 8px 16px;
font-size: 13px;
font-weight: 600;
}
.fs-ad-close {
width: 40px;
height: 40px;
border-radius: 50%;
font-size: 16px;
cursor: pointer;
transition: background .15s;
}
.fs-ad-close:hover {
background: rgba(0, 0, 0, 0.85);
}
.fs-ad-sound {
position: absolute;
bottom: 16px;
right: 16px;
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.6);
border: none;
color: #fff;
font-size: 16px;
cursor: pointer;
z-index: 2;
transition: background .15s;
}
.fs-ad-sound:hover {
background: rgba(0, 0, 0, 0.85);
}

View File

@@ -27,7 +27,8 @@
/* Form Fields */
.f-m-group { margin-bottom: 14px; }
.f-m-row { display: flex; gap: 10px; }
.f-m-row .f-m-group { flex: 1; }
.f-m-row .f-m-group { flex: 1; min-width: 0; }
.f-m-row .f-m-field { width: 100%; min-width: 0; }
.f-m-label {
display: block; color: var(--muted);
font-size: .72rem; font-weight: 700; letter-spacing: .6px;
@@ -315,6 +316,22 @@ select.f-m-field::selection { background: transparent; }
border-radius: 50%; animation: spin .7s linear infinite;
}
/* ── Upload Ad Modal ── */
.f-upload-progress {
height: 8px; border-radius: 4px; overflow: hidden;
background: var(--bg-input); border: 1px solid var(--border);
}
.f-upload-progress-fill {
height: 100%; background: var(--teal);
transition: width .15s ease;
}
.f-upload-progress-text {
font-size: .72rem; color: var(--muted); margin-top: 4px; text-align: right;
}
.f-ok-msg {
font-size: .82rem; color: var(--teal); margin-top: 8px;
}
/* ── Support Modal ── */
.f-support-body {
padding: 0 4px;