Skip to content

Commit

Permalink
First very basic working version
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Jul 17, 2024
1 parent 556aed5 commit 0ad0dee
Show file tree
Hide file tree
Showing 19 changed files with 280 additions and 167 deletions.
7 changes: 3 additions & 4 deletions marquee/build/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@
"justifyContent": "left"
}
},
"interactivity": {
"clientNavigation": true
}
"interactivity": true
},
"allowedBlocks": [
"core/paragraph",
Expand All @@ -103,5 +101,6 @@
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
"render": "file:./render.php",
"viewScriptModule": "file:./view.js"
}
2 changes: 1 addition & 1 deletion marquee/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-element'), 'version' => '4e89a2d734fd7167347a');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-element'), 'version' => 'c8334640ad7b9b1b92c6');
79 changes: 4 additions & 75 deletions marquee/build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion marquee/build/index.js.map

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions marquee/build/render.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
$inner_blocks = $block->inner_blocks;
$inner_blocks_html = '';
foreach ($inner_blocks as $inner_block) {
$inner_blocks_html .= $inner_block->render();
}
?>

<div
data-wp-interactive="wpcomsp/marquee"
data-wp-init="callbacks.init"
>
<div <?php echo get_block_wrapper_attributes(array( "class" => 'wp-block-wpcomsp-marquee__inner')); ?>>
<?php echo $inner_blocks_html; ?>
</div>
</div>
17 changes: 11 additions & 6 deletions marquee/build/style-index-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
position: relative;
}

[data-wp-interactive="wpcomsp/marquee"] {
overflow: clip;
display: flex;
flex-direction: row;
}

.wp-block-wpcomsp-marquee__inner {
animation: wpcomsp-marquee var(--speed) linear infinite var(--direction);
min-width: 100%;
}

@keyframes wpcomsp-marquee {
0% {
transform: translateX(0);
Expand All @@ -19,9 +30,3 @@
transform: translateX(100%);
}
}
.wp-block-wpcomsp-marquee__inner {
animation: wpcomsp-marquee var(--speed) linear infinite var(--direction);
display: flex;
overflow: hidden;
flex-wrap: nowrap;
}
17 changes: 11 additions & 6 deletions marquee/build/style-index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion marquee/build/style-index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion marquee/build/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '9618df91ea3d5989c295');
<?php return array('dependencies' => array('@wordpress/interactivity'), 'version' => 'd4187ecd923728b96fa5', 'type' => 'module');
71 changes: 68 additions & 3 deletions marquee/build/view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions marquee/build/view.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0ad0dee

Please sign in to comment.