Browse Source

Styles

imwald
Nuša Pukšič 3 months ago
parent
commit
73f7a5d6e9
  1. 1
      assets/app.js
  2. 145
      assets/styles/03-components/video-event.css
  3. 4
      assets/styles/04-pages/admin.css
  4. 12
      templates/event/_kind22_video.html.twig
  5. 3
      templates/event/index.html.twig

1
assets/app.js

@ -31,6 +31,7 @@ import './styles/03-components/og.css';
import './styles/03-components/nostr-previews.css'; import './styles/03-components/nostr-previews.css';
import './styles/03-components/nip05-badge.css'; import './styles/03-components/nip05-badge.css';
import './styles/03-components/picture-event.css'; import './styles/03-components/picture-event.css';
import './styles/03-components/video-event.css';
import './styles/03-components/search.css'; import './styles/03-components/search.css';
import './styles/03-components/image-upload.css'; import './styles/03-components/image-upload.css';

145
assets/styles/03-components/video-event.css

@ -0,0 +1,145 @@
/**
* Video Event Component (NIP-71)
* Responsive video player for kind 22 events
*/
.video-event {
width: 100%;
overflow: hidden;
margin-bottom: var(--spacing-2);
}
.video-gallery {
width: 100%;
display: flex;
flex-direction: column;
gap: var(--spacing-3);
}
.video-gallery.hidden {
display: none;
}
.video-item {
width: 100%;
position: relative;
}
.video-player {
width: 100%;
max-width: 100%;
height: auto;
display: block;
background-color: #000;
}
.video-alt {
margin-top: var(--spacing-2);
font-size: 0.9em;
color: var(--color-text-secondary, #666);
font-style: italic;
}
.content-warning {
padding: var(--spacing-3);
background-color: var(--color-warning-bg, #fff3cd);
border: 1px solid var(--color-warning-border, #ffc107);
border-radius: 4px;
margin-bottom: var(--spacing-3);
}
.content-warning strong {
display: block;
margin-bottom: var(--spacing-2);
color: var(--color-warning-text, #856404);
}
.btn-show-nsfw {
margin-top: var(--spacing-2);
padding: var(--spacing-2) var(--spacing-3);
background-color: var(--color-primary, #007bff);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.9em;
}
.btn-show-nsfw:hover {
background-color: var(--color-primary-hover, #0056b3);
}
.video-description {
margin-top: var(--spacing-3);
padding: 0 var(--spacing-2);
}
.video-duration,
.video-published {
margin-top: var(--spacing-2);
font-size: 0.9em;
color: var(--color-text-secondary, #666);
padding: 0 var(--spacing-2);
}
.duration-icon {
margin-right: var(--spacing-1);
}
.video-hashtags {
margin-top: var(--spacing-3);
display: flex;
flex-wrap: wrap;
gap: var(--spacing-2);
padding: 0 var(--spacing-2);
}
.video-hashtags .hashtag {
display: inline-block;
padding: var(--spacing-1) var(--spacing-2);
background-color: var(--color-bg-light, #f8f9fa);
border-radius: 12px;
font-size: 0.85em;
color: var(--color-primary, #007bff);
}
.video-participants {
margin-top: var(--spacing-3);
padding-top: var(--spacing-3);
border-top: 1px solid var(--color-border, #dee2e6);
}
.video-participants h4 {
margin-bottom: var(--spacing-2);
font-size: 1em;
font-weight: 600;
}
.participants-list {
display: flex;
flex-wrap: wrap;
gap: var(--spacing-2);
}
/* Ensure videos don't overflow their container */
.card .video-event,
.article .video-event {
max-width: 100%;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.video-player {
border-radius: 2px;
}
.video-hashtags {
gap: var(--spacing-1);
}
.video-hashtags .hashtag {
font-size: 0.8em;
padding: 4px 8px;
}
}

4
assets/styles/04-pages/admin.css

@ -122,10 +122,6 @@
white-space: nowrap; white-space: nowrap;
} }
/* NIP-68 Picture Event Styles */ /* NIP-68 Picture Event Styles */
.picture-event {
margin: 1rem 0;
}
.picture-title { .picture-title {
font-size: 1.5rem; font-size: 1.5rem;
margin-bottom: 1rem; margin-bottom: 1rem;

12
templates/event/_kind22_video.html.twig

@ -8,10 +8,6 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if title %}
<h2 class="video-title">{{ title }}</h2>
{% endif %}
{# Content warning #} {# Content warning #}
{% set contentWarning = null %} {% set contentWarning = null %}
{% for tag in event.tags %} {% for tag in event.tags %}
@ -38,6 +34,7 @@
{% set dimensions = null %} {% set dimensions = null %}
{% set altText = null %} {% set altText = null %}
{% set previewImage = null %} {% set previewImage = null %}
{% set blurhash = null %}
{% set fallbacks = [] %} {% set fallbacks = [] %}
{# Parse imeta tag parameters #} {# Parse imeta tag parameters #}
@ -51,6 +48,8 @@
{% endif %} {% endif %}
{% elseif param starts with 'image ' %} {% elseif param starts with 'image ' %}
{% set previewImage = param[6:] %} {% set previewImage = param[6:] %}
{% elseif param starts with 'blurhash ' %}
{% set blurhash = param[9:] %}
{% elseif param starts with 'm ' %} {% elseif param starts with 'm ' %}
{% set mimeType = param[2:] %} {% set mimeType = param[2:] %}
{% elseif param starts with 'dim ' %} {% elseif param starts with 'dim ' %}
@ -71,6 +70,9 @@
<video controls <video controls
{% if previewImage %}poster="{{ previewImage }}"{% endif %} {% if previewImage %}poster="{{ previewImage }}"{% endif %}
{% if dimensions %}data-dimensions="{{ dimensions }}"{% endif %} {% if dimensions %}data-dimensions="{{ dimensions }}"{% endif %}
{% if blurhash %}data-blurhash="{{ blurhash }}"{% endif %}
{% if title %}title="{{ title }}"{% endif %}
aria-label="{{ altText|default(title)|default('Video') }}"
class="video-player" class="video-player"
preload="metadata"> preload="metadata">
<source src="{{ videoUrl }}" {% if mimeType %}type="{{ mimeType }}"{% endif %} /> <source src="{{ videoUrl }}" {% if mimeType %}type="{{ mimeType }}"{% endif %} />
@ -91,7 +93,7 @@
{# Description from content #} {# Description from content #}
{% if event.content %} {% if event.content %}
<div class="video-description mt-1"> <div class="video-description">
<twig:Atoms:Content :content="event.content" /> <twig:Atoms:Content :content="event.content" />
</div> </div>
{% endif %} {% endif %}

3
templates/event/index.html.twig

@ -101,8 +101,7 @@
.event-header { .event-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: center;
margin-bottom: 1.5rem;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 1rem; padding: 1rem;
} }

Loading…
Cancel
Save