diff --git a/make_post_sell/static/css/common.css b/make_post_sell/static/css/common.css index 0157d86..7d9466c 100644 --- a/make_post_sell/static/css/common.css +++ b/make_post_sell/static/css/common.css @@ -418,6 +418,58 @@ div.product-images img.product-main { height: auto; } +/* Video play button overlay for hero thumbnails */ +.video-thumbnail-container { + position: relative; + display: inline-block; + cursor: pointer; +} + +.video-thumbnail-container img.product-main { + display: block; +} + +.video-play-overlay { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80px; + height: 80px; + background-color: rgba(0, 0, 0, 0.6); + border-radius: 50%; + display: grid; + place-items: center; + transition: background-color 0.2s ease, transform 0.2s ease; +} + +.video-play-overlay::after { + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 15px 0 15px 25px; + border-color: transparent transparent transparent #ffffff; + margin-left: 5px; +} + +.video-thumbnail-container:hover .video-play-overlay { + background-color: rgba(0, 0, 0, 0.8); + transform: translate(-50%, -50%) scale(1.1); +} + +[data-theme="dark"] .video-play-overlay { + background-color: rgba(255, 255, 255, 0.2); +} + +[data-theme="dark"] .video-play-overlay::after { + border-color: transparent transparent transparent #ffffff; +} + +[data-theme="dark"] .video-thumbnail-container:hover .video-play-overlay { + background-color: rgba(255, 255, 255, 0.35); +} + /* Prevent content sections from overflowing */ .product-description, .content, diff --git a/make_post_sell/templates/content.j2 b/make_post_sell/templates/content.j2 index fb0e3e7..cfe9097 100644 --- a/make_post_sell/templates/content.j2 +++ b/make_post_sell/templates/content.j2 @@ -34,14 +34,12 @@
{% if "thumbnail1" in product.extensions %} - {% if product.extensions["product"] in ["mp3", "mp4", "wav", "flac", "aac", "ogg", "wma", "m4a", "avi", "mov", "wmv", "flv", "mkv", "webm", "m4v"] %} -
- -
- -
click ▶ to play!
+ {% set video_extensions = ["mp4", "avi", "mov", "wmv", "flv", "mkv", "webm", "m4v"] %} + {% if product.extensions.get("product") in video_extensions %} +
+ +
-
{% else %} {% endif %} diff --git a/make_post_sell/templates/product.j2 b/make_post_sell/templates/product.j2 index 2cf68ea..735dc8f 100644 --- a/make_post_sell/templates/product.j2 +++ b/make_post_sell/templates/product.j2 @@ -34,7 +34,15 @@

{{ product.title }} sold by {{ product.shop.name }}

{% if "thumbnail1" in product.extensions %} + {% set video_extensions = ["mp4", "avi", "mov", "wmv", "flv", "mkv", "webm", "m4v"] %} + {% if signed_get_object_url and product.extensions.get("product") in video_extensions %} + + +
+
+ {% else %} + {% endif %}
{% endif %}