Skip to content

Commit

Permalink
fix: remove manually entered focus point
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Sep 30, 2024
1 parent 0e2b30c commit cd6a564
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
32 changes: 1 addition & 31 deletions source/php/Component/Slider__item/Slider__item.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public function init() {
$this->data['classList'][] = $this->getBaseClass() . "--layout-" . $layout;
}

/*if (!empty($desktop_image)) {
$this->data['attributeList']['style'] = "background-image: url('".$desktop_image."');";
}*/

$this->data['showContainer'] = false;
if (!empty($title) || !empty($subTitle) ||!empty($text) || !empty($bottom)) {
$this->data['showContainer'] = true;
Expand All @@ -43,37 +39,11 @@ public function init() {
}

if (!empty($alt) && empty($altMobile)) {
$this->data['altMobile'] = $alt;
$this->data['alt'] = $alt;
}

if ($heroStyle) {
$this->data['classList'][] = $this->getBaseClass() . "--hero";
}


//Recognize as an image
if(!$video) {
$this->data['attributeList']['aria-label'] = $alt ? $alt : '';
$this->data['attributeList']['aria-labeledby'] = $this->getUid() . '__heading';
}
/*
if(!empty($focusPoint)) {
//Create image style tag
$this->data['imageStyle'] = [];
//Add image to image styles
if($image) {
$this->data['imageStyle']['background-image'] = "url('" . $desktop_image . "')";
}
//Add background position to image styles
if(is_array($focusPoint) && array_filter($focusPoint)) {
$this->data['imageStyle']['background-position'] = $focusPoint['left'] . "% " . $focusPoint['top'] . "%";
}
//Stringify image styles
$this->data['attributeList']['style'] = self::buildInlineStyle($this->data['imageStyle']);
}*/
}
}
3 changes: 0 additions & 3 deletions source/php/Component/Slider__item/slider__item.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"image": false,
"video": false,
"alt": "",
"focusPoint": {"top": 30, "left": 50},
"link": false,
"linkDescription": "",
"layout": "bottom",
Expand All @@ -26,7 +25,6 @@
"image": "An url or path to an image to use as background for the segment",
"video": "A video background for the segment",
"alt": "Alternative text",
"focusPoint": "Where the focus point should be of an image when container dosen't match image ratio.",
"link": "Where the slide should link to",
"linkDescription": "A description of the link",
"layout": "Which layouts to use",
Expand All @@ -45,7 +43,6 @@
"image": "boolean|string|ImageInterface",
"video": "boolean|string",
"alt": "string",
"focusPoint": "array",
"link": "string|boolean",
"linkDescription": "string",
"layout": "string",
Expand Down
3 changes: 1 addition & 2 deletions source/php/Component/Slider__item/sub/image.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@image([
'src' => $image,
'alt' => $alt,
//'classList' => $classListDesktop,
'alt' => $alt ?? false,
'cover' => true,
'context' => ['component.slider', 'component.slider.image']
])
Expand Down

0 comments on commit cd6a564

Please sign in to comment.