This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Components/BlockImage): add component (#182)
* feat(Components/BlockImage): added baseComponent * docs(Components/BlockImage): changed category * refactor(Components/BlockImage): added resized img default src * docs(Components/BlockImage): removed howto
- Loading branch information
1 parent
355188b
commit 3db3b60
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Title: Block Image | ||
|
||
---- | ||
|
||
Category: Block | ||
|
||
---- | ||
|
||
Tags: block, image | ||
|
||
---- | ||
|
||
Text: Full width image component. Upload an image that takes full width. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"layout": { | ||
"name": "BlockImage", | ||
"label": "Block: Image", | ||
"sub_fields": [ | ||
{ | ||
"label": "Image", | ||
"name": "image", | ||
"type": "image", | ||
"instructions": "Recommended Size: Min-Width 1440px; Min-Height: 720px; Image-Format: JPG", | ||
"min_width": 1440, | ||
"min_height": 720, | ||
"mime_types": "jpg,jpeg", | ||
"required": 1 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Flynt\Components\BlockImage; | ||
|
||
use Flynt\Features\Components\Component; | ||
|
||
add_action('wp_enqueue_scripts', function () { | ||
Component::enqueueAssets('BlockImage'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div is="flynt-block-image" class="flyntComponent"> | ||
<div class="blockImage"> | ||
<img class="blockImage-imageElement" srcset=" | ||
{{ image.src | resize(576, 288) }} 576w, | ||
{{ image.src | resize(768, 384) }} 768w, | ||
{{ image.src | resize(1200, 600) }} 1200w, | ||
{{ image.src | resize(1440, 720) }} 1440w" | ||
src="{{ image.src | resize(1200, 600) }}" | ||
sizes="(min-width: 1140px) 1140px, 100vw" | ||
alt="{{ image.alt }}"> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$rupture.scale = lookup('$global-layout-scale') || (0 576px 768px 992px 1200px) | ||
$rupture.anti-overlap = lookup('$global-layout-overlap') || -1px | ||
$gutterWidth = lookup('$global-layout-gutterWidth') || 15px | ||
$containerMaxWidth = lookup('$global-layout-containerMaxWidth') || 1140px | ||
|
||
[is='flynt-block-image'] | ||
*, | ||
*:before, | ||
*:after | ||
box-sizing: border-box | ||
|
||
.blockImage | ||
center($containerMaxWidth, $gutterWidth) | ||
|
||
&-imageContainer | ||
display: block | ||
width: 100% | ||
|
||
&-imageElement | ||
display: block | ||
height: auto | ||
max-width: 100% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters