@total_onion/onion-library 2.0.106 → 2.0.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.js +124 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.php +17 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.scss +269 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.twig +89 -0
- package/components/block-cocktail-recipe-v3/group_68fff19fa4dd0.json +200 -0
- package/components/block-single-column-container-v3/group_6887640458d61.json +2 -2
- package/components/block-sub-group-container-v3/group_686ceba7d6066.json +127 -1
- package/components/component-block-settings-v3/block-settings-v3.scss +0 -1
- package/components/fields-cocktail-info-v3/group_64c29b7f188ca.json +475 -0
- package/components/fields-ingredients-list/group_6900f19dadebf.json +111 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export default function cocktailrecipev3Js(options = {}) {
|
|
2
|
+
try {
|
|
3
|
+
const {block} = options;
|
|
4
|
+
|
|
5
|
+
const valueEl = block.querySelector('[data-servings-value]');
|
|
6
|
+
const decBtn = block.querySelector('[data-servings-dec]');
|
|
7
|
+
const incBtn = block.querySelector('[data-servings-inc]');
|
|
8
|
+
const decWrapper = block.querySelector('.dec-btn-wrapper');
|
|
9
|
+
const amountEls = block.querySelectorAll('[data-ingredients]');
|
|
10
|
+
const unitToggle = document.querySelector('[data-unit-toggle]');
|
|
11
|
+
const checkbox = unitToggle?.querySelector('[data-unit-checkbox]');
|
|
12
|
+
|
|
13
|
+
amountEls.forEach((el) => {
|
|
14
|
+
if (!el.dataset.baseAmount) {
|
|
15
|
+
el.dataset.baseAmount = el.dataset.amount || '';
|
|
16
|
+
}
|
|
17
|
+
if (!el.dataset.baseUnit) {
|
|
18
|
+
el.dataset.baseUnit = el.dataset.unit || '';
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
let currentUnit = 'ml';
|
|
23
|
+
const ML_TO_OZ = 0.033814;
|
|
24
|
+
|
|
25
|
+
const getServings = () => parseInt(valueEl.textContent, 10) || 1;
|
|
26
|
+
const setServings = (n) => {
|
|
27
|
+
valueEl.textContent = `${n}x`;
|
|
28
|
+
updateInactiveState(n);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const updateInactiveState = (value) => {
|
|
32
|
+
if (!decWrapper) return;
|
|
33
|
+
if (value <= 1) decWrapper.classList.add('inactive');
|
|
34
|
+
else decWrapper.classList.remove('inactive');
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const formatNumber = (num, unit) => {
|
|
38
|
+
if (unit === 'oz')
|
|
39
|
+
return (Math.round(num * 100) / 100)
|
|
40
|
+
.toFixed(2)
|
|
41
|
+
.replace(/\.?0+$/, '');
|
|
42
|
+
if (unit === 'ml')
|
|
43
|
+
return (Math.round(num * 10) / 10)
|
|
44
|
+
.toString()
|
|
45
|
+
.replace(/\.0$/, '');
|
|
46
|
+
return (Math.round(num * 100) / 100)
|
|
47
|
+
.toString()
|
|
48
|
+
.replace(/\.?0+$/, '');
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const convert = (value, fromUnit, toUnit) => {
|
|
52
|
+
if (isNaN(value)) return value;
|
|
53
|
+
if (fromUnit === toUnit) return value;
|
|
54
|
+
|
|
55
|
+
if (fromUnit === 'ml' && toUnit === 'oz') return value * ML_TO_OZ;
|
|
56
|
+
if (fromUnit === 'oz' && toUnit === 'ml') return value / ML_TO_OZ;
|
|
57
|
+
|
|
58
|
+
return value;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const renderIngredients = () => {
|
|
62
|
+
const servings = getServings();
|
|
63
|
+
|
|
64
|
+
amountEls.forEach((el) => {
|
|
65
|
+
const baseAmount = parseFloat(el.dataset.baseAmount);
|
|
66
|
+
const baseUnit = el.dataset.baseUnit || '';
|
|
67
|
+
const name = el.dataset.name || '';
|
|
68
|
+
|
|
69
|
+
if (isNaN(baseAmount)) {
|
|
70
|
+
el.textContent = name;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let amount = baseAmount * servings;
|
|
75
|
+
let displayUnit = baseUnit;
|
|
76
|
+
|
|
77
|
+
if (
|
|
78
|
+
(baseUnit === 'ml' || baseUnit === 'oz') &&
|
|
79
|
+
currentUnit !== baseUnit
|
|
80
|
+
) {
|
|
81
|
+
amount = convert(amount, baseUnit, currentUnit);
|
|
82
|
+
displayUnit = currentUnit;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const numStr = formatNumber(amount, displayUnit);
|
|
86
|
+
const unitStr = displayUnit ? displayUnit : '';
|
|
87
|
+
|
|
88
|
+
el.textContent =
|
|
89
|
+
`${numStr}${unitStr ? unitStr : ''}${unitStr ? ' ' : ' '}${name}`.trim();
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
decBtn?.addEventListener('click', () => {
|
|
94
|
+
const cur = getServings();
|
|
95
|
+
if (cur > 1) {
|
|
96
|
+
setServings(cur - 1);
|
|
97
|
+
renderIngredients();
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
incBtn?.addEventListener('click', () => {
|
|
102
|
+
const cur = getServings();
|
|
103
|
+
if (cur < 99) {
|
|
104
|
+
setServings(cur + 1);
|
|
105
|
+
renderIngredients();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (checkbox) {
|
|
110
|
+
checkbox.addEventListener('change', (e) => {
|
|
111
|
+
currentUnit = e.target.checked ? 'oz' : 'ml';
|
|
112
|
+
renderIngredients();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
setServings(getServings() || 1);
|
|
117
|
+
currentUnit = 'ml';
|
|
118
|
+
renderIngredients();
|
|
119
|
+
updateInactiveState(getServings());
|
|
120
|
+
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error(error);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
acf_register_block_type(
|
|
4
|
+
array(
|
|
5
|
+
'name' => 'cocktail-recipe-v3',
|
|
6
|
+
'title' => __('Cocktail Recipe v3', 'Global-theme Admin'),
|
|
7
|
+
'render_callback' => 'core_block_render_post_object_v3',
|
|
8
|
+
'category' => 'common',
|
|
9
|
+
'icon' => get_svg_icon_content('brick.svg'),
|
|
10
|
+
'keywords' => array('content', 'text'),
|
|
11
|
+
'mode' => 'preview',
|
|
12
|
+
'supports' => array(
|
|
13
|
+
'align' => false,
|
|
14
|
+
'anchor' => true,
|
|
15
|
+
),
|
|
16
|
+
)
|
|
17
|
+
);
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
@use 'NodeModules/@total_onion/onion-library/components/fields-core-mixins-v3/core-mixins-v3';
|
|
2
|
+
@use 'NodeModules/@total_onion/onion-library/components/fields-core-functions-v3/core-functions-v3';
|
|
3
|
+
@use 'NodeModules/@total_onion/onion-library/breakpoints';
|
|
4
|
+
.cocktail-recipe-v3 {
|
|
5
|
+
pointer-events: all;
|
|
6
|
+
|
|
7
|
+
&__ingredients-container {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: core-functions-v3.fluidSize(20);
|
|
11
|
+
padding-bottom: core-functions-v3.fluidSize(50);
|
|
12
|
+
|
|
13
|
+
.ingredients-title {
|
|
14
|
+
padding-block: core-functions-v3.fluidSize(10);
|
|
15
|
+
font-family: var(--primary-font-family);
|
|
16
|
+
font-size: core-functions-v3.fontSize(160);
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__servings {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
padding-block: core-functions-v3.fluidSize(10);
|
|
27
|
+
border-bottom: 1px solid #faf8ec4d;
|
|
28
|
+
|
|
29
|
+
.servings-title {
|
|
30
|
+
font-family: var(--secondary-font-family);
|
|
31
|
+
font-size: core-functions-v3.fontSize(26);
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.servings-control-wrapper {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: core-functions-v3.fluidSize(15);
|
|
39
|
+
|
|
40
|
+
.dec-btn-wrapper {
|
|
41
|
+
width: 40px;
|
|
42
|
+
height: 40px;
|
|
43
|
+
border: 1px solid #faf8ec;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
|
|
46
|
+
.servings-dec-btn {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
background-color: #0054FF;
|
|
49
|
+
color: #faf8ec;
|
|
50
|
+
font-size: 28px;
|
|
51
|
+
padding-bottom: 4px;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
border: unset;
|
|
55
|
+
transform: translateX(0);
|
|
56
|
+
transition: transform .3s ease;
|
|
57
|
+
|
|
58
|
+
&::after {
|
|
59
|
+
content: '\2212';
|
|
60
|
+
color: #0054FF;
|
|
61
|
+
padding-top: 4px;
|
|
62
|
+
width: 38px;
|
|
63
|
+
height: 38px;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0;
|
|
66
|
+
right: -38px;
|
|
67
|
+
background-color: #faf8ec;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
.servings-dec-btn {
|
|
73
|
+
transform: translateX(-100%);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.dec-btn-wrapper.inactive {
|
|
79
|
+
opacity: 0.4;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.servings-current {
|
|
84
|
+
font-family: var(--secondary-font-family);
|
|
85
|
+
font-size: core-functions-v3.fontSize(30);
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
display: inline-block;
|
|
88
|
+
width: core-functions-v3.fluidSize(60);
|
|
89
|
+
text-align: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.inc-btn-wrapper {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
width: 40px;
|
|
95
|
+
height: 40px;
|
|
96
|
+
border: 1px solid #faf8ec;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
|
|
99
|
+
.servings-inc-btn {
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
color: #0054FF;
|
|
102
|
+
font-size: 30px;
|
|
103
|
+
background-color: #faf8ec;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
border: unset;
|
|
107
|
+
transform: translateX(-100%);
|
|
108
|
+
transition: transform .3s ease;
|
|
109
|
+
|
|
110
|
+
&::after {
|
|
111
|
+
content: '+';
|
|
112
|
+
padding-top: 2px;
|
|
113
|
+
color: #faf8ec;
|
|
114
|
+
width: 38px;
|
|
115
|
+
height: 38px;
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 0;
|
|
118
|
+
right: -38px;
|
|
119
|
+
background-color: #0054FF;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&:hover {
|
|
124
|
+
.servings-inc-btn {
|
|
125
|
+
transform: translateX(0);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__unit-toggle {
|
|
133
|
+
display: flex;
|
|
134
|
+
justify-content: space-between;
|
|
135
|
+
align-items: center;
|
|
136
|
+
padding-top: core-functions-v3.fluidSize(10);
|
|
137
|
+
|
|
138
|
+
.unit-text {
|
|
139
|
+
font-family: var(--tertiary-font-family);
|
|
140
|
+
font-size: core-functions-v3.fontSize(22);
|
|
141
|
+
font-weight: 700;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.unit-toggle-wrapper {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: core-functions-v3.fluidSize(20);
|
|
148
|
+
|
|
149
|
+
.checkbox-wrapper input[type='checkbox'] {
|
|
150
|
+
display: none;
|
|
151
|
+
visibility: hidden;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.checkbox-wrapper .block {
|
|
155
|
+
position: relative;
|
|
156
|
+
clear: both;
|
|
157
|
+
float: left;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.checkbox-wrapper label {
|
|
161
|
+
width: 64px;
|
|
162
|
+
height: 36px;
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
border: 1px solid;
|
|
165
|
+
float: left;
|
|
166
|
+
border-radius: 100px;
|
|
167
|
+
position: relative;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
transition: 0.3s ease;
|
|
170
|
+
color: #faf8ec;
|
|
171
|
+
}
|
|
172
|
+
.checkbox-wrapper input[type='checkbox']:checked + label:before {
|
|
173
|
+
left: 31px;
|
|
174
|
+
}
|
|
175
|
+
.checkbox-wrapper label:before {
|
|
176
|
+
transition: 0.3s ease;
|
|
177
|
+
content: '';
|
|
178
|
+
width: 28px;
|
|
179
|
+
height: 28px;
|
|
180
|
+
position: absolute;
|
|
181
|
+
background: #faf8ec;
|
|
182
|
+
left: 3px;
|
|
183
|
+
top: 3px;
|
|
184
|
+
box-sizing: border-box;
|
|
185
|
+
color: black;
|
|
186
|
+
border-radius: 50%;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ingredients-wrapper {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
gap: core-functions-v3.fluidSize(30);
|
|
195
|
+
|
|
196
|
+
img {
|
|
197
|
+
max-width: 100px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ingredient-text {
|
|
201
|
+
font-size: core-functions-v3.fontSize(22);
|
|
202
|
+
font-family: var(--tertiary-font-family);
|
|
203
|
+
font-weight: 400;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&__equipment-container {
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
gap: core-functions-v3.fluidSize(20);
|
|
211
|
+
padding-bottom: core-functions-v3.fluidSize(180);
|
|
212
|
+
|
|
213
|
+
.equipments-title {
|
|
214
|
+
font-family: var(--secondary-font-family);
|
|
215
|
+
font-size: core-functions-v3.fontSize(26);
|
|
216
|
+
font-weight: 500;
|
|
217
|
+
padding-block: core-functions-v3.fluidSize(10);
|
|
218
|
+
border-bottom: 1px solid #faf8ec4d;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.equipments-wrapper {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: core-functions-v3.fluidSize(30);
|
|
225
|
+
|
|
226
|
+
img {
|
|
227
|
+
max-width: 100px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.equipments-text {
|
|
231
|
+
font-family: var(--tertiary-font-family);
|
|
232
|
+
font-size: core-functions-v3.fontSize(22);
|
|
233
|
+
font-weight: 400;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&__instructions-container {
|
|
239
|
+
.instructions-title {
|
|
240
|
+
font-family: var(--primary-font-family);
|
|
241
|
+
font-size: core-functions-v3.fontSize(160);
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
text-transform: uppercase;
|
|
244
|
+
padding-block: core-functions-v3.fluidSize(40);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.instructions-wrapper {
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
gap: core-functions-v3.fluidSize(40);
|
|
251
|
+
padding-block: core-functions-v3.fluidSize(30);
|
|
252
|
+
border-top: 1px solid #faf8ec4d;
|
|
253
|
+
|
|
254
|
+
.instructions-number {
|
|
255
|
+
font-family: var(--secondary-font-family);
|
|
256
|
+
font-size: core-functions-v3.fontSize(30);
|
|
257
|
+
font-weight: 500;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.instructions-text {
|
|
261
|
+
font-family: var(--tertiary-font-family);
|
|
262
|
+
font-size: core-functions-v3.fontSize(30);
|
|
263
|
+
font-weight: 300;
|
|
264
|
+
text-box-trim: trim-both;
|
|
265
|
+
text-box-edge: cap alphabetic;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{% set blockClassName = "cocktail-recipe-v3" %}
|
|
2
|
+
{% set classNameEntryPoint = include('entry-points/entry-point-classes.twig', { fields: fields, block: block }, with_context = false) %}
|
|
3
|
+
{% set htmlEntryPoint = include('entry-points/entry-point-html-v3.twig', { fields: fields, block: block, blockClassName, blockClassName }, with_context = false) %}
|
|
4
|
+
{% set dataAttributeEntryPoint = include('entry-points/entry-point-data-attribute.twig', { fields: fields, block: block }, with_context = false) %}
|
|
5
|
+
{% set styleEntryPoint = include('entry-points/entry-point-style-v3.twig', { fields: fields, block: block, is_preview }, with_context = false) %}
|
|
6
|
+
{% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
|
|
7
|
+
{% set sectionStyles = styleEntryPoint %}
|
|
8
|
+
{{previewEntryPoint}}
|
|
9
|
+
|
|
10
|
+
{% set selectedPost = Post(fields.cocktail_select) %}
|
|
11
|
+
{% set ingredients = selectedPost.meta('ingredients_recipe') %}
|
|
12
|
+
{% set equipments = selectedPost.meta('other_equipment') %}
|
|
13
|
+
{% set instructions = selectedPost.meta('instruction_steps') %}
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.{{blockClassName}}.{{block.id}}{
|
|
17
|
+
{{sectionStyles}}
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
<section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{block.className}} {{loop ? block.className.index ~ '-' ~ loop.index : ''}} {{classNameEntryPoint}} {{block.id}} " {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
|
|
21
|
+
{{htmlEntryPoint}}
|
|
22
|
+
|
|
23
|
+
<div class="{{blockClassName}}__ingredients-container">
|
|
24
|
+
<h1 class="ingredients-title">{{ selectedPost.ingredients_title }}</h1>
|
|
25
|
+
|
|
26
|
+
<div class="{{blockClassName}}__servings" data-servings-controls>
|
|
27
|
+
<h3 class="servings-title">Serve:</h3>
|
|
28
|
+
<div class="servings-control-wrapper">
|
|
29
|
+
<div class="dec-btn-wrapper">
|
|
30
|
+
<button type="button" class="servings-dec-btn" data-servings-dec aria-label="Decrease servings">-</button>
|
|
31
|
+
</div>
|
|
32
|
+
<span class="servings-current" data-servings-value>1x</span>
|
|
33
|
+
<div class="inc-btn-wrapper">
|
|
34
|
+
<button type="button" class="servings-inc-btn" data-servings-inc aria-label="Increase servings">+</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
{% if fields.enable_unit_transform %}
|
|
40
|
+
<div class="{{blockClassName}}__unit-toggle" data-unit-toggle>
|
|
41
|
+
<p class="unit-label unit-text">Unit</p>
|
|
42
|
+
<div class="unit-toggle-wrapper">
|
|
43
|
+
<span class="unit-option unit-text" data-unit="ml">ml</span>
|
|
44
|
+
<div class="checkbox-wrapper">
|
|
45
|
+
<div class="block">
|
|
46
|
+
<input data-index="0" id="checkbox" data-unit-checkbox type="checkbox"/>
|
|
47
|
+
<label for="checkbox"></label>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<span class="unit-option unit-text" data-unit="{{ fields.unit_transform }}">{{ fields.unit_transform }}</span>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
{% endif %}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
{% for ingredient in ingredients %}
|
|
57
|
+
<div class="ingredients-wrapper">
|
|
58
|
+
<img src="{{ get_image(ingredient.ingredient_image) }}" width="20">
|
|
59
|
+
<p class="ingredient-text" data-ingredients data-amount="{{ ingredient.amount }}" data-unit="{{ ingredient.default_unit }}" data-name="{{ ingredient.name }}">{{ ingredient.amount }}{{ ingredient.default_unit }}
|
|
60
|
+
{{ ingredient.name }}</p>
|
|
61
|
+
</div>
|
|
62
|
+
{% endfor %}
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
{% if selectedPost.enable_equipment %}
|
|
66
|
+
<div class="{{blockClassName}}__equipment-container">
|
|
67
|
+
<h3 class="equipments-title">{{ selectedPost.equipment_title }}</h3>
|
|
68
|
+
|
|
69
|
+
{% for equipment in equipments %}
|
|
70
|
+
<div class="equipments-wrapper">
|
|
71
|
+
<img src="{{ get_image(equipment.equipment_image) }}" width="20">
|
|
72
|
+
<p class="equipments-text">{{ equipment.equipment_name }}</p>
|
|
73
|
+
</div>
|
|
74
|
+
{% endfor %}
|
|
75
|
+
</div>
|
|
76
|
+
{% endif %}
|
|
77
|
+
|
|
78
|
+
<div class="{{blockClassName}}__instructions-container">
|
|
79
|
+
<h1 class="instructions-title">{{ selectedPost.instructions_title }}</h1>
|
|
80
|
+
|
|
81
|
+
{% for index, instruction in instructions %}
|
|
82
|
+
<div class="instructions-wrapper">
|
|
83
|
+
<span class="instructions-number">{{index + 1}}</span>
|
|
84
|
+
<p class="instructions-text">{{ instruction.instruction }}</p>
|
|
85
|
+
</div>
|
|
86
|
+
{% endfor %}
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
</section>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "group_68fff19fa4dd0",
|
|
3
|
+
"title": "Block: Cocktail Recipe V3",
|
|
4
|
+
"fields": [
|
|
5
|
+
{
|
|
6
|
+
"key": "field_68fff1a0c8ae0",
|
|
7
|
+
"label": "Content",
|
|
8
|
+
"name": "",
|
|
9
|
+
"aria-label": "",
|
|
10
|
+
"type": "tab",
|
|
11
|
+
"instructions": "",
|
|
12
|
+
"required": 0,
|
|
13
|
+
"conditional_logic": 0,
|
|
14
|
+
"wrapper": {
|
|
15
|
+
"width": "",
|
|
16
|
+
"class": "",
|
|
17
|
+
"id": ""
|
|
18
|
+
},
|
|
19
|
+
"wpml_cf_preferences": 3,
|
|
20
|
+
"placement": "top",
|
|
21
|
+
"endpoint": 0,
|
|
22
|
+
"no_preference": 0,
|
|
23
|
+
"selected": 0
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"key": "field_6900985627b79",
|
|
27
|
+
"label": "Cocktail Select",
|
|
28
|
+
"name": "cocktail_select",
|
|
29
|
+
"aria-label": "",
|
|
30
|
+
"type": "post_object",
|
|
31
|
+
"instructions": "",
|
|
32
|
+
"required": 0,
|
|
33
|
+
"conditional_logic": 0,
|
|
34
|
+
"wrapper": {
|
|
35
|
+
"width": "",
|
|
36
|
+
"class": "",
|
|
37
|
+
"id": ""
|
|
38
|
+
},
|
|
39
|
+
"wpml_cf_preferences": 3,
|
|
40
|
+
"post_type": [
|
|
41
|
+
"cocktail"
|
|
42
|
+
],
|
|
43
|
+
"post_status": "",
|
|
44
|
+
"taxonomy": "",
|
|
45
|
+
"return_format": "object",
|
|
46
|
+
"multiple": 0,
|
|
47
|
+
"max": "",
|
|
48
|
+
"save_custom": 0,
|
|
49
|
+
"save_post_status": "publish",
|
|
50
|
+
"acfe_add_post": 0,
|
|
51
|
+
"acfe_edit_post": 0,
|
|
52
|
+
"acfe_bidirectional": {
|
|
53
|
+
"acfe_bidirectional_enabled": "0"
|
|
54
|
+
},
|
|
55
|
+
"allow_null": 0,
|
|
56
|
+
"bidirectional": 0,
|
|
57
|
+
"ui": 1,
|
|
58
|
+
"bidirectional_target": [],
|
|
59
|
+
"save_post_type": "",
|
|
60
|
+
"min": ""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"key": "field_6904e13661b9e",
|
|
64
|
+
"label": "Enable Unit Transform",
|
|
65
|
+
"name": "enable_unit_transform",
|
|
66
|
+
"aria-label": "",
|
|
67
|
+
"type": "true_false",
|
|
68
|
+
"instructions": "",
|
|
69
|
+
"required": 0,
|
|
70
|
+
"conditional_logic": 0,
|
|
71
|
+
"wrapper": {
|
|
72
|
+
"width": "",
|
|
73
|
+
"class": "",
|
|
74
|
+
"id": ""
|
|
75
|
+
},
|
|
76
|
+
"wpml_cf_preferences": 0,
|
|
77
|
+
"message": "",
|
|
78
|
+
"default_value": 0,
|
|
79
|
+
"ui_on_text": "",
|
|
80
|
+
"ui_off_text": "",
|
|
81
|
+
"ui": 1,
|
|
82
|
+
"style": ""
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "field_6903a0595a265",
|
|
86
|
+
"label": "Unit Transform",
|
|
87
|
+
"name": "unit_transform",
|
|
88
|
+
"aria-label": "",
|
|
89
|
+
"type": "select",
|
|
90
|
+
"instructions": "",
|
|
91
|
+
"required": 0,
|
|
92
|
+
"conditional_logic": [
|
|
93
|
+
[
|
|
94
|
+
{
|
|
95
|
+
"field": "field_6904e13661b9e",
|
|
96
|
+
"operator": "==",
|
|
97
|
+
"value": "1"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
],
|
|
101
|
+
"wrapper": {
|
|
102
|
+
"width": "",
|
|
103
|
+
"class": "",
|
|
104
|
+
"id": ""
|
|
105
|
+
},
|
|
106
|
+
"wpml_cf_preferences": 3,
|
|
107
|
+
"choices": {
|
|
108
|
+
"oz": "OZ"
|
|
109
|
+
},
|
|
110
|
+
"default_value": "oz",
|
|
111
|
+
"return_format": "value",
|
|
112
|
+
"multiple": 0,
|
|
113
|
+
"max": "",
|
|
114
|
+
"prepend": "",
|
|
115
|
+
"append": "",
|
|
116
|
+
"allow_null": 0,
|
|
117
|
+
"ui": 0,
|
|
118
|
+
"ajax": 0,
|
|
119
|
+
"placeholder": "",
|
|
120
|
+
"allow_custom": 0,
|
|
121
|
+
"search_placeholder": "",
|
|
122
|
+
"min": ""
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"key": "field_68fff1cac8ae1",
|
|
126
|
+
"label": "Block Padding",
|
|
127
|
+
"name": "",
|
|
128
|
+
"aria-label": "",
|
|
129
|
+
"type": "tab",
|
|
130
|
+
"instructions": "",
|
|
131
|
+
"required": 0,
|
|
132
|
+
"conditional_logic": 0,
|
|
133
|
+
"wrapper": {
|
|
134
|
+
"width": "",
|
|
135
|
+
"class": "",
|
|
136
|
+
"id": ""
|
|
137
|
+
},
|
|
138
|
+
"wpml_cf_preferences": 3,
|
|
139
|
+
"placement": "top",
|
|
140
|
+
"endpoint": 0,
|
|
141
|
+
"no_preference": 0,
|
|
142
|
+
"selected": 0
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"key": "field_68fff1d4c8ae2",
|
|
146
|
+
"label": "Block Padding Fields",
|
|
147
|
+
"name": "block_padding_fields",
|
|
148
|
+
"aria-label": "",
|
|
149
|
+
"type": "clone",
|
|
150
|
+
"instructions": "",
|
|
151
|
+
"required": 0,
|
|
152
|
+
"conditional_logic": 0,
|
|
153
|
+
"wrapper": {
|
|
154
|
+
"width": "",
|
|
155
|
+
"class": "",
|
|
156
|
+
"id": ""
|
|
157
|
+
},
|
|
158
|
+
"wpml_cf_preferences": 3,
|
|
159
|
+
"clone": [
|
|
160
|
+
"group_689f66f3e26df"
|
|
161
|
+
],
|
|
162
|
+
"display": "seamless",
|
|
163
|
+
"layout": "block",
|
|
164
|
+
"prefix_label": 0,
|
|
165
|
+
"prefix_name": 0,
|
|
166
|
+
"acfe_seamless_style": 0,
|
|
167
|
+
"acfe_clone_modal": 0,
|
|
168
|
+
"acfe_clone_modal_close": 0,
|
|
169
|
+
"acfe_clone_modal_button": "",
|
|
170
|
+
"acfe_clone_modal_size": "large"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"location": [
|
|
174
|
+
[
|
|
175
|
+
{
|
|
176
|
+
"param": "block",
|
|
177
|
+
"operator": "==",
|
|
178
|
+
"value": "acf\/cocktail-recipe-v3"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
],
|
|
182
|
+
"menu_order": 0,
|
|
183
|
+
"position": "normal",
|
|
184
|
+
"style": "default",
|
|
185
|
+
"label_placement": "left",
|
|
186
|
+
"instruction_placement": "label",
|
|
187
|
+
"hide_on_screen": "",
|
|
188
|
+
"active": true,
|
|
189
|
+
"description": "",
|
|
190
|
+
"show_in_rest": 0,
|
|
191
|
+
"acfe_autosync": [
|
|
192
|
+
"json"
|
|
193
|
+
],
|
|
194
|
+
"acfml_field_group_mode": "localization",
|
|
195
|
+
"acfe_form": 0,
|
|
196
|
+
"acfe_display_title": "",
|
|
197
|
+
"acfe_meta": "",
|
|
198
|
+
"acfe_note": "",
|
|
199
|
+
"modified": 1761927501
|
|
200
|
+
}
|