From 5aec7c56ea4a008a1d4c839030384f2354e6390b Mon Sep 17 00:00:00 2001 From: "shopify[bot]" <79544226+shopify[bot]@users.noreply.github.com> Date: Sun, 4 Sep 2022 17:41:02 +0000 Subject: [PATCH] Update from Shopify for theme dawn/use-image-tag Committed from shop: SWOOSH CA --- assets/video-player.js.LICENSE.txt | 20 + snippets/single-ajaxify-album.liquid | 393 +++++++++++++++ snippets/single-footer-player.liquid | 207 ++++++++ snippets/single-progress-bar.liquid | 74 +++ snippets/single-track.liquid | 161 +++++++ templates/page.single.nft-countdown.liquid | 102 ++++ templates/product.single.album.liquid | 528 +++++++++++++++++++++ 7 files changed, 1485 insertions(+) create mode 100644 assets/video-player.js.LICENSE.txt create mode 100644 snippets/single-ajaxify-album.liquid create mode 100644 snippets/single-footer-player.liquid create mode 100644 snippets/single-progress-bar.liquid create mode 100644 snippets/single-track.liquid create mode 100644 templates/page.single.nft-countdown.liquid create mode 100644 templates/product.single.album.liquid diff --git a/assets/video-player.js.LICENSE.txt b/assets/video-player.js.LICENSE.txt new file mode 100644 index 00000000000..882e3092893 --- /dev/null +++ b/assets/video-player.js.LICENSE.txt @@ -0,0 +1,20 @@ +/*! + * + * Copyright (C) 2020, Bitmovin, Inc., All Rights Reserved + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + * + * bitmovin-analytics version v2.18.0 + * + */ + +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 2.3.0 + */ + +/*! codem-isoboxer v0.2.1 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ diff --git a/snippets/single-ajaxify-album.liquid b/snippets/single-ajaxify-album.liquid new file mode 100644 index 00000000000..7188a0f4a36 --- /dev/null +++ b/snippets/single-ajaxify-album.liquid @@ -0,0 +1,393 @@ +{% comment %} + +{% endcomment %} + diff --git a/snippets/single-footer-player.liquid b/snippets/single-footer-player.liquid new file mode 100644 index 00000000000..90b11d6c159 --- /dev/null +++ b/snippets/single-footer-player.liquid @@ -0,0 +1,207 @@ + + + \ No newline at end of file diff --git a/snippets/single-progress-bar.liquid b/snippets/single-progress-bar.liquid new file mode 100644 index 00000000000..d69d85abb35 --- /dev/null +++ b/snippets/single-progress-bar.liquid @@ -0,0 +1,74 @@ + + +{% for variant in product.variants %} + {% if variant.metafields.single_nft['is_nft'] == 'true' %} + {% assign available = variant.inventory_quantity %} + {% assign total_inventory = variant.metafields.single_nft['product_supply'] %} + {% endif %} +{% endfor %} +{% assign claimed_count = total_inventory | minus: available %} +{% assign denom = total_inventory | times: 1.0 %} +{% assign bar_width = claimed_count | divided_by: denom | times: 100 | round: 2 %} + +{% if total_inventory > 0 %} + +
+

{{ available }} of {{ total_inventory }} available

+ {% for variant in product.variants %} +
+
+
+ {{ bar_width }}% +
+
+
+ {% endfor %} +
+ + {% if variant.inventory_quantity == 0 %} + + {% else %} + + {% endif %} + +{% endif %} \ No newline at end of file diff --git a/snippets/single-track.liquid b/snippets/single-track.liquid new file mode 100644 index 00000000000..e2cfd1e185c --- /dev/null +++ b/snippets/single-track.liquid @@ -0,0 +1,161 @@ +{% comment %} + +{% endcomment %} + +{% capture trackReleaseDateString %}{{ track.metafields.track.release_date }}{% endcapture %} +{% assign trackDateParts = trackReleaseDateString | split: "/" %} +{% capture trackReleaseDateFormatted -%} + {{- trackDateParts[2] }}-{{ trackDateParts[0] }}-{{ trackDateParts[1] -}} +{%- endcapture %} +{% assign trackReleaseDate = trackReleaseDateFormatted | date: "%s" | plus: 0 %} +{% capture trackOnSale -%} + {%- if trackReleaseDate <= now %}true{% endif -%} +{%- endcapture %} +{% capture previewAvailable -%} + {%- if track.metafields.track.preview == "true" %}true{% endif -%} +{%- endcapture %} +{% assign previewLink = track.metafields.track.preview_link %} +{% capture albumOnly -%} + {%- if track.metafields.track.album_only == "true" %}true{% endif -%} +{%- endcapture %} +{% capture previewClickEvent -%} + {%- if trackOnSale == "true" and previewAvailable == "true" -%} + onclick="togglePlayingTrack('{{ track.id }}', '{{ previewLink }}')" + {%- endif -%} +{%- endcapture %} +{% capture trackTime -%} + {%- if track.metafields.track.track_time != '' -%} + {{ track.metafields.track.track_time }} + {%- endif -%} +{%- endcapture %} +{% capture previewClass -%} + {%- if previewAvailable == "true" %} single-track-preview{% endif -%} +{%- endcapture %} +{% capture availableClass -%} + {%- if trackOnSale == "true" %} single-track-available{% endif -%} +{%- endcapture %} +{% assign tuning = track.metafields.track.tuning | default: 'C#' %} +{% assign bpm = track.metafields.track.bpm | default: '126bpm' %} + +{% for variant in track.variants %} + {% if variant.available %} + {% if variant == track.selected_or_first_available_variant %} + {% assign track_variant = variant.id %} + {% endif %} + {% endif %} +{% endfor %} + +{% if trackOnSale == "true" and previewAvailable == "true" %} + +
+ {% if trackOnSale == "true" and previewAvailable == "true" %} + + play_circle_outline + + {% endif %} +
+ +
+ {% if track.metafields.track.featured_artist_names %} + {{ track.title }} (feat. {{ track.metafields.track.featured_artist_names }}) + {% else %} + {{ track.title }} + {% endif %} +
+ + {% if trackOnSale == "true" and previewAvailable == "true" %} +
+ {{ trackTime }} +
+ {% endif %} + + {% if track.metafields.track.album_only == "true" or trackOnSale != "true" %} + + {% else %} + {% if presale != "true" or trackOnSale == "true" %} +
+
+ add_shopping_cart + {{ track.price | money }} +
+
+ {% endif %} + {% endif %} +
+{% else %} +
+
+ {% if product.metafields.album.confidential_release_date == "true" and trackOnSale != "true" %} + Track {{ track.metafields.track.track_order }} + {% else %} + {% if track.metafields.track.featured_artist_names %} + {{ track.title }} (feat. {{ track.metafields.track.featured_artist_names }}) + {% else %} + {{ track.title }} + {% endif %} + {% endif %} +
+ {% if track.metafields.track.album_only == "true" or trackOnSale != "true" %} + + {% else %} +
+
+ add_shopping_cart + {{ track.price | money }} +
+
+ {% endif %} +
+{% endif %} diff --git a/templates/page.single.nft-countdown.liquid b/templates/page.single.nft-countdown.liquid new file mode 100644 index 00000000000..132f388b434 --- /dev/null +++ b/templates/page.single.nft-countdown.liquid @@ -0,0 +1,102 @@ +{% comment %} + +{% endcomment %} + +{% comment %} + +{% endcomment %} +{{ 'single-v4.css' | asset_url | stylesheet_tag }} +{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }} + +{% assign page_handle = page.handle %} +{% assign product_name = pages[page_handle].metafields.single_nft['product_name'] %} +{% assign product_handle = pages[page_handle].metafields.single_nft['product_handle'] %} +{% assign product_supply = pages[page_handle].metafields.single_nft['product_supply'] %} +{% assign artwork = pages[page_handle].metafields.single_nft['artwork'] %} +{% assign family = pages[page_handle].metafields.single_nft['family'] %} +{% assign release_date = pages[page_handle].metafields.single_nft['release_date'] %} +{% assign product = all_products[product_handle] %} + +
+
+ + + + + + + +
+
+ +
+
+ + +
+
+
+

{{ product_name }}

+

{{ family }}

+
+

Available in:

+

+
+

+

Total supply:

+

{{ product_supply }}

+
+
+ {{ page.content }} +
+
+ +
+ +
+ + \ No newline at end of file diff --git a/templates/product.single.album.liquid b/templates/product.single.album.liquid new file mode 100644 index 00000000000..d68bc9df734 --- /dev/null +++ b/templates/product.single.album.liquid @@ -0,0 +1,528 @@ +{% comment %} + +{% endcomment %} + +{% comment %} + +{% endcomment %} +{{ 'single-v4.css' | asset_url | stylesheet_tag }} + +{% comment %} + +{% endcomment %} +{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }} + +{% comment %} + +{% endcomment %} +{% capture releaseDateString %}{{ product.metafields.album.release_date }}{% endcapture %} +{% assign dateParts = releaseDateString | split: "/" %} +{% capture releaseDateFormatted -%} + {{- dateParts[2] }}-{{ dateParts[0] }}-{{ dateParts[1] -}} +{%- endcapture %} +{% assign releaseDate = releaseDateFormatted | date: "%s" | plus: 0 %} +{% assign now = "now" | date: "%s" | plus: 0 %} +{% capture presale -%} + {%- if releaseDate > now %}true{% endif -%} +{%- endcapture %} + +
+
+ + + + + + + +
+
+ {{ featured_img_alt }} +
+ {% if product.metafields.album.track_count > 1 %} + {% unless product.metafields.album.confidential_release_date == "true" %} + {% if presale == "true" %} +
+ Pre-order: Expected {{ releaseDateFormatted | time_tag: '%B %d, %Y' }} +
+
+ Pre-order contents may change without notice. You'll receive items from this pre-order + as they become available. +
+ {% else %} +
+

Release Date: {{ releaseDateFormatted | time_tag: '%B %d, %Y' }}

+
+ {% endif %} + {% endunless %} +
+

Downloads include choice of MP3, WAV, or FLAC

+

{{ product.description }}

+
+ {% endif %} +
+ + +
+ +
+

+ {% if product.metafields.album.featured_artist_names %} + + {{- product.title }} (feat. + {{ product.metafields.album.featured_artist_names }}) + {% else %} + {{ product.title }} + {% endif %} +

+

{{ product.metafields.album.artist_name }}

+ {% if product.variants.size == 1 %} +

+ {% if product.metafields.album.track_count == 1 %} + {% assign collection_key = product.metafields.album.collection_handle %} + {% assign track = collections[collection_key].products.first %} + {% capture trackTime -%} + {%- if track.metafields.track.track_time != '' -%} + + {{- track.metafields.track.track_time -}} + + {%- endif -%} + {%- endcapture %} + {% capture previewAvailable -%} + {%- if track.metafields.track.preview == "true" %}true{% endif -%} + {%- endcapture %} + {% assign previewLink = track.metafields.track.preview_link %} + {% assign tuning = track.metafields.track.tuning | default: 'C#' %} + {% assign bpm = track.metafields.track.bpm | default: '120bpm' %} + + {% for variant in track.variants %} + {% if variant.available %} + {% if variant == track.selected_or_first_available_variant %} + {% assign track_variant = variant.id %} + {% endif %} + {% endif %} + {% endfor %} + + {% if previewAvailable == "true" %} + + {% endif %} + {% endif %} + {{ product.variants.first.price | money }} + {{ trackTime }} +

+ {% endif %} + + + {% form 'product', product %} + {% if product.variants.size > 1 %} +
Select Format
+ + {% else %} + + {% endif %} +
+ + {{ form | payment_button }} +
+ {% endform %} +
+ + + {% assign collection_key = product.metafields.album.collection_handle %} + {% assign products = collections[collection_key].products %} + {% capture productsExist -%} + {%- if products != '' and products.length != 0 %}true{% endif -%} + {%- endcapture %} + {% if product.metafields.album.track_count != 1 and productsExist == 'true' %} +
+ {% for track in products %} + {% if track.type == 'Digital Track' %} + {% include 'single-track' with track %} + {% endif %} + {% endfor %} +
+ {% endif %} + + + {% if product.metafields.album.track_count == 1 %} + {% unless product.metafields.album.confidential_release_date == "true" %} + {% if presale == "true" %} +
+ Pre-order: Expected {{ releaseDateFormatted | time_tag: '%B %d, %Y' }} +
+
+ Pre-order contents may change without notice. You'll receive items from this pre-order + as they become available. +
+ {% else %} +
+

Release Date: {{ releaseDateFormatted | time_tag: '%B %d, %Y' }}

+
+ {% endif %} + {% endunless %} +
+

Downloads include choice of MP3, WAV, or FLAC

+

{{ product.description }}

+
+ {% endif %} + +
+

Downloads include choice of MP3, WAV, or FLAC

+

{{ product.description }}

+
+
+ +
+ +
+ + + +{% for track in products %} + {% capture trackReleaseDateString %}{{ track.metafields.track.release_date }}{% endcapture %} + {% assign trackDateParts = trackReleaseDateString | split: "/" %} + {% capture trackReleaseDateFormatted -%} + {{- trackDateParts[2] }}-{{ trackDateParts[0] }}-{{ trackDateParts[1] -}} + {%- endcapture %} + {% assign trackReleaseDate = trackReleaseDateFormatted | date: "%s" | plus: 0 %} + {%- if trackReleaseDate <= now %} + {%- if track.metafields.track.preview == "true" %} + {% assign enablePlayer = "true" %} + {% endif -%} + {% endif -%} +{% endfor %} + +{% if enablePlayer == "true" %} + {% include 'single-footer-player' %} + + +{% endif %} + +{% include 'single-ajaxify-album' %}