169 lines
3.0 KiB
Vue
169 lines
3.0 KiB
Vue
<script setup lang="ts">
|
|
import type { SuccessStoryCase } from '~/data/cases-content'
|
|
|
|
defineProps<{
|
|
story: SuccessStoryCase
|
|
reverse?: boolean
|
|
readFullLabel?: string
|
|
}>()
|
|
</script>
|
|
|
|
<template>
|
|
<article class="cstory" :class="{ 'cstory--reverse': reverse }">
|
|
<div class="cstory__grid">
|
|
<div class="cstory__media">
|
|
<img :src="story.image" :alt="story.imageAlt" loading="lazy" />
|
|
<a
|
|
v-if="story.url"
|
|
:href="story.url"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="cstory__btn"
|
|
>
|
|
{{ readFullLabel ?? 'Read Full Case Study' }}
|
|
</a>
|
|
</div>
|
|
|
|
<div class="cstory__content">
|
|
<a
|
|
v-if="story.url"
|
|
:href="story.url"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="cstory__title"
|
|
>
|
|
{{ story.title }}
|
|
</a>
|
|
<h2 v-else class="cstory__title cstory__title--plain">
|
|
{{ story.title }}
|
|
</h2>
|
|
|
|
<section
|
|
v-for="(block, i) in story.blocks"
|
|
:key="i"
|
|
class="cstory__block"
|
|
>
|
|
<h3 class="cstory__h">{{ block.h }}</h3>
|
|
<p class="cstory__p">{{ block.p }}</p>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.cstory {
|
|
padding: 48px 0;
|
|
border-bottom: 1px solid #d8dde3;
|
|
}
|
|
|
|
.cstory:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.cstory__grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 48px;
|
|
align-items: start;
|
|
}
|
|
|
|
.cstory--reverse .cstory__grid {
|
|
direction: rtl;
|
|
}
|
|
|
|
.cstory--reverse .cstory__grid > * {
|
|
direction: ltr;
|
|
}
|
|
|
|
.cstory__media {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.cstory__media img {
|
|
width: 100%;
|
|
aspect-ratio: 16 / 10;
|
|
object-fit: cover;
|
|
border-radius: 4px;
|
|
display: block;
|
|
}
|
|
|
|
.cstory__btn {
|
|
display: inline-block;
|
|
margin-top: 20px;
|
|
padding: 11px 28px;
|
|
border: none;
|
|
border-radius: 999px;
|
|
background: #48a4fc;
|
|
color: #fff;
|
|
font-family: Georgia, 'Times New Roman', serif;
|
|
font-size: 15px;
|
|
font-weight: 500;
|
|
text-decoration: none;
|
|
transition: background 0.18s ease;
|
|
}
|
|
|
|
.cstory__btn:hover {
|
|
background: #3a96f0;
|
|
}
|
|
|
|
.cstory__title {
|
|
display: inline;
|
|
color: var(--blue);
|
|
font-size: clamp(18px, 2.2vw, 22px);
|
|
font-weight: 700;
|
|
line-height: 1.45;
|
|
text-decoration: underline;
|
|
text-underline-offset: 3px;
|
|
}
|
|
|
|
.cstory__title:hover {
|
|
color: #0077cc;
|
|
}
|
|
|
|
.cstory__title--plain {
|
|
display: block;
|
|
text-decoration: none;
|
|
cursor: default;
|
|
}
|
|
|
|
.cstory__title--plain:hover {
|
|
color: var(--blue);
|
|
}
|
|
|
|
.cstory__block {
|
|
margin-top: 18px;
|
|
}
|
|
|
|
.cstory__h {
|
|
color: #1e1e1e;
|
|
font-size: 16px;
|
|
font-weight: 800;
|
|
}
|
|
|
|
.cstory__p {
|
|
margin-top: 6px;
|
|
color: #1e1e1e;
|
|
font-size: 15px;
|
|
line-height: 1.75;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
.cstory {
|
|
padding: 36px 0;
|
|
}
|
|
|
|
.cstory__grid {
|
|
grid-template-columns: 1fr;
|
|
gap: 28px;
|
|
}
|
|
|
|
.cstory--reverse .cstory__grid {
|
|
direction: ltr;
|
|
}
|
|
}
|
|
</style>
|