| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/components/pages/home/ |
Upload File : |
<template>
<div class="slide">
<div class="slide__image-wrapper">
<picture>
<source :srcset="imageSourceAsAvif" />
<img :src="dataSource.image"
class="slide__image"
decoding="async"
:alt="dataSource.title"
:loading="isLazy ? 'lazy' : 'eager'"
width="300" height="300" />
</picture>
</div>
<h1 class="slide__title">
{{ dataSource.title }}
</h1>
<p class="slide__description">
{{ dataSource.description }}
</p>
<a :href="dataSource.link"
target="_blank"
class="slide__show-more">
{{ $t("more details") }}
<i class="icon-arrow_back slide__show-more__icon" />
</a>
</div>
</template>
<script>
import { convertImagePathToAvif} from "../../../helper/helper";
export default {
name: "HomeSlideItem",
props: {
dataSource: {
required: true,
type: Object
},
isLazy: {
default: true
}
},
computed: {
imageSourceAsAvif() {
return convertImagePathToAvif(this.dataSource.image);
}
}
};
</script>
<style lang="scss" scoped>
.slide {
min-width: 100%;
padding: $padding-default * 2 0;
padding-top: 5%;
position: relative;
text-align: center;
width: 100%;
&__image-wrapper {
aspect-ratio: 1 / 1;
margin: 0 auto;
max-width: 300px;
overflow: hidden;
position: relative;
&:after {
content: "";
display: block;
padding-top: 100%;
width: 100%;
}
}
&__image {
position: absolute;
right: 0;
top: 0;
width: 100%;
}
&__title {
color: $color-text;
display: block;
font-size: 22px;
font-weight: bold;
line-height: 2;
margin: $padding-default auto 0 $padding-default;
padding: 0;
text-align: center;
}
&__description {
color: $color-text--light;
font-size: 14px;
line-height: 1.8;
margin: $padding-default/2 auto 0 auto;
padding: 0;
text-align: center;
}
&__show-more {
background: $color-primary;
border-radius: $border-radius;
color: $color-text;
display: block;
font-size: 16px;
height: $input-height;
line-height: $input-height;
margin: $padding-default auto 0 auto;
max-width: 250px;
padding: 0 $padding-default;
text-align: center;
text-decoration: none;
&:hover {
background: $color-primary--darken;
}
&__icon {
$size: 26px;
border: 1px solid $color-text;
border-radius: 50%;
display: inline-block;
font-size: 24px;
height: $size;
margin: 0 5px;
vertical-align: middle;
width: $size;
}
}
@media (min-width: $desktop) {
padding-top: 5%;
&__image-wrapper {
float: left;
margin-right: 64px;
width: 30%;
}
&__title,
&__description {
margin-right: 0;
text-align: right;
}
&__title {
font-size: 36px;
}
&__description {
font-size: 15px;
margin-top: 0;
}
&__show-more {
height: 46px;
line-height: 46px;
margin-right: 0;
}
}
}
[data-lang="en"] {
.slide {
&__show-more__icon {
transform: rotate(180deg);
}
&__title {
direction: ltr;
line-height: 1.3;
}
&__description {
direction: ltr;
}
@media (min-width: $desktop) {
&__image-wrapper {
float: right;
margin-left: 64px;
margin-right: 0;
}
&__title,
&__description {
margin-left: 0;
margin-right: auto;
text-align: left;
}
&__show-more {
margin-left: 0;
margin-right: auto;
}
}
}
}
</style>