This commit is contained in:
2023-07-17 07:24:08 +00:00
parent 383c1be382
commit 0e1de15d7c
17 changed files with 164 additions and 38 deletions

View File

@@ -9,9 +9,7 @@
register(false)
let swiper
function handleMouseOver() {
console.log("test")
}
function handleMouseOver() {}
function handleMouseOut() {}

View File

@@ -31,7 +31,8 @@
}
return ""
}
}
let nestedPath = checkNestedPath()
</script>
@@ -42,7 +43,7 @@
{/if}
{#if nestedPath}
<h3
style="cursor: pointer;"
style="cursor: pointer; display: flex; align-items: center; gap: 10px; line-height: 1.4;"
on:keydown
on:click="{() => {
$rerender = $rerender + 1
@@ -61,7 +62,7 @@
{#if row.subTitle}
<h3>{row.subTitle}</h3>
{/if}
<div class="row" class:dominant="{row.columns.some((col) => col.contentType == 'iconCycleCircle')}">
<div class="row" class:dominant="{row.columns.some((col) => col.contentType == 'iconCycleCircle')}" >
{#each row?.columns as col}
<div class="col" class:dominant="{col.contentType == 'iconCycleCircle'}">
{#if col?.contentType == "text"}
@@ -69,7 +70,7 @@
{:else if col?.contentType == "textLink"}
<TextLink description="{col?.textLink?.text}" path="{col?.textLink?.link}" bright="{bright}" />
{:else if col.contentType == "image"}
<Image image="{col?.image}" pageId="{pageId}" />
<Image image="{col?.image}" col="{col}" pageId="{pageId}" />
{:else if col.contentType == "iconBlocks"}
<IconBlock pageId="{pageId}" col="{col}" />
{:else if col.contentType == "pageLinkBlocks"}
@@ -107,6 +108,9 @@
.red {
color: #fa00ff !important;
}
h3 {
font-weight: normal;
}
@media @tablet {
h3 {
font-size: 1.2rem;

View File

@@ -1,8 +1,9 @@
<script lang="ts">
import { pages } from "../../store"
import { pages, scrollToRowNr } from "../../store"
import Homepage from "./Homepage.svelte"
import Pagebuilder from "./Pagebuilder.svelte"
import { apiBaseURL } from "../../../config"
import { onMount } from "svelte"
export let path
export let homepage = false
@@ -12,6 +13,27 @@
page = $pages[path]
}
onMount(() => {
if ($scrollToRowNr !== -1) {
console.log("test321-", $scrollToRowNr)
if (!$scrollToRowNr) {
$scrollToRowNr = -1
return
}
let element = document.getElementById("row-" + $scrollToRowNr)
console.log(element)
if (!element) {
$scrollToRowNr = -1
return
}
element?.scrollIntoView({
behavior: "smooth",
})
$scrollToRowNr = -1
}
})
$: {
if (Object.keys($pages).length) {
initPage()
@@ -22,8 +44,8 @@
<div class="rows" class:HP="{path == '/'}">
{#if page}
{#if path == "/"}<Homepage />{/if}
{#each page.rows as row}
<div class="row">
{#each page.rows as row, i}
<div class="row" id="row-{i}">
{#if row.row.backgroundImage}
<div class="background-image">
<img src="{`${apiBaseURL}page/${page.id}/${row.row.backgroundImage?.src}`}" alt="img" />
@@ -52,7 +74,10 @@
& > .row {
padding: 10px;
padding-top: 80px;
padding-top: 30px;
@media @tablet {
padding-top: 80px;
}
width: 100%;
position: relative;
display: flex;