040c63f8 by Jeff Balicki

wall

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 3374e4e0
1 <?php
2
3 /**
4 * Wall Block Template.
5 *
6 * @param array $block The block settings and attributes.
7 * @param string $content The block inner HTML (empty).
8 * @param bool $is_preview True during AJAX preview.
9 * @param (int|string) $post_id The post ID this block is saved to.
10 */
11
12 ?>
13 <button class="toggle" id="direction-toggle">
14 <span>Toggle scroll axis</span>
15 <svg aria-hidden="true" viewBox="0 0 512 512" width="100" title="arrows-alt-h">
16 <path d="M377.941 169.941V216H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.568 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296h243.882v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.568 0-33.941l-86.059-86.059c-15.119-15.12-40.971-4.412-40.971 16.97z" />
17 </svg>
18 </button>
19 <?php if( have_rows('wall') ): ?>
20 <?php $rowCount = count( get_field('wall') );
21 $dir = get_field('direction');
22 if( $dir == 'right'){
23 $marquee = 'marquee--reverse';
24 } ?>
25
26
27 <article class="wrapper">
28 <div class="marquee <?php echo $marquee; ?>">
29 <div class="marquee__group">
30 <?php while( the_repeater_field('wall') ): ?>
31 <?php $image = get_sub_field('image'); ?>
32
33 <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
34
35 <?php endwhile; ?>
36 </div>
37 <div aria-hidden="true" class="marquee__group <?php echo $marquee; ?>">
38 <?php while( the_repeater_field('wall') ): ?>
39 <?php $image = get_sub_field('image'); ?>
40
41 <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
42
43 <?php endwhile; ?>
44 </div>
45 </div>
46 </div>
47
48
49 <?php endif; ?>
50
...@@ -16331,4 +16331,166 @@ body.understrap-no-sidebar .wp-block-cover.alignwide { ...@@ -16331,4 +16331,166 @@ body.understrap-no-sidebar .wp-block-cover.alignwide {
16331 padding: 0px; 16331 padding: 0px;
16332 } 16332 }
16333 16333
16334 :root {
16335 --color-text: navy;
16336 --color-bg: papayawhip;
16337 --color-bg-accent: #ecdcc0;
16338 --size: clamp(10rem, 1rem + 40vmin, 30rem);
16339 --gap: calc(var(--size) / 14);
16340 --duration: 60s;
16341 --scroll-start: 0;
16342 --scroll-end: calc(-100% - var(--gap));
16343 }
16344
16345 @media (prefers-color-scheme: dark) {
16346 :root {
16347 --color-text: #fff;
16348 --color-bg: fff;
16349 --color-bg-accent: #fff;
16350 }
16351 }
16352 .marquee {
16353 display: flex;
16354 overflow: hidden;
16355 -webkit-user-select: none;
16356 -moz-user-select: none;
16357 user-select: none;
16358 gap: var(--gap);
16359 margin-right: -25%;
16360 margin-left: -25%;
16361 }
16362
16363 .marquee__group {
16364 flex-shrink: 0;
16365 display: flex;
16366 align-items: center;
16367 justify-content: space-around;
16368 gap: var(--gap);
16369 min-width: 100%;
16370 animation: scroll-x var(--duration) linear infinite;
16371 }
16372
16373 @media (prefers-reduced-motion: reduce) {
16374 .marquee__group {
16375 animation-play-state: paused;
16376 }
16377 }
16378 .marquee--vertical {
16379 --mask-direction: to bottom;
16380 }
16381
16382 .marquee--vertical,
16383 .marquee--vertical .marquee__group {
16384 flex-direction: column;
16385 }
16386
16387 .marquee--vertical .marquee__group {
16388 animation-name: scroll-y;
16389 }
16390
16391 .marquee--reverse .marquee__group {
16392 animation-direction: reverse;
16393 animation-delay: -3s;
16394 }
16395
16396 @keyframes scroll-x {
16397 from {
16398 transform: translateX(var(--scroll-start));
16399 }
16400 to {
16401 transform: translateX(var(--scroll-end));
16402 }
16403 }
16404 @keyframes scroll-y {
16405 from {
16406 transform: translateY(var(--scroll-start));
16407 }
16408 to {
16409 transform: translateY(var(--scroll-end));
16410 }
16411 }
16412 /* Element styles */
16413 .marquee img {
16414 display: grid;
16415 place-items: center;
16416 width: auto;
16417 border-radius: 0;
16418 }
16419
16420 /* Parent wrapper */
16421 .wrapper {
16422 display: flex;
16423 flex-direction: column;
16424 gap: var(--gap);
16425 margin: auto;
16426 max-width: 100vw;
16427 }
16428
16429 .wrapper--vertical {
16430 flex-direction: row;
16431 height: 100vh;
16432 }
16433
16434 /* Toggle direction button */
16435 .toggle {
16436 --size: 3rem;
16437 position: relative;
16438 position: fixed;
16439 top: 1rem;
16440 left: 1rem;
16441 width: var(--size);
16442 height: var(--size);
16443 font: inherit;
16444 text-align: center;
16445 cursor: pointer;
16446 outline: none;
16447 border: none;
16448 border-radius: 50%;
16449 color: inherit;
16450 background-color: var(--color-bg-accent);
16451 z-index: 1;
16452 }
16453
16454 .toggle:focus-visible {
16455 box-shadow: 0 0 0 2px var(--color-text);
16456 }
16457
16458 .toggle span {
16459 position: absolute;
16460 display: inline-block;
16461 top: 50%;
16462 left: calc(100% + 0.4em);
16463 width: -moz-fit-content;
16464 width: fit-content;
16465 white-space: nowrap;
16466 transform: translateY(-50%);
16467 animation: fade 400ms 4s ease-out forwards;
16468 -webkit-user-select: none;
16469 -moz-user-select: none;
16470 user-select: none;
16471 }
16472
16473 .toggle svg {
16474 --size: 1.5rem;
16475 position: absolute;
16476 top: 50%;
16477 left: 50%;
16478 width: var(--size);
16479 height: var(--size);
16480 fill: currentcolor;
16481 transform: translate(-50%, -50%);
16482 transition: transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
16483 }
16484
16485 .toggle--vertical svg {
16486 transform: translate(-50%, -50%) rotate(-90deg);
16487 }
16488
16489 @keyframes fade {
16490 to {
16491 opacity: 0;
16492 visibility: hidden;
16493 }
16494 }
16495
16334 /*# sourceMappingURL=child-theme.css.map */ 16496 /*# sourceMappingURL=child-theme.css.map */
...\ No newline at end of file ...\ No newline at end of file
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -23,5 +23,17 @@ function my_acf_init_block_types() { ...@@ -23,5 +23,17 @@ function my_acf_init_block_types() {
23 ] 23 ]
24 )); 24 ));
25 25
26 acf_register_block_type( array(
27 'title' => __( 'Wall', 'client_textdomain' ),
28 'name' => 'wall',
29 'render_template' => 'blocks/wall/wall.php',
30 'mode' => 'edit',
31 'supports' => [
32 'align' => false,
33 'anchor' => true,
34 'customClassName' => true
35 ]
36 ));
37
26 } 38 }
27 } 39 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17136,6 +17136,10 @@ ...@@ -17136,6 +17136,10 @@
17136 17136
17137 // window.requestAnimationFrame(scrollPlay); 17137 // window.requestAnimationFrame(scrollPlay);
17138 17138
17139 /*
17140 JS to toggle scroll axis styles
17141 */
17142
17139 exports.Alert = alert; 17143 exports.Alert = alert;
17140 exports.Button = button; 17144 exports.Button = button;
17141 exports.Carousel = carousel; 17145 exports.Carousel = carousel;
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -182,7 +182,6 @@ function numberWithCommas(x) { ...@@ -182,7 +182,6 @@ function numberWithCommas(x) {
182 182
183 183
184 184
185
186 }); 185 });
187 186
188 ScrollTrigger.refresh(); 187 ScrollTrigger.refresh();
...@@ -212,3 +211,8 @@ ScrollTrigger.refresh(); ...@@ -212,3 +211,8 @@ ScrollTrigger.refresh();
212 211
213 212
214 213
214 /*
215 JS to toggle scroll axis styles
216 */
217
218
......
...@@ -16,4 +16,5 @@ ...@@ -16,4 +16,5 @@
16 @import "theme/body"; 16 @import "theme/body";
17 @import "theme/footer"; 17 @import "theme/footer";
18 @import "theme/tabs"; 18 @import "theme/tabs";
19 @import "theme/tiles";
...\ No newline at end of file ...\ No newline at end of file
19 @import "theme/tiles";
20 @import "theme/wall";
...\ No newline at end of file ...\ No newline at end of file
......
1 :root {
2 --color-text: navy;
3 --color-bg: papayawhip;
4 --color-bg-accent: #ecdcc0;
5 --size: clamp(10rem, 1rem + 40vmin, 30rem);
6 --gap: calc(var(--size) / 14);
7 --duration: 60s;
8 --scroll-start: 0;
9 --scroll-end: calc(-100% - var(--gap));
10 }
11
12 @media (prefers-color-scheme: dark) {
13 :root {
14 --color-text: #fff;
15 --color-bg: fff;
16 --color-bg-accent: #fff;
17 }
18 }
19
20
21 .marquee {
22 display: flex;
23 overflow: hidden;
24 user-select: none;
25 gap: var(--gap);
26 margin-right: -25%;
27 margin-left: -25%;
28
29
30 }
31
32 .marquee__group {
33 flex-shrink: 0;
34 display: flex;
35 align-items: center;
36 justify-content: space-around;
37 gap: var(--gap);
38 min-width: 100%;
39 animation: scroll-x var(--duration) linear infinite;
40 }
41
42 @media (prefers-reduced-motion: reduce) {
43 .marquee__group {
44 animation-play-state: paused;
45 }
46 }
47
48 .marquee--vertical {
49 --mask-direction: to bottom;
50 }
51
52 .marquee--vertical,
53 .marquee--vertical .marquee__group {
54 flex-direction: column;
55 }
56
57 .marquee--vertical .marquee__group {
58 animation-name: scroll-y;
59 }
60
61 .marquee--reverse .marquee__group {
62 animation-direction: reverse;
63 animation-delay: -3s;
64 }
65
66 @keyframes scroll-x {
67 from {
68 transform: translateX(var(--scroll-start));
69 }
70 to {
71 transform: translateX(var(--scroll-end));
72 }
73 }
74
75 @keyframes scroll-y {
76 from {
77 transform: translateY(var(--scroll-start));
78 }
79 to {
80 transform: translateY(var(--scroll-end));
81 }
82 }
83
84 /* Element styles */
85 .marquee img {
86 display: grid;
87 place-items: center;
88 width: auto;
89 border-radius: 0;
90 }
91
92 .marquee--vertical img {
93
94 }
95
96 /* Parent wrapper */
97 .wrapper {
98 display: flex;
99 flex-direction: column;
100 gap: var(--gap);
101 margin: auto;
102 max-width: 100vw;
103 }
104
105 .wrapper--vertical {
106 flex-direction: row;
107 height: 100vh;
108 }
109
110 /* Toggle direction button */
111 .toggle {
112 --size: 3rem;
113 position: relative;
114 position: fixed;
115 top: 1rem;
116 left: 1rem;
117 width: var(--size);
118 height: var(--size);
119 font: inherit;
120 text-align: center;
121 cursor: pointer;
122 outline: none;
123 border: none;
124 border-radius: 50%;
125 color: inherit;
126 background-color: var(--color-bg-accent);
127 z-index: 1;
128 }
129
130 .toggle:focus-visible {
131 box-shadow: 0 0 0 2px var(--color-text);
132 }
133
134 .toggle span {
135 position: absolute;
136 display: inline-block;
137 top: 50%;
138 left: calc(100% + 0.4em);
139 width: fit-content;
140 white-space: nowrap;
141 transform: translateY(-50%);
142 animation: fade 400ms 4s ease-out forwards;
143 user-select: none;
144 }
145
146 .toggle svg {
147 --size: 1.5rem;
148 position: absolute;
149 top: 50%;
150 left: 50%;
151 width: var(--size);
152 height: var(--size);
153 fill: currentcolor;
154 transform: translate(-50%, -50%);
155 transition: transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
156 }
157
158 .toggle--vertical svg {
159 transform: translate(-50%, -50%) rotate(-90deg);
160 }
161
162 @keyframes fade {
163 to {
164 opacity: 0;
165 visibility: hidden;
166 }
167 }