81 lines
2.7 KiB
PHP
Executable File

<div class="wrapper-block-whyus" id="wrapper_block_whyus">
<div class="content-wrapper h-100 bg-warning-">
<div class="h-100 w-100 d-flex justify-content-center">
<div class="row w-100 m-auto bg-success-">
<div class="col-lg-3 p-0">
<div class="p-2">
<small class="text-wecuro-theme fs-5 fw-bold">
<?=$components->whyus->sub_title?>
</small>
<span class="text-capitalize d-block lh-sm heading-gdft">
<?=$components->whyus->title?>
</span>
<div class="mt-2 pb-0 truncatebyline by5">
<?=$components->whyus->text?>
</div>
</div>
</div>
<div class="col-lg-9 p-0">
<div class="row w-100 m-auto">
<?php
foreach($components->whyus->cards as $card){
?>
<div class="col-md-3 mb-3">
<div class="card text-bg-light bvgftfdt">
<div class="card-header">
<?php
$extension=strtolower(pathinfo($card->logo,PATHINFO_EXTENSION));
if($extension=='svg'){
?>
<object data="<?=$card->logo?>" type="image/svg+xml" class="whyus-ndvfdcdfehtd"></object>
<?php
}else{
?>
<img src="<?=$card->logo?>">
<?php
}
?>
</div>
<div class="card-body">
<span class="title-gdfdtsgt text-center truncatebyline by3">
<?=$card->title?>
</span>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
setTimeout(function(){
const rootStyles=getComputedStyle(document.documentElement);
const whyusClr=rootStyles.getPropertyValue('--whyus-card-color');
setWhyUsCardsLogoSvgColor(whyusClr);
},1000);
function setWhyUsCardsLogoSvgColor(clr){
console.log(clr);
var objectElements=document.getElementsByClassName("whyus-ndvfdcdfehtd");
for(let i=0;i<objectElements.length;i++){
var objectElement=objectElements[i];
var svgDoc=objectElement.contentDocument;
if(svgDoc){
var path=svgDoc.querySelector('path');
if(path.hasAttribute("stroke-linejoin")){
path.setAttribute('stroke', clr);
}else{
path.setAttribute('fill', clr);
}
}
}
}
});
</script>