Skip to content

Commit

Permalink
Merge pull request #159 from studio1902/feature/performance-improvements
Browse files Browse the repository at this point in the history
Performance improvements
  • Loading branch information
robdekort committed Oct 27, 2021
2 parents dffb99f + 5bc5c79 commit 2ece664
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 57 deletions.
26 changes: 13 additions & 13 deletions dev/resources/views/components/_picture.antlers.html
Expand Up @@ -11,23 +11,23 @@
{{ else }}
<source
srcset="
{{ glide:url preset='xs-webp' }} 320w,
{{ glide:url preset='sm-webp' }} 480w,
{{ glide:url preset='md-webp' }} 768w,
{{ glide:url preset='lg-webp' }} 1280w,
{{ glide:url preset='xl-webp' }} 1440w,
{{ glide:url preset='2xl-webp' }} 1680w"
{{ glide:image preset='xs-webp' }} 320w,
{{ glide:image preset='sm-webp' }} 480w,
{{ glide:image preset='md-webp' }} 768w,
{{ glide:image preset='lg-webp' }} 1280w,
{{ glide:image preset='xl-webp' }} 1440w,
{{ glide:image preset='2xl-webp' }} 1680w"
sizes="{{ sizes }}"
type="image/webp"
>
<source
srcset="
{{ glide:url preset='xs' }} 320w,
{{ glide:url preset='sm' }} 480w,
{{ glide:url preset='md' }} 768w,
{{ glide:url preset='lg' }} 1280w,
{{ glide:url preset='xl' }} 1440w,
{{ glide:url preset='2xl' }} 1680w"
{{ glide:image preset='xs' }} 320w,
{{ glide:image preset='sm' }} 480w,
{{ glide:image preset='md' }} 768w,
{{ glide:image preset='lg' }} 1280w,
{{ glide:image preset='xl' }} 1440w,
{{ glide:image preset='2xl' }} 1680w"
sizes="{{ sizes }}"
type="{{ image.mime_type }}"
>
Expand All @@ -38,7 +38,7 @@
{{ else }}
class="{{ class }}"
{{ /if }}
src="{{ glide:url preset='lg' }}"
src="{{ glide:image preset='lg' }}"
alt="{{ alt ensure_right='.' }}"
width="{{ image.width }}"
height="{{ image.height }}"
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_owner.antlers.html
Expand Up @@ -51,7 +51,7 @@
{{ if value && handle !== 'consent' }}
<tr>
<td style='vertical-align:top; font-family:"Source Code Pro", monospace; padding:11px; border-bottom:#e3e3da 1px solid; font-size:14px' valign="top">
<strong>{{ trans key="{display}" locale="{site:locale}" }}:</strong><br>
<strong>{{ trans :key="display" :locale="site:locale" }}:</strong><br>
<pre style="white-space:pre-line; font-family:inherit; margin:0">{{ if (value | is_array) }}<ul>{{ value }}<li>{{ value }}</li>{{ /value }}</ul>{{ else }}{{ value }}{{ /if }}</pre>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_owner_text.antlers.html
Expand Up @@ -8,7 +8,7 @@
-
{{ fields }}
{{ if handle !== 'consent' }}
{{ trans key="{display}" locale="{locale}" }}:
{{ trans :key="display" :locale="locale" }}:
{{ if (value | is_array) }}
{{ value }}
{{ value }}
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_sender.antlers.html
Expand Up @@ -63,7 +63,7 @@
{{ if value && handle !== 'consent' }}
<tr>
<td style='vertical-align:top; font-family:"Source Code Pro", monospace; padding:11px; border-bottom:#e3e3da 1px solid; font-size:14px' valign="top">
<strong>{{ trans key="{display}" locale="{site:locale}" }}:</strong><br>
<strong>{{ trans :key="display" :locale="site:locale" }}:</strong><br>
<pre style="white-space:pre-line; font-family:inherit; margin:0">{{ if (value | is_array) }}<ul>{{ value }}<li>{{ value }}</li>{{ /value }}</ul>{{ else }}{{ value }}{{ /if }}</pre>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_sender_text.antlers.html
Expand Up @@ -13,7 +13,7 @@
-
{{ fields }}
{{ if handle !== 'consent' }}
{{ trans key="{display}" locale="{locale}" }}:
{{ trans :key="display" :locale="locale" }}:
{{ if (value | is_array) }}
{{ value }}
{{ value }}
Expand Down
14 changes: 7 additions & 7 deletions dev/resources/views/snippets/_background_image.antlers.html
Expand Up @@ -4,39 +4,39 @@
#}}

