Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TH-78: All themes > Performance > Optimize default images #26

Merged
merged 16 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified themes/aura/assets/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified themes/aura/assets/default_product.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed themes/aura/assets/left-arrow.png
Binary file not shown.
7 changes: 6 additions & 1 deletion themes/aura/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ body {

.main-content {
display: inline-block;
min-height: 60vh;
width: 100%;
}

Expand Down Expand Up @@ -627,6 +628,10 @@ textarea {
gap: 12px;
margin: 40px auto;
}
.breadcrumbs-container .breadcrumbs-listings .listings__item {
display: inline-flex;
align-items: center;
}
.breadcrumbs-container .breadcrumbs-listings .first-listing {
color: #A8A8A8;
font-weight: 400;
Expand All @@ -642,7 +647,7 @@ textarea {
.breadcrumbs-container .breadcrumbs-listings .third-listing {
font-weight: 800;
}
[dir=ltr] .breadcrumbs-container .breadcrumbs-listings .listings__item img {
[dir=ltr] .breadcrumbs-container .breadcrumbs-listings .arrow {
rotate: 180deg;
}
.breadcrumbs-container .breadcrumbs-name {
Expand Down
Binary file added themes/aura/assets/product-placeholder-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/aura/assets/product-placeholder-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/aura/assets/product-placeholder-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/aura/assets/product-placeholder-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions themes/aura/sections/main-navbar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<img
src='{%- if section.settings.navbar_logo.src -%} {{ section.settings.navbar_logo.src }} {%- else -%} {{ 'default-logo.png' | asset_url }} {%- endif -%}'
alt='{{ store.name }}'
width="89"
height="34"
>
</a>
</div>
Expand Down Expand Up @@ -138,6 +140,7 @@
<img
src='{%- if section.settings.navbar_logo.src -%} {{ section.settings.navbar_logo.src }} {%- else -%} {{ 'default-logo.png' | asset_url }} {%- endif -%}'
alt='{{ store.name }}'
width="89" height="34"
>
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions themes/aura/sections/main-page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="listings__item">
<a href="/" class="first-listing">{{ 'snippets.collection-listing.home' | t }}</a>
</div>
<div class="listings__item">
<img src='{{ 'left-arrow.png' | asset_url }}' alt='Left arrow' >
<div class="listings__item arrow">
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<span class="second-listing">{{ page.name }}</span>
Expand Down
4 changes: 2 additions & 2 deletions themes/aura/snippets/breadcrumbs.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
</div>
{%- if template contains 'collection' or template contains 'list-collections' -%}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<a href="/collections" class="second-listing">{{ 'snippets.collection-listing.collections' | t }}</a>
</div>
{% endif %}
{% if category %}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<a href="/collections/{{ category.slug }}" class="third-listing">{{ category.name}}</a>
Expand Down
8 changes: 0 additions & 8 deletions themes/aura/snippets/product-placeholder-svg.liquid

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions themes/aura/snippets/product-placeholder.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

<div class='product-block featured-product-placeholder'>
<div class='product-thumbnail'>
{% assign svg_name = random_titles[index] %}
{% render 'product-placeholder-svg', svg_name: svg_name %}
{% assign incremented_index = index | plus: 1 %}
{% assign product_image = "product-placeholder-" | append: incremented_index | append: '.png' %}
<img
src="{{ product_image | asset_url }}"
loading="lazy" width="194" style="height: auto;"
alt="{{ random_titles[index] }}"
/>
</div>
<div class='product-details'>
<span class='product-title'>{{ random_titles[index] }}</span>
Expand Down
8 changes: 6 additions & 2 deletions themes/aura/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ textarea {
align-items: center;
gap: 12px;
margin: 40px auto;
.listings__item {
display: inline-flex;
align-items: center;
}

.first-listing {
color: #A8A8A8;
Expand All @@ -695,8 +699,8 @@ textarea {
font-weight: 800;
}

.listings__item img {
[dir='ltr'] & {
.arrow {
[dir='ltr'] & {
rotate: 180deg;
}
}
Expand Down
Binary file modified themes/harmony/assets/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified themes/harmony/assets/default_product.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed themes/harmony/assets/left-arrow.png
Binary file not shown.
3 changes: 3 additions & 0 deletions themes/harmony/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ body {

.main-content {
display: inline-block;
min-height: 60vh;
width: 100%;
}

Expand Down Expand Up @@ -649,6 +650,8 @@ textarea {
}
.breadcrumbs-container .breadcrumbs-listings .listings__item {
color: #9B9B9B;
display: inline-flex;
align-items: center;
}
.breadcrumbs-container .breadcrumbs-listings .listings__item .first-listing {
color: #9B9B9B;
Expand Down
Binary file added themes/harmony/assets/product-placeholder-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/harmony/assets/product-placeholder-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/harmony/assets/product-placeholder-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/harmony/assets/product-placeholder-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions themes/harmony/sections/main-footer.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
<img
src="{{ section.settings.footer_logo.src }}"
alt="{{ store.name }}"
width="169" height="46"
>
{% else %}
<img
src="{{ 'default-white-logo.png' | asset_url }}"
alt="{{ store.name }}"
width="169" height="46"
>
{% endif %}
</div>
Expand Down
4 changes: 3 additions & 1 deletion themes/harmony/sections/main-navbar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
<a href='/' aria-label='home'>
<img
src='{%- if section.settings.navbar_logo.src -%} {{ section.settings.navbar_logo.src }} {%- else -%} {{ 'default-black-logo.png' | asset_url }} {%- endif -%}'
alt='{{ store.name }}'
alt='{{ store.name }}'
width="133" height="32"
>
</a>
</div>
Expand Down Expand Up @@ -150,6 +151,7 @@
<img
src='{%- if section.settings.navbar_logo.src -%} {{ section.settings.navbar_logo.src }} {%- else -%} {{ 'default-black-logo.png' | asset_url }} {%- endif -%}'
alt='{{ store.name }}'
width="133" height="32"
>
</a>
</div>
Expand Down
8 changes: 4 additions & 4 deletions themes/harmony/snippets/breadcrumbs.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
</div>
{%- if template contains 'collection' or template contains 'list-collections' -%}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<a href="/collections" class="second-listing">{{ 'snippets.collection-listing.collections' | t }}</a>
</div>
{% endif %}
{% if category %}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<a href="/collections/{{ category.slug }}" class="third-listing">{{ category.name}}</a>
</div>
{%- endif -%}
{%- if template contains 'cart' -%}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<a href="/cart" class="second-listing">{{ 'cart.title' | t }}</a>
</div>
{% endif %}
{% if template contains 'page' %}
<div class="listings__item arrow">
<img src='{{ 'left-arrow.png' | asset_url }}' alt="arrow" width="7" height="12" />
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<span class="second-listing">{{ page.name }}</span>
Expand Down
8 changes: 0 additions & 8 deletions themes/harmony/snippets/product-placeholder-svg.liquid

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions themes/harmony/snippets/product-placeholder.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

<div class='product-block featured-product-placeholder'>
<div class='product-thumbnail'>
{% assign svg_name = random_titles[index] %}
{% render 'product-placeholder-svg', svg_name: svg_name %}
{% assign incremented_index = index | plus: 1 %}
{% assign product_image = "product-placeholder-" | append: incremented_index | append: '.png' %}
<img
src="{{ product_image | asset_url }}"
loading="lazy" width="194" style="height: auto;"
alt="{{ random_titles[index] }}"
/>
</div>
<div class='product-details'>
<span class='product-title'>{{ random_titles[index] }}</span>
Expand Down
2 changes: 2 additions & 0 deletions themes/harmony/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ textarea {

.listings__item {
color: #9B9B9B;
display: inline-flex;
align-items: center;

.first-listing {
color: #9B9B9B;
Expand Down
Binary file modified themes/meraki/assets/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified themes/meraki/assets/default_product.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed themes/meraki/assets/left-arrow.png
Binary file not shown.
8 changes: 8 additions & 0 deletions themes/meraki/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body {

.main-content {
display: inline-block;
min-height: 60vh;
width: 100%;
}

Expand Down Expand Up @@ -659,6 +660,10 @@ textarea {
gap: 12px;
margin: 36px auto;
}
.breadcrumbs-container .breadcrumbs-listings .listings__item {
display: inline-flex;
align-items: center;
}
.breadcrumbs-container .breadcrumbs-listings .first-listing {
color: #9C9C9C;
font-weight: 500;
Expand All @@ -677,6 +682,9 @@ textarea {
.breadcrumbs-container .breadcrumbs-listings .arrow-item {
color: #9C9C9C;
}
[dir=ltr] .breadcrumbs-container .breadcrumbs-listings .arrow {
rotate: 180deg;
}
.breadcrumbs-container .breadcrumbs-name {
font-weight: 700;
font-size: 26px;
Expand Down
Binary file added themes/meraki/assets/product-placeholder-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/meraki/assets/product-placeholder-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/meraki/assets/product-placeholder-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/meraki/assets/product-placeholder-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions themes/meraki/sections/main-footer.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@
<div class="columns container">
{%- if section.settings.footer_logo.src -%}
<div class='footer-logo column'>
<img loading='lazy' src='{{ section.settings.footer_logo.src }}' alt='logo'>
<img
loading='lazy' src='{{ section.settings.footer_logo.src }}' alt='logo'
width="80" height="23"
>
</div>
{% else %}
<div class='footer-logo column'>
<img loading='lazy' src='{{ 'default-black-logo.png' | asset_url }}' alt='logo'>
<img
loading='lazy' src='{{ 'default-black-logo.png' | asset_url }}' alt='logo'
width="80" height="23"
>
</div>
{%- endif -%}
<div class='social-media-links column'>
Expand Down
4 changes: 3 additions & 1 deletion themes/meraki/sections/main-navbar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
<a href='/' aria-label='home'>
<img
src='{%- if section.settings.navbar_logo.src -%} {{ section.settings.navbar_logo.src }} {%- else -%} {{ 'default-white-logo.png' | asset_url }} {%- endif -%}'
alt='{{ store.name }}'
alt='{{ store.name }}'
width="80"
height="23"
>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion themes/meraki/sections/main-page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="/" class="first-listing">{{ 'snippets.collection-listing.home' | t }}</a>
</div>
<div class="listings__item">
<img src='{{ 'left-arrow.png' | asset_url }}' alt='Left arrow'>
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
<div class="listings__item">
<span class="second-listing">{{ page.name }}</span>
Expand Down
8 changes: 0 additions & 8 deletions themes/meraki/snippets/product-placeholder-svg.liquid

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions themes/meraki/snippets/product-placeholder.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@

<div class='product-block featured-product-placeholder'>
<div class='product-thumbnail'>
{% assign svg_name = random_titles[index] %}
{% render 'product-placeholder-svg', svg_name: svg_name %}
{% assign incremented_index = index | plus: 1 %}
{% assign product_image = "product-placeholder-" | append: incremented_index | append: '.png' %}
<img
src="{{ product_image | asset_url }}"
loading="lazy" width="194" style="height: auto;"
alt="{{ random_titles[index] }}"
/>
</div>
<div class='product-details'>
<span class='product-title'>{{ random_titles[index] }}</span>
Expand Down
10 changes: 10 additions & 0 deletions themes/meraki/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ textarea {
align-items: center;
gap: 12px;
margin: 36px auto;
.listings__item {
display: inline-flex;
align-items: center;
}

.first-listing {
color: #9C9C9C;
Expand All @@ -734,6 +738,12 @@ textarea {
.arrow-item {
color: #9C9C9C;
}

.arrow {
[dir='ltr'] & {
rotate: 180deg;
}
}
}

.breadcrumbs-name {
Expand Down