From eefa562cb14460f3acee2338c169b64a29917193 Mon Sep 17 00:00:00 2001 From: robin Date: Thu, 2 Oct 2025 17:27:06 +0000 Subject: [PATCH] first row --- .vscode/settings.json | 57 ++- Makefile | 59 +-- api/collections/content.yml | 10 - api/collections/fields/contentBlocks.yml | 1 - api/collections/fields/contentBlocks/form.yml | 7 - api/collections/fields/form.yml | 7 - api/collections/form.yml | 38 -- api/collections/navigation.yml | 14 - api/config.yml | 5 +- docker-compose-local.yml | 45 ++- esbuild.config.js | 55 +-- frontend/logo/KontextWerk.svg | 1 + frontend/logo/KontextwerkSingle.svg | 1 + frontend/logo/logo-blue.svg | 30 -- frontend/logo/logo-white.svg | 30 -- frontend/logo/logoShort.svg | 5 - frontend/spa.html | 16 - frontend/src/App.svelte | 58 ++- frontend/src/api.ts | 8 +- frontend/src/i18n.ts | 13 + frontend/src/index.ts | 83 +++- frontend/src/lib/assets/css/main.less | 14 +- frontend/src/lib/assets/css/variables.less | 7 +- frontend/src/lib/components/Footer.svelte | 372 +++++++++--------- .../src/lib/components/header/Header.svelte | 290 ++++---------- .../staticPageRows/CoreSellingPoints.svelte | 244 ++++++++++++ frontend/src/routes/StaticHomepage.svelte | 5 + scripts/esbuild-wrapper.js | 20 + tsconfig.json | 23 +- 29 files changed, 779 insertions(+), 739 deletions(-) delete mode 100644 api/collections/fields/contentBlocks/form.yml delete mode 100644 api/collections/fields/form.yml delete mode 100644 api/collections/form.yml create mode 100644 frontend/logo/KontextWerk.svg create mode 100644 frontend/logo/KontextwerkSingle.svg delete mode 100644 frontend/logo/logo-blue.svg delete mode 100644 frontend/logo/logo-white.svg delete mode 100644 frontend/logo/logoShort.svg create mode 100644 frontend/src/i18n.ts create mode 100644 frontend/src/lib/components/staticPageRows/CoreSellingPoints.svelte diff --git a/.vscode/settings.json b/.vscode/settings.json index cb550c6..874961e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,9 +4,6 @@ "editor.formatOnSave": true, "editor.formatOnPaste": true, "editor.defaultFormatter": "esbenp.prettier-vscode", - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, "[markdown]": { "editor.wordWrap": "on", "editor.defaultFormatter": "vscode.markdown-language-features" @@ -16,11 +13,12 @@ }, "liveServer.settings.root": "/dist", "liveServer.settings.file": "spa.html", - "liveServer.settings.port": 5502, + "liveServer.settings.port": 5501, "liveServer.settings.proxy": { "enable": true, "baseUri": "/api", - "proxyUri": "https://login.tibicms.de/api/v1" + "proxyUri": "http://localhost:8080/api/v1/_/renz_shop_2024" + //"proxyUri": "https://dev.renzshop.testversion.online/api" }, "extensions.ignoreRecommendations": true, "files.autoSave": "off", @@ -28,6 +26,21 @@ "npm.autoDetect": "off", "debug.allowBreakpointsEverywhere": true, "html.autoClosingTags": false, + "[django-html]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "batisteo.vscode-django" + }, + "saveAndRun": { + "commands": [ + { + "match": "/api/.*(\\.ya?ml|js|env)$", + "cmd": "echo \"\" > ../../cms/tibi-server/tmp.html", + "silent": true + } + ] + }, + "i18n-ally.sourceLanguage": "de", + "i18n-ally.keystyle": "nested", "yaml.schemas": { "./../../cms/tibi-types/schemas/api-config/config.json": "api/config.y*ml", "./../../cms/tibi-types/schemas/api-config/collection.json": "api/collections/*.y*ml", @@ -43,27 +56,35 @@ } ], "workbench.colorCustomizations": { - "activityBar.activeBorder": "#00879f", - "activityBar.activeBackground": "#43546e", - "activityBar.background": "#43546e", + "activityBar.activeBackground": "#ec1b3c", + "activityBar.background": "#ec1b3c", "activityBar.foreground": "#e7e7e7", "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#ab748a", + "activityBarBadge.background": "#2fce11", "activityBarBadge.foreground": "#15202b", "commandCenter.border": "#e7e7e799", - "sash.hoverBorder": "#43546e", - "statusBar.background": "#303c4e", + "sash.hoverBorder": "#ec1b3c", + "statusBar.background": "#c4102d", "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#43546e", - "statusBarItem.remoteBackground": "#303c4e", + "statusBarItem.hoverBackground": "#ec1b3c", + "statusBarItem.remoteBackground": "#c4102d", "statusBarItem.remoteForeground": "#e7e7e7", - "titleBar.activeBackground": "#303c4e", + "titleBar.activeBackground": "#c4102d", "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#303c4e99", - "titleBar.inactiveForeground": "#e7e7e799" + "titleBar.inactiveBackground": "#c4102d99", + "titleBar.inactiveForeground": "#e7e7e799", + "editorGroup.border": "#ec1b3c", + "panel.border": "#ec1b3c", + "sideBar.border": "#ec1b3c", + "statusBar.border": "#c4102d", + "tab.activeBorder": "#ec1b3c", + "titleBar.border": "#c4102d" }, - "peacock.remoteColor": "#303C4E", + "peacock.remoteColor": "#C4102D", "editor.tabCompletion": "on", "diffEditor.codeLens": true, - "i18n-ally.localesPaths": ["public/ContentBuilder/public/contentbuilder/lang"] + "i18n-ally.localesPaths": ["frontend/locales"], + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + } } diff --git a/Makefile b/Makefile index de9b9be..29a5ea0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ DOCKER_COMPOSE=docker compose -f docker-compose-local.yml -DOCKER_COMPOSE_PLAYWRIGHT = docker-compose -f docker-compose-playwright.yml + .DEFAULT_GOAL := help -.PHONY: docker-up docker-up-tibi-dev docker-start docker-start-tibi-dev docker-down docker-ps docker-logs yarn-upgrade fix-permissions +.PHONY: docker-up docker-up-tibi-dev docker-start docker-start-tibi-dev docker-down docker-ps docker-logs yarn-upgrade fix-permissions mongo-sync-dev-to-local mongo-sync-master-to-local include ./.env @@ -10,19 +10,21 @@ help: ## show this help @echo MAKE TARGETS @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - - docker-up: ## bring docker compose stack up in background $(DOCKER_COMPOSE) --profile tibi up -d docker-up-tibi-dev: ## bring docker compose stack up in background with tibi-dev $(DOCKER_COMPOSE) --profile tibi-dev up -d + +docker-up-admin-dev: ## bring docker compose stack up in background with tibi-dev + $(DOCKER_COMPOSE) --profile admin-dev up -d + docker-up-chisel: ## bring up chisel tunnel $(DOCKER_COMPOSE) --profile chisel up -d docker-down: ## take docker compose stack down - $(DOCKER_COMPOSE) --profile tibi-dev --profile tibi --profile chisel down + $(DOCKER_COMPOSE) --profile admin-dev --profile tibi-dev --profile tibi --profile chisel down docker-start: ## start docker compose stack in foreground and take it down after CTRL-C $(DOCKER_COMPOSE) --profile tibi up; $(DOCKER_COMPOSE) --profile tibi-dev --profile tibi --profile chisel down @@ -42,37 +44,42 @@ docker-pull: ## pull docker images docker-%: $(DOCKER_COMPOSE) $* -yarn-upgrade: ## interactive yarn upgrade +yarn-upgrade: # interactive yarn upgrade $(DOCKER_COMPOSE) run --rm yarnstart yarn upgrade-interactive $(DOCKER_COMPOSE) restart yarnstart -fix-permissions: ## set files/directories owner to UID:GID from .env +fix-permissions: # set files/directories owner to UID:GID from .env sudo chown -R $(CODER_UID):$(CODER_GID) ./ - - -playwright-run-ui: ## run playwright tests in cli - BROWSER=chromium CURRENT_UID=$(CODER_UID):$(CODER_GID) PY_MODE='' PY_SPECFLAG='tests/ui/**/*.spec.js' $(DOCKER_COMPOSE_PLAYWRIGHT) up --exit-code-from=playwright; $(DOCKER_COMPOSE_PLAYWRIGHT) down - -playwright-open-ui: ## open playwright tests via remote X - BROWSER=chromium CURRENT_UID=$(CODER_UID):$(CODER_GID) PY_MODE='--ui' PY_SPECFLAG='' $(DOCKER_COMPOSE_PLAYWRIGHT) --profile vnc up --exit-code-from=playwright; $(DOCKER_COMPOSE_PLAYWRIGHT) --profile vnc down - -playwright-run-api: ## run playwright tests in cli - BROWSER=chromium CURRENT_UID=$(CODER_UID):$(CODER_GID) PY_MODE='' PY_SPECFLAG='tests/api/**/*.spec.js' $(DOCKER_COMPOSE_PLAYWRIGHT) up --exit-code-from=playwright; $(DOCKER_COMPOSE_PLAYWRIGHT) down - -playwright-open-api: ## open playwright tests via remote X - BROWSER=chromium CURRENT_UID=$(CODER_UID):$(CODER_GID) PY_MODE='--ui' PY_SPECFLAG='' $(DOCKER_COMPOSE_PLAYWRIGHT) --profile vnc up --exit-code-from=playwright; $(DOCKER_COMPOSE_PLAYWRIGHT) --profile vnc down - -docker-down-playwright: ## take docker compose stack down - $(DOCKER_COMPOSE_PLAYWRIGHT) --profile tibi-dev --profile tibi --profile chisel down - +mongo-sync-dev-to-local: ## sync mongo from dev to local + $(DOCKER_COMPOSE) up mongo -d + read -s -p "Enter chisel password: " CHISEL_PASSWORD; \ + chisel client --auth coder:$$CHISEL_PASSWORD http://dock8.basehosts.de:10987 27017:mongo:27017 & + sleep 3 + mongodump --archive --gzip --db=wmbasic_renz_shop_dev | $(DOCKER_COMPOSE) exec -T mongo mongorestore --archive --gzip --nsFrom='wmbasic_renz_shop_dev.*' --nsTo='wmbasic_renz_shop.*' --nsInclude='wmbasic_renz_shop_dev.*' --drop + sleep 3 + killall chisel mongo-sync-master-to-local: ## sync mongo from master to local $(DOCKER_COMPOSE) up mongo -d read -s -p "Enter chisel password: " CHISEL_PASSWORD; \ - chisel client --auth coder:$$CHISEL_PASSWORD http://dock4.basehosts.de:10987 27017:mongo:27017 & + chisel client --auth coder:$$CHISEL_PASSWORD http://dock8.basehosts.de:10987 27017:mongo:27017 & sleep 3 - mongodump --archive --gzip --db=wmbasic_bkdf_tibi_2024 | $(DOCKER_COMPOSE) exec -T mongo mongorestore --archive --gzip --nsFrom='wmbasic_bkdf_tibi_2024.*' --nsTo='bkdf_tibi_2024_bkdf_tibi_2024.*' --nsInclude='wmbasic_bkdf_tibi_2024.*' --drop + mongodump --archive --gzip --db=wmbasic_renz_shop | $(DOCKER_COMPOSE) exec -T mongo mongorestore --archive --gzip --nsFrom='wmbasic_renz_shop.*' --nsTo='wmbasic_renz_shop.*' --nsInclude='wmbasic_renz_shop.*' --drop sleep 3 killall chisel +media-sync-master-to-local: ## sync media from master to local + rsync -v -e "ssh -p 22222" -az --info=progress2 --exclude=contact_form renz_shop_media_master@dock1.basehosts.de:/ media/ + +mongo-sync-local-to-early: ## sync mongo from local to early + $(DOCKER_COMPOSE) up mongo -d + read -s -p "Enter chisel password: " CHISEL_PASSWORD; \ + chisel client --auth coder:$$CHISEL_PASSWORD http://dock8.basehosts.de:10987 27017:mongo:27017 & + sleep 3 + $(DOCKER_COMPOSE) exec -T mongo mongodump --archive --gzip --db=wmbasic_renz_shop | mongorestore --archive --gzip --nsFrom='wmbasic_renz_shop.*' --nsTo='wmbasic_renz_shop_early.*' --nsInclude='wmbasic_renz_shop.*' --drop + sleep 3 + killall chisel + +media-sync-local-to-early: ## sync media from local to early + rsync -v -e "ssh -p 22222" -az --info=progress2 --exclude=contact_form media/ renz_shop_media_early@dock1.basehosts.de:/ diff --git a/api/collections/content.yml b/api/collections/content.yml index a23d5a4..1c5073c 100644 --- a/api/collections/content.yml +++ b/api/collections/content.yml @@ -152,16 +152,6 @@ permissions: put: true delete: true -hooks: - post: - return: - type: javascript - file: hooks/clear_cache.js - put: - return: - type: javascript - file: hooks/clear_cache.js - projections: navigation: select: diff --git a/api/collections/fields/contentBlocks.yml b/api/collections/fields/contentBlocks.yml index d3062db..5d17991 100644 --- a/api/collections/fields/contentBlocks.yml +++ b/api/collections/fields/contentBlocks.yml @@ -454,7 +454,6 @@ subFields: ########################### Blöcke ############################ ############################################################### - !include ./contentBlocks/columns.yml - - !include ./contentBlocks/form.yml - !include ./contentBlocks/predefined.yml - !include ./contentBlocks/productSlider.yml - !include ./contentBlocks/MainHomepage.yml diff --git a/api/collections/fields/contentBlocks/form.yml b/api/collections/fields/contentBlocks/form.yml deleted file mode 100644 index ebdf965..0000000 --- a/api/collections/fields/contentBlocks/form.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: form -type: object -meta: - widget: containerLessObject - dependsOn: - eval: $parent.type == 'form' -subFields: !include ../../fieldLists/formular/form.yml diff --git a/api/collections/fields/form.yml b/api/collections/fields/form.yml deleted file mode 100644 index 38eb1cf..0000000 --- a/api/collections/fields/form.yml +++ /dev/null @@ -1,7 +0,0 @@ -type: object -name: formular -meta: - label: - de: Formular - en: Form - widget: jsonField diff --git a/api/collections/form.yml b/api/collections/form.yml deleted file mode 100644 index a117af1..0000000 --- a/api/collections/form.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: form -uploadPath: ../media/forms - -meta: - label: Formular - muiIcon: web - backup: - active: true - collectionName: backups - views: - - type: table - columns: - - source: formular - -permissions: - public: - methods: - get: true - post: true - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true -hooks: - post: - create: - type: javascript - file: hooks/forms/post_create.js - return: - type: javascript - file: hooks/forms/post_return.js - -fields: - - !include fields/form.yml diff --git a/api/collections/navigation.yml b/api/collections/navigation.yml index e336c28..e476a13 100644 --- a/api/collections/navigation.yml +++ b/api/collections/navigation.yml @@ -120,20 +120,6 @@ x-externalUrl: &externalUrl de: Geben Sie hier die URL ein, zu der der Link führen soll. en: Enter the URL to which the link should lead. -hooks: - post: - return: - type: javascript - file: hooks/clear_cache.js - put: - return: - type: javascript - file: hooks/clear_cache.js - delete: - return: - type: javascript - file: hooks/clear_cache.js - fields: - name: tree type: number diff --git a/api/config.yml b/api/config.yml index 5a9766c..da7873b 100644 --- a/api/config.yml +++ b/api/config.yml @@ -1,4 +1,4 @@ -namespace: kontextwerk +namespace: kontextwerk meta: openapi: @@ -17,7 +17,7 @@ meta: label: de: Seiten en: Pages - + collections: - !include collections/contact.yml - !include collections/banner.yml @@ -25,7 +25,6 @@ collections: - !include collections/medialib.yml - !include collections/navigation.yml - !include collections/tag.yml - - !include collections/webhook.yml - !include collections/action.yml - !include collections/module.yml - !include collections/ssr.yml diff --git a/docker-compose-local.yml b/docker-compose-local.yml index 014f3d3..e2c90fa 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -1,11 +1,7 @@ name: ${PROJECT_NAME} -version: "3.8" services: yarnstart: - profiles: - - tibi - - tibi-dev image: node:20 volumes: - ./:/data @@ -25,8 +21,8 @@ services: tibiserver: profiles: - tibi - - tibi-dev - image: gitbase.de/cms/tibi-server + - admin-dev + image: gitbase.de/cms/tibi-server:dev volumes: - ./:/data environment: @@ -37,8 +33,6 @@ services: SECURITY_ALLOWUPPERPATHS: "true" depends_on: - mongo - expose: - - 8080 labels: - traefik.enable=true - traefik.http.services.${PROJECT_NAME}-tibiserver.loadbalancer.server.port=8080 @@ -47,10 +41,10 @@ services: tibiserver-dev: hostname: tibiserver build: - context: ./ + context: ./../../cms/tibi-server/ dockerfile: ./../../cms/tibi-server/Dockerfile.air profiles: - - tibiserver-dev + - tibi-dev volumes: - ./:/data - ./../../cms/tibi-server:/tibi-server @@ -89,12 +83,11 @@ services: labels: - traefik.enable=true - online.testversion.code.subdomain=${PROJECT_NAME}-tibiadmin - - traefik.http.routers.${PROJECT_NAME}-tibiadmin.middlewares=${PROJECT_NAME}-tibiadmin - - traefik.http.middlewares.${PROJECT_NAME}-tibiadmin.basicauth.usersfile=${PWD}/.basic-auth-code tibiadmin-dev: profiles: - tibi-dev + - admin-dev image: node:20 volumes: - ./../../cms/tibi-admin:/data @@ -105,30 +98,29 @@ services: labels: - traefik.enable=true - online.testversion.code.subdomain=${PROJECT_NAME}-tibiadmin-dev - - traefik.http.routers.${PROJECT_NAME}-tibiadmin-dev.middlewares=${PROJECT_NAME}-tibiadmin-dev - - traefik.http.middlewares.${PROJECT_NAME}-tibiadmin-dev.basicauth.usersfile=${PWD}/.basic-auth-code user: ${CODER_UID}:${CODER_GID} mongo: - profiles: - - tibi - - tibi-dev image: gitbase.de/server/mongo:4.2 volumes: - ./tmp/mongo-data:/data/db user: ${CODER_UID}:${CODER_GID} adminmongo: - profiles: - - tibi - - tibi-dev image: gitbase.de/server/adminmongo environment: CONN_NAME: mongo + # DB_USERNAME: root + # DB_PASSWORD: root DB_HOST: mongo PORT: 1234 + # ports: + # - ${ADMINMONGO_PORT:-3003}:1234 expose: - 1234 + #networks: + # - default + # - traefik_web labels: - traefik.enable=true - online.testversion.code.subdomain=${PROJECT_NAME}-adminmongo @@ -136,19 +128,23 @@ services: - traefik.http.middlewares.${PROJECT_NAME}-adminmongo.basicauth.usersfile=${PWD}/.basic-auth-code maildev: - profiles: - - tibi - - tibi-dev image: maildev/maildev + # ports: + # - ${MAILDEV_PORT:-3004}:80 command: node bin/maildev --web 1080 --smtp 25 -v --hide-extensions=STARTTLS expose: - 1080 + #networks: + # - default + # - traefik_web labels: - traefik.enable=true - online.testversion.code.subdomain=${PROJECT_NAME}-maildev - traefik.http.services.${PROJECT_NAME}-maildev.loadbalancer.server.port=1080 - traefik.http.routers.${PROJECT_NAME}-maildev.middlewares=${PROJECT_NAME}-maildev - traefik.http.middlewares.${PROJECT_NAME}-maildev.basicauth.usersfile=${PWD}/.basic-auth-code + healthcheck: + test: ["NONE"] chisel: profiles: @@ -160,3 +156,6 @@ services: - traefik.enable=true - online.testversion.code.subdomain=${PROJECT_NAME}-chisel command: server --port 8080 --auth coder:coder +#networks: +# traefik_web: +# external: true diff --git a/esbuild.config.js b/esbuild.config.js index 0ddf710..accbe8f 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -1,14 +1,11 @@ const fs = require("fs") - +const { copy } = require("esbuild-plugin-copy") const resolvePlugin = { name: "resolvePlugin", setup(build) { let path = require("path") - // url in css does not resolve via esbuild-svelte correctly build.onResolve({ filter: /.*/, namespace: "fakecss" }, (args) => { - // console.log(args) if (args.path.match(/^\./)) return { path: path.dirname(args.importer) + "/" + args.path } - // return { path: path.join(args.resolveDir, "public", args.path) } }) }, } @@ -36,10 +33,11 @@ const esbuildSvelte = sveltePlugin({ dev: (process.argv?.length > 2 ? process.argv[2] : "build") !== "build", }, preprocess: svelteConfig.preprocess, - cache: true, + cache: false, filterWarnings: (warning) => { // filter out a11y if (warning.code.match(/^a11y/)) return false + if (warning.code === "element_invalid_self_closing_tag") return false return true }, }) @@ -54,7 +52,18 @@ const options = { minify: process.argv[2] == "build", bundle: true, splitting: false, - plugins: [esbuildSvelte, resolvePlugin], + plugins: [ + esbuildSvelte, + resolvePlugin, + copy({ + assets: { + from: "./frontend/serviceworker.js", + to: "service-worker.js", + }, + }), + ], + mainFields: ["svelte", "browser", "module", "main"], + conditions: ["svelte", "browser"], loader: { ".woff2": "file", ".woff": "file", @@ -73,19 +82,6 @@ if (process.argv[2] == "start") { const dotEnv = fs.readFileSync(__dirname + "/.env", "utf8") const TIBI_NAMESPACE = dotEnv.match(/TIBI_NAMESPACE=(.*)/)[1] const apiBase = process.env.API_BASE || "http://localhost:8080/api/v1/_/" + TIBI_NAMESPACE - console.log("APIBASE;;", apiBase, "process", process.env.SSR) - - bsMiddleware.push( - createProxyMiddleware({ - pathFilter: "/_s", - target: "https://sentry.basehosts.de", - changeOrigin: true, - logLevel: "debug", - pathRewrite: (path, req) => { - return path.replace(/^\/_s(.*)$/, "/api/5/envelope/") - }, - }) - ) bsMiddleware.push( createProxyMiddleware({ pathFilter: "/api", @@ -95,24 +91,6 @@ if (process.argv[2] == "start") { logLevel: "debug", }) ) - if (process.env.SSR) { - bsMiddleware.push( - createProxyMiddleware({ - pathFilter: function (path, req) { - console.log("filter", path) - return !path.match(/\./) - }, - target: apiBase, - changeOrigin: true, - logLevel: "debug", - pathRewrite: function (path, req) { - console.log("rewirte") - console.log(path) - return "/ssr?url=" + encodeURIComponent(path) - }, - }) - ) - } } module.exports = { @@ -121,7 +99,7 @@ module.exports = { options: options, distDir, watch: { - path: [__dirname + "/" + frontendDir + "/src/**/*"], + path: [__dirname + "/" + frontendDir + "/src"], }, serve: { onRequest(args) { @@ -140,6 +118,7 @@ module.exports = { }), ], }, + ghostMode: false, open: false, // logLevel: "debug", }, diff --git a/frontend/logo/KontextWerk.svg b/frontend/logo/KontextWerk.svg new file mode 100644 index 0000000..c1729d8 --- /dev/null +++ b/frontend/logo/KontextWerk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/logo/KontextwerkSingle.svg b/frontend/logo/KontextwerkSingle.svg new file mode 100644 index 0000000..ed5d2f1 --- /dev/null +++ b/frontend/logo/KontextwerkSingle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/logo/logo-blue.svg b/frontend/logo/logo-blue.svg deleted file mode 100644 index aab5f18..0000000 --- a/frontend/logo/logo-blue.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/logo/logo-white.svg b/frontend/logo/logo-white.svg deleted file mode 100644 index ff6c5e2..0000000 --- a/frontend/logo/logo-white.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/logo/logoShort.svg b/frontend/logo/logoShort.svg deleted file mode 100644 index 9d44aa5..0000000 --- a/frontend/logo/logoShort.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/frontend/spa.html b/frontend/spa.html index 4ce08c7..823bfac 100644 --- a/frontend/spa.html +++ b/frontend/spa.html @@ -57,22 +57,6 @@ rel="dns-prefetch" href="//analytics.google.com" /> - - - - diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index f4f6bb7..c89a5ee 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -4,30 +4,15 @@ import Footer from "./lib/components/Footer.svelte" import Notifications from "./lib/components/widgets/Notifications.svelte" import SSRSkip from "./lib/components/SSRSkip.svelte" - import { baseURL } from "./config" import { isMobile, location, openModal } from "./lib/store" import StaticHomepage from "./routes/StaticHomepage.svelte" - export let url = "" + let innerWidth = $state(0) + $effect(() => { + $isMobile = innerWidth <= 1024 + }) - if (url) { - const [rawPath, rawQuery = ""] = url.split("?") - const normalizedPath = rawPath.startsWith("/") ? rawPath : `/${rawPath}` - const query = rawQuery ? decodeURIComponent(`?${rawQuery}`) : "" - $location = { - path: normalizedPath, - search: query, - hash: "", - push: false, - pop: false, - url: `${baseURL}${normalizedPath}${rawQuery ? `?${rawQuery}` : ""}`, - } - } - - let innerWidth = 0 - $: $isMobile = innerWidth <= 1024 - - let googleCookiesAllowed = false + let googleCookiesAllowed = $state(false) const googleCookieName = "googleAnalytics" const syncModalState = () => { @@ -77,7 +62,7 @@ }) - + {#if googleCookiesAllowed} @@ -107,7 +92,10 @@ - diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 45ffe02..2d40c25 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -89,10 +89,10 @@ export async function api(endpoint: string, options: ApiOptions = {}, body?: type EntryTypeSwitch = T extends "medialib" ? MedialibEntry : T extends "content" - ? ContentEntry - : T extends "navigation" - ? NavigationEntry - : any + ? ContentEntry + : T extends "navigation" + ? NavigationEntry + : any export async function getDBEntries( collectionName: T, diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts new file mode 100644 index 0000000..f98aa96 --- /dev/null +++ b/frontend/src/i18n.ts @@ -0,0 +1,13 @@ +import { writable } from "svelte/store" +import { baseURL } from "./config" + +const initLoc = { + path: (typeof window !== "undefined" && window.location?.pathname) || "/", + search: (typeof window !== "undefined" && window.location?.search) || "", + hash: (typeof window !== "undefined" && window.location?.hash) || "", + push: false, + pop: false, + url: `${baseURL}${(typeof window !== "undefined" && window.location?.pathname) || "/"}`, +} + +export const location = writable(initLoc) diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 6d7e427..fdaff99 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -1,11 +1,82 @@ +import "./i18n" import App from "./App.svelte" +import { baseURL } from "./config" +import { hydrate } from "svelte" +import { location } from "./i18n" + +const publishLocation = (_p?: string) => { + let _s: string + let _h: string + if (_p) { + const parts = _p.split("#") + _p = parts.shift() + _h = parts.join() + if (_h) _h = "#" + _h + + const parts2 = _p.split("?") + _p = parts2.shift() + _s = parts2.join() + if (_s) _s = "?" + _s + } + // make sure the path does not include the baseURL + if (_p && _p.startsWith(baseURL)) { + _p = _p.slice(baseURL.length) + } else if (!_p) { + _p = typeof window !== "undefined" && window.location?.pathname + } + + const newLocation = { + path: _p, + search: _p ? _s : typeof window !== "undefined" && window.location?.search, + hash: _p ? _h : typeof window !== "undefined" && window.location?.hash, + push: !!_p, + pop: !_p, + url: "", + } + + newLocation.url = `${baseURL}${newLocation.path}${newLocation.search ? "?" + newLocation.search : ""}` + + location.set(newLocation) +} + +if (typeof history !== "undefined") { + if (typeof Proxy !== "undefined") { + // modern browser + const historyApply = (target: any, thisArg: any, argumentsList: any[]) => { + publishLocation(argumentsList && argumentsList.length >= 2 && argumentsList[2]) + Reflect.apply(target, thisArg, argumentsList) + } + + history.pushState = new Proxy(history.pushState, { + apply: historyApply, + }) + + history.replaceState = new Proxy(history.replaceState, { + apply: historyApply, + }) + } else { + // ie11 + const pushStateFn = history.pushState + const replaceStateFn = history.replaceState + + history.pushState = function (data: any, title: string, url?: string) { + publishLocation(url) + return pushStateFn.apply(history, [...arguments] as [any, string, string?]) + } + history.replaceState = function (data: any, title: string, url?: string) { + publishLocation(url) + return replaceStateFn.apply(history, [...arguments] as [any, string, string?]) + } + } +} // else ssr -> no history handling + +typeof window !== "undefined" && + window.addEventListener("popstate", (event) => { + publishLocation() + }) + let appContainer = document?.getElementById("appContainer") -const hydrate = true //import.meta?.env?.MODE !== "development" -const app = new App({ - target: appContainer, - props: {}, - hydrate, -}) +const app = hydrate(App, { target: appContainer }) export default app diff --git a/frontend/src/lib/assets/css/main.less b/frontend/src/lib/assets/css/main.less index 9406f92..810de80 100644 --- a/frontend/src/lib/assets/css/main.less +++ b/frontend/src/lib/assets/css/main.less @@ -40,8 +40,18 @@ ul { } * { - transition: background-color 0.5s ease, max-height 0.5s, height 0.5s ease, width 0.5s ease, flex 0.5s ease, - opacity 0.5s ease, top 0.5s ease, bottom 0.5s ease, left 0.5s ease, right 0.5s ease, transform 0.5s ease; + transition: + background-color 0.5s ease, + max-height 0.5s, + height 0.5s ease, + width 0.5s ease, + flex 0.5s ease, + opacity 0.5s ease, + top 0.5s ease, + bottom 0.5s ease, + left 0.5s ease, + right 0.5s ease, + transform 0.5s ease; } /* General scrollbar styles for all webkit browsers */ *::-webkit-scrollbar { diff --git a/frontend/src/lib/assets/css/variables.less b/frontend/src/lib/assets/css/variables.less index e48d046..6255ca5 100644 --- a/frontend/src/lib/assets/css/variables.less +++ b/frontend/src/lib/assets/css/variables.less @@ -1,7 +1,8 @@ /* Figma Styles of your File */ :root { /* Colors */ - --wire: linear-gradient(-77.29deg, rgba(0, 0, 0, 0) 0%, rgba(13, 12, 12, 1) 44.86416280269623%), + --wire: + linear-gradient(-77.29deg, rgba(0, 0, 0, 0) 0%, rgba(13, 12, 12, 1) 44.86416280269623%), linear-gradient(98.68deg, rgba(0, 0, 0, 0) 0%, rgba(13, 12, 12, 1) 44.86416280269623%), linear-gradient(180deg, rgba(51, 45, 44, 1) 0%, rgba(51, 45, 44, 0) 100%); --bg-grey-cultured: linear-gradient(to left, #0d0c0c, #0d0c0c); @@ -37,10 +38,6 @@ --text-300: #625755; --bg-300: #eceaea; --text-invers-150: #6d97b0; - --krass-kraft-primary: #eb5757; - --crazy-crave-control-primary: #c0f256; - --krass-kreativ-primary: #56f2f2; - --crazy-calm-primary: #56f2b0; --vertical-default-margin: 3rem; --small-max-width: 1392px; diff --git a/frontend/src/lib/components/Footer.svelte b/frontend/src/lib/components/Footer.svelte index 6b6246b..d7c37d5 100644 --- a/frontend/src/lib/components/Footer.svelte +++ b/frontend/src/lib/components/Footer.svelte @@ -1,219 +1,209 @@ -
- - - - -
+ + diff --git a/frontend/src/lib/components/header/Header.svelte b/frontend/src/lib/components/header/Header.svelte index 1b15f53..cbe07a6 100644 --- a/frontend/src/lib/components/header/Header.svelte +++ b/frontend/src/lib/components/header/Header.svelte @@ -1,108 +1,49 @@ -