<style>
{{ glide src="{image}" }}
{{ glide :src="image" }}
.{{ class }} {
background-image: url("{{ glide:url preset='md' }}");
background-image: url("{{ glide:image preset='md' }}");
background-position: {{ focus_css or 'center' }};
}
@media only screen and (min-width: 320px) {
.{{ class }} {
background-image: url("{{ glide:url preset='sm-webp' }}");
background-image: url("{{ glide:image preset='sm-webp' }}");
}
}
@media only screen and (min-width: 480px), only screen and (min-width: 320px) and (-webkit-min-device-pixel-ratio: 2) {
.{{ class }} {
background-image: url("{{ glide:url preset='md-webp' }}");
background-image: url("{{ glide:image preset='md-webp' }}");
}
}
@media only screen and (min-width: 768px), only screen and (min-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
.{{ class }} {
background-image: url("{{ glide:url preset='lg-webp' }}");
background-image: url("{{ glide:image preset='lg-webp' }}");
}
}
@media only screen and (min-width: 1280px), only screen and (min-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
.{{ class }} {
background-image: url("{{ glide:url preset='xl-webp' }}");
background-image: url("{{ glide:image preset='xl-webp' }}");
}
}
@media only screen and (min-width: 1440px), only screen and (min-width: 1280px) and (-webkit-min-device-pixel-ratio: 2) {
.{{ class }} {
background-image: url("{{ glide:url preset='2xl-webp' }}");
background-image: url("{{ glide:image preset='2xl-webp' }}");
}
}
{{ /glide }}
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/snippets/_form_fields.antlers.html
Expand Up @@ -13,7 +13,7 @@
{{ width == '100' ?= 'md:col-span-12' }}"
>
<label class="font-bold" for="{{ handle }}">
{{ trans key="{display}" }}
{{ trans :key="display" }}
{{ if validate | contains:required }}
<sup class="text-yellow-400">*</sup>
{{ /if }}
Expand Down
@@ -1,20 +1,20 @@
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
}}"
>
{{ foreach:options as="value|label" }}
<label class="inline-flex items-center">
<input
class="mr-2 rounded border-neutral text-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="checkbox"
name="{{ handle }}[]"
value="{{ value }}"
<input
class="mr-2 rounded border-neutral text-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="checkbox"
name="{{ handle }}[]"
value="{{ value }}"
{{ old | in_array:value ?= checked }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</label>
{{ /foreach:options }}
</div>
</div>
24 changes: 12 additions & 12 deletions dev/resources/views/vendor/statamic/forms/fields/radio.antlers.html
@@ -1,20 +1,20 @@
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
}}"
>
{{ foreach:options as="value|label" }}
<label class="inline-flex items-center">
<input
class="mr-2 border-neutral text-primary focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="radio"
name="{{ handle }}"
value="{{ value }}"
<input
class="mr-2 border-neutral text-primary focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="radio"
name="{{ handle }}"
value="{{ value }}"
{{ old === value ?= "checked" }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</label>
{{ /foreach:options }}
</div>
</div>
@@ -1,21 +1,21 @@
{{# Bind custom error classses when there is a validation error with the field. #}}
<select
class="w-full rounded border-neutral focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
<select
class="w-full rounded border-neutral focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
:class="{ 'border-red-600 focus-visible:border-red-600': errors.{{ handle }} }"
name="{{ handle }}{{ multiple ?= "[]" }}"
{{ multiple ?= "multiple" }}
name="{{ handle }}{{ multiple ?= "[]" }}"
{{ multiple ?= "multiple" }}
>
{{ unless multiple }}
<option value>{{ trans key="Please select..." }}</option>
{{ /unless }}
{{ foreach:options as="value|label" }}
<option
value="{{ value }}"
<option
value="{{ value }}"
{{ if old|in_array:value or old === value }}
selected
{{ /if }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</option>
{{ /foreach:options }}
</select>
</select>

0 comments on commit 2ece664

Please sign in to comment.