-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Document): Added document image crop alignment control
- Loading branch information
1 parent
970d4c6
commit 51e2cdb
Showing
15 changed files
with
139 additions
and
6 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
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
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
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,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Themes\Rozier\Forms; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
final class ImageCropAlignmentType extends AbstractType | ||
{ | ||
public function configureOptions(OptionsResolver $resolver): void | ||
{ | ||
$resolver->setDefaults([ | ||
'label' => 'image_crop_alignment', | ||
'required' => false, | ||
'placeholder' => 'image_crop_alignment.none', | ||
'expanded' => true, | ||
'choices' => [ | ||
'image_crop_alignment.top-left' => 'top-left', | ||
'image_crop_alignment.top' => 'top', | ||
'image_crop_alignment.top-right' => 'top-right', | ||
'image_crop_alignment.left' => 'left', | ||
'image_crop_alignment.center' => 'center', | ||
'image_crop_alignment.right' => 'right', | ||
'image_crop_alignment.bottom-left' => 'bottom-left', | ||
'image_crop_alignment.bottom' => 'bottom', | ||
'image_crop_alignment.bottom-right' => 'bottom-right', | ||
] | ||
]); | ||
} | ||
|
||
public function getBlockPrefix(): string | ||
{ | ||
return 'image_crop_alignment'; | ||
} | ||
|
||
|
||
public function getParent(): string | ||
{ | ||
return ChoiceType::class; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
lib/Rozier/src/Resources/app/less/forms/crop-alignment.less
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,38 @@ | ||
|
||
.image-crop-alignments { | ||
max-width: 200px; | ||
border: 1px solid rgba(0, 0, 0, 0.08); | ||
padding: 1em; | ||
|
||
&__grid { | ||
display: grid; | ||
aspect-ratio: 4 / 3; | ||
grid-template-columns: repeat(3, 1fr); | ||
grid-template-rows: repeat(3, 1fr); | ||
grid-gap: 2px; | ||
margin: 1em 0; | ||
align-items: center; | ||
justify-items: center; | ||
border: none; | ||
|
||
.uk-form-label, | ||
label { | ||
display: none !important; | ||
} | ||
|
||
input[type=radio] { | ||
margin-left: 0 !important; | ||
border: none; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 0; | ||
|
||
&:checked:before { | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 0; | ||
margin: 0; | ||
} | ||
} | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
<script src="{{ asset('js/vendor.0a3de8e7bfaf93c96811.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
<script src="{{ asset('js/vendor.12bd9afa9e8697bea044.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
|
||
<script src="{{ asset('js/app.0a3de8e7bfaf93c96811.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
<script src="{{ asset('js/app.12bd9afa9e8697bea044.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
|
2 changes: 1 addition & 1 deletion
2
lib/Rozier/src/Resources/views/partials/simple-js-inject.html.twig
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
<script src="{{ asset('js/simple.0a3de8e7bfaf93c96811.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
<script src="{{ asset('js/simple.12bd9afa9e8697bea044.js', 'Rozier') }}" defer type="text/javascript"></script> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.