IT4C.dev/docs/.vuepress/components/ContactForm.vue
mahula 9ec4edd98b
refactor(content): refine texts and various aspects of presentation (#323)
* start page: change project descriptions

* contact page: fix telephone link

* contact form: present phone number more human readable as elsewhere on the website

* contact form: change text

* ocelot page: set space between paragraphs

* ocelot page: reduce and center ocelot logo

* dreammall page: reduce and center dreammall logo

* dreammall page: set space between paragraphs

* project pages: set project image width to value instead of percentage

* build(deps-dev): bump tailwindcss from 4.0.17 to 4.1.3 (#327)

Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) from 4.0.17 to 4.1.3.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.3/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-version: 4.1.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump textlint in the linting group (#325)

Bumps the linting group with 1 update: [textlint](https://github.com/textlint/textlint).


Updates `textlint` from 14.5.0 to 14.6.0
- [Release notes](https://github.com/textlint/textlint/releases)
- [Commits](https://github.com/textlint/textlint/compare/v14.5.0...v14.6.0)

---
updated-dependencies:
- dependency-name: textlint
  dependency-version: 14.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: linting
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump typescript-eslint from 8.28.0 to 8.29.0 (#328)

Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.28.0 to 8.29.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.29.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint from 9.23.0 to 9.24.0 (#329)

Bumps [eslint](https://github.com/eslint/eslint) from 9.23.0 to 9.24.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.23.0...v9.24.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.24.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @tailwindcss/vite from 4.0.17 to 4.1.3 (#330)

Bumps [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite) from 4.0.17 to 4.1.3.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.3/packages/@tailwindcss-vite)

---
updated-dependencies:
- dependency-name: "@tailwindcss/vite"
  dependency-version: 4.1.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint-plugin-prettier from 5.2.5 to 5.2.6 (#331)

Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.2.5 to 5.2.6.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.2.5...v5.2.6)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.2.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump sass-embedded from 1.86.0 to 1.86.3 (#332)

Bumps [sass-embedded](https://github.com/sass/embedded-host-node) from 1.86.0 to 1.86.3.
- [Changelog](https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/embedded-host-node/compare/1.86.0...1.86.3)

---
updated-dependencies:
- dependency-name: sass-embedded
  dependency-version: 1.86.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump actions/setup-node from 4.3.0 to 4.4.0 (#340)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](cdca7365b2...49933ea528)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint-plugin-vue from 10.0.0 to 10.1.0 (#348)

Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases)
- [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v10.0.0...v10.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-vue
  dependency-version: 10.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump textlint in the linting group (#350)

Bumps the linting group with 1 update: [textlint](https://github.com/textlint/textlint).


Updates `textlint` from 14.6.0 to 14.7.1
- [Release notes](https://github.com/textlint/textlint/releases)
- [Commits](https://github.com/textlint/textlint/compare/v14.6.0...v14.7.1)

---
updated-dependencies:
- dependency-name: textlint
  dependency-version: 14.7.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: linting
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint-config-prettier from 10.1.1 to 10.1.5 (#352)

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 10.1.1 to 10.1.5.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v10.1.1...v10.1.5)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-version: 10.1.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump globals from 16.0.0 to 16.1.0 (#355)

Bumps [globals](https://github.com/sindresorhus/globals) from 16.0.0 to 16.1.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v16.0.0...v16.1.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 16.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint-plugin-prettier from 5.2.6 to 5.4.0 (#356)

Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.2.6 to 5.4.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.2.6...v5.4.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump typescript-eslint from 8.29.0 to 8.32.1 (#360)

Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.29.0 to 8.32.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.32.1/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.32.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump eslint from 9.24.0 to 9.27.0 (#361)

Bumps [eslint](https://github.com/eslint/eslint) from 9.24.0 to 9.27.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.24.0...v9.27.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(content): added utopia map (#362)

* added utopia map

* correction

* fix linting

* fix linting

* refactor(content): new slogan (#363)

* new slogan

* fix word duplication

* resolve conflict

* build(deps-dev): bump typescript-eslint from 8.32.1 to 8.36.0 (#394)

Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.32.1 to 8.36.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.36.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.36.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* use differen token (#395)

* new token utilizing dependabot scope (#396)

* build(deps-dev): bump eslint from 9.27.0 to 9.31.0

Bumps [eslint](https://github.com/eslint/eslint) from 9.27.0 to 9.31.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.27.0...v9.31.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.31.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* do not deploy to github (#397)

* build(deps-dev): bump globals from 16.1.0 to 16.3.0

Bumps [globals](https://github.com/sindresorhus/globals) from 16.1.0 to 16.3.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v16.1.0...v16.3.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 16.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump eslint-plugin-vue from 10.1.0 to 10.3.0

Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 10.1.0 to 10.3.0.
- [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases)
- [Changelog](https://github.com/vuejs/eslint-plugin-vue/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v10.1.0...v10.3.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-vue
  dependency-version: 10.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump eslint-plugin-prettier from 5.4.0 to 5.5.1

Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.4.0 to 5.5.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.4.0...v5.5.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.5.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump prettier from 3.5.3 to 3.6.2

Bumps [prettier](https://github.com/prettier/prettier) from 3.5.3 to 3.6.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.5.3...3.6.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.6.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump textlint in the linting group

Bumps the linting group with 1 update: [textlint](https://github.com/textlint/textlint).


Updates `textlint` from 14.7.2 to 14.8.0
- [Release notes](https://github.com/textlint/textlint/releases)
- [Commits](https://github.com/textlint/textlint/compare/v14.7.2...v14.8.0)

---
updated-dependencies:
- dependency-name: textlint
  dependency-version: 14.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: linting
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump @tailwindcss/vite from 4.1.3 to 4.1.11

Bumps [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite) from 4.1.3 to 4.1.11.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.11/packages/@tailwindcss-vite)

---
updated-dependencies:
- dependency-name: "@tailwindcss/vite"
  dependency-version: 4.1.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix tailwind version definition (#398)

* build(deps-dev): bump sass-embedded from 1.86.3 to 1.89.2

Bumps [sass-embedded](https://github.com/sass/embedded-host-node) from 1.86.3 to 1.89.2.
- [Changelog](https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/embedded-host-node/compare/1.86.3...1.89.2)

---
updated-dependencies:
- dependency-name: sass-embedded
  dependency-version: 1.89.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump the vuepress group across 1 directory with 4 updates (#339)

Bumps the vuepress group with 4 updates in the / directory: [@vuepress/bundler-vite](https://github.com/vuepress/core), [@vuepress/plugin-slimsearch](https://github.com/vuepress/ecosystem/tree/HEAD/plugins/search/plugin-slimsearch), [vuepress](https://github.com/vuejs/vuepress/tree/HEAD/packages/vuepress) and [vuepress-theme-hope](https://github.com/vuepress-theme-hope/vuepress-theme-hope/tree/HEAD/packages/theme).


Updates `@vuepress/bundler-vite` from 2.0.0-rc.20 to 2.0.0-rc.21
- [Release notes](https://github.com/vuepress/core/releases)
- [Changelog](https://github.com/vuepress/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuepress/core/compare/v2.0.0-rc.20...v2.0.0-rc.21)

Updates `@vuepress/plugin-slimsearch` from 2.0.0-rc.82 to 2.0.0-rc.94
- [Release notes](https://github.com/vuepress/ecosystem/releases)
- [Changelog](https://github.com/vuepress/ecosystem/blob/main/plugins/search/plugin-slimsearch/CHANGELOG.md)
- [Commits](https://github.com/vuepress/ecosystem/commits/v2.0.0-rc.94/plugins/search/plugin-slimsearch)

Updates `vuepress` from 2.0.0-rc.20 to 2.0.0-rc.21
- [Release notes](https://github.com/vuejs/vuepress/releases)
- [Changelog](https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vuepress/commits/HEAD/packages/vuepress)

Updates `vuepress-theme-hope` from 2.0.0-rc.74 to 2.0.0-rc.82
- [Release notes](https://github.com/vuepress-theme-hope/vuepress-theme-hope/releases)
- [Changelog](https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/packages/theme/CHANGELOG.md)
- [Commits](https://github.com/vuepress-theme-hope/vuepress-theme-hope/commits/v2.0.0-rc.82/packages/theme)

---
updated-dependencies:
- dependency-name: "@vuepress/bundler-vite"
  dependency-version: 2.0.0-rc.21
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: vuepress
- dependency-name: "@vuepress/plugin-slimsearch"
  dependency-version: 2.0.0-rc.94
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: vuepress
- dependency-name: vuepress
  dependency-version: 2.0.0-rc.21
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: vuepress
- dependency-name: vuepress-theme-hope
  dependency-version: 2.0.0-rc.82
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: vuepress
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* some types are required for tsc to work (#399)

* fix start command (#400)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
2025-07-18 20:30:16 +00:00

185 lines
5.5 KiB
Vue

<template>
<p class="text-gray-600 dark:text-gray-300 mb-8">
Als Ansprechpartner steht dir <strong>Ulf Gebhardt</strong> für deine Fragen gerne zur
Verfügung.<br />
Wir freuen uns auf deine Nachricht.
</p>
<div class="grid grid-cols-1 md:grid-cols-10 gap-8">
<!-- Left side: Portrait - takes 3/10 of space -->
<div
class="flex flex-col items-center md:items-end md:self-start md:col-span-3 md:sticky md:top-8"
>
<img
src="/images/portrait/ulf-gebhardt.jpg"
alt="Ulf Gebhardt"
class="rounded-lg shadow-md w-75 h-auto mb-6"
/>
</div>
<!-- Right side: Contact form - takes 7/10 of space -->
<div class="md:col-span-7">
<h3 class="mb-4">Telefon</h3>
<div class="flex-col gap-2 mb-8">
<p class="flex items-center">
<svg
xmlns="http://www.w3.org/2000/svg"
class="phone-number h-5 w-5 mr-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
/>
</svg>
<a href="tel:+4915784841600" class="phone-number hover:!underline">+49 157 8484 1600</a>
</p>
</div>
<h3 class="mb-4">Nachricht</h3>
<form @submit.prevent="handleSubmit">
<div v-if="submitSuccess" class="my-4 p-3 bg-green-100 text-green-700 rounded-md mb-4">
Deine Nachricht wurde erfolgreich gesendet. Vielen Dank!
</div>
<div v-if="submitError" class="my-4 p-3 bg-red-100 text-red-700 rounded-md mb-4">
{{ submitError }}
</div>
<div class="my-4">
<input
id="name"
v-model="form.name"
type="text"
placeholder="Name"
required
minlength="2"
maxlength="35"
class="w-full p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:highlight focus:border-transparent"
/>
</div>
<div class="my-4">
<input
id="email"
v-model="form.email"
type="email"
placeholder="E-Mail"
required
class="w-full p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:highlight focus:border-transparent"
/>
</div>
<div class="my-4">
<input
id="phone"
v-model="form.phone"
type="tel"
placeholder="Telefon"
minlength="8"
class="w-full p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:highlight focus:border-transparent"
/>
</div>
<div class="my-4">
<textarea
id="message"
v-model="form.message"
rows="4"
placeholder="Deine Nachricht"
required
minlength="5"
class="w-full p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:highlight focus:border-transparent"
/>
</div>
<div class="my-4 flex justify-end">
<button
type="submit"
:disabled="isSubmitting"
class="text-white py-2 px-6 rounded-md transition-colors duration-200 focus:outline-none focus:ring-2 focus:highlight focus:ring-offset-2"
>
<span v-if="isSubmitting">Wird gesendet...</span>
<span v-else>Nachricht senden</span>
</button>
</div>
</form>
</div>
</div>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
const form = reactive({
name: '',
email: '',
phone: '',
message: '',
})
const isSubmitting = ref(false)
const submitSuccess = ref(false)
const submitError = ref('')
const handleSubmit = async () => {
try {
isSubmitting.value = true
submitError.value = ''
const response = await fetch('/api/mail', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: form.name,
email: form.email,
telephone: form.phone || undefined, // Send undefined if empty to match optional schema
text: form.message,
}),
})
if (response.status !== 200) {
throw new Error('Bei der Kommunikation mit dem Server ist ein Fehler aufgetreten.')
}
const result = await response.json()
if (!response.ok) {
throw new Error(result.error || 'Fehler beim Senden der Nachricht')
}
// Clear form on success
form.name = ''
form.email = ''
form.phone = ''
form.message = ''
submitSuccess.value = true
setTimeout(() => {
submitSuccess.value = false
}, 5000) // Hide success message after 5 seconds
} catch (error) {
submitError.value =
error instanceof Error ? error.message : 'Ein unbekannter Fehler ist aufgetreten'
} finally {
isSubmitting.value = false
}
}
</script>
<style>
.phone-number {
color: var(--highlight-color);
}
.focus\:highlight:focus {
--tw-ring-color: var(--highlight-color);
}
button {
background-color: var(--highlight-color);
&:hover {
background-color: color-mix(in srgb, var(--highlight-color), black 15%);
}
}
</style>