forked from cms/tibi-svelte-starter
upgrade
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<script lang="typescript">
|
||||
<script lang="ts">
|
||||
import { Router, Route, links } from "svelte-routing"
|
||||
import { scrollToTop } from "svelte-scrollto"
|
||||
import { location } from "../store"
|
||||
|
||||
@@ -1,67 +1,13 @@
|
||||
{#if blocks?.length}
|
||||
<section class="section_padding">
|
||||
<div class="container">
|
||||
{#each blocks as box, idx}
|
||||
<!-- Teaserbox -->
|
||||
<div class="row center_row">
|
||||
{#if box.images?.length && (box.layout == 1 || box.layout == 3)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
<img
|
||||
loading="lazy"
|
||||
src="{imageBase + box.images[0].file.src}"
|
||||
alt="{box.images[0].label || ''}"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
{#if box.text || box.title || (box.button_text && box.button_url)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
{#if box.subtitle}
|
||||
<div class="subline">{box.subtitle}</div>
|
||||
{/if}
|
||||
{#if box.title}
|
||||
{#if accordeon == true}
|
||||
<h2
|
||||
class="h2_nooffset acc_trigger"
|
||||
class:active="{activeAccordeons[idx]}"
|
||||
on:click="{() => {
|
||||
activeAccordeons[idx] = !activeAccordeons[idx]
|
||||
}}"
|
||||
>
|
||||
{box.title}
|
||||
<span class="icon">\/</span>
|
||||
</h2>
|
||||
{:else}
|
||||
<h2 class="h2_nooffset">{box.title}</h2>
|
||||
{/if}
|
||||
{/if}
|
||||
<div
|
||||
class="boxText"
|
||||
class:hideText="{accordeon && box.title && !activeAccordeons[idx]}"
|
||||
>
|
||||
{@html box.text}
|
||||
{#if box.button_text && box.button_url}
|
||||
<a
|
||||
href="{box.button_url}"
|
||||
class="btn btn_blue"
|
||||
>{box.button_text}</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if box.images?.length && (box.layout == 2 || box.layout == 4)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
<img
|
||||
loading="lazy"
|
||||
src="{imageBase + box.images[0].file.src}"
|
||||
alt="{box.images[0].label || ''}"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
<script lang="ts">
|
||||
export let blocks: ContentBlock[]
|
||||
export let imageBase: string
|
||||
|
||||
export let accordeon = false
|
||||
|
||||
let activeAccordeons: {
|
||||
[key: number]: boolean
|
||||
} = {}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.acc_trigger {
|
||||
@@ -93,13 +39,71 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="typescript">
|
||||
export let blocks: ContentBlock[]
|
||||
export let imageBase: string
|
||||
|
||||
export let accordeon = false
|
||||
|
||||
let activeAccordeons: {
|
||||
[key: number]: boolean
|
||||
} = {}
|
||||
</script>
|
||||
{#if blocks?.length}
|
||||
<section class="section_padding">
|
||||
<div class="container">
|
||||
{#each blocks as box, idx}
|
||||
<!-- Teaserbox -->
|
||||
<div class="row center_row">
|
||||
{#if box.images?.length && (box.layout == 1 || box.layout == 3)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
<img
|
||||
loading="lazy"
|
||||
src="{imageBase + box.images[0].file.src}"
|
||||
alt="{box.images[0].label || ''}"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
{#if box.text || box.title || (box.button_text && box.button_url)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
{#if box.subtitle}
|
||||
<div class="subline">{box.subtitle}</div>
|
||||
{/if}
|
||||
{#if box.title}
|
||||
{#if accordeon == true}
|
||||
<h2
|
||||
class="h2_nooffset acc_trigger"
|
||||
class:active="{activeAccordeons[idx]}"
|
||||
on:click="{() => {
|
||||
activeAccordeons[idx] =
|
||||
!activeAccordeons[idx]
|
||||
}}"
|
||||
>
|
||||
{box.title}
|
||||
<span class="icon">\/</span>
|
||||
</h2>
|
||||
{:else}
|
||||
<h2 class="h2_nooffset">{box.title}</h2>
|
||||
{/if}
|
||||
{/if}
|
||||
<div
|
||||
class="boxText"
|
||||
class:hideText="{accordeon &&
|
||||
box.title &&
|
||||
!activeAccordeons[idx]}"
|
||||
>
|
||||
{@html box.text}
|
||||
{#if box.button_text && box.button_url}
|
||||
<a
|
||||
href="{box.button_url}"
|
||||
class="btn btn_blue"
|
||||
>{box.button_text}</a
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if box.images?.length && (box.layout == 2 || box.layout == 4)}
|
||||
<div class="col-md-{box.layout < 3 ? 6 : 12}">
|
||||
<img
|
||||
loading="lazy"
|
||||
src="{imageBase + box.images[0].file.src}"
|
||||
alt="{box.images[0].label || ''}"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script lang="typescript">
|
||||
<script lang="ts">
|
||||
export let path: string
|
||||
|
||||
console.log("Content: ", path)
|
||||
|
||||
Reference in New Issue
Block a user