Osadź kalkulator PetYears

Dodaj nasze kalkulatory wieku do swojego bloga o zwierzętach, strony kliniki weterynaryjnej lub dowolnej strony. Wybierz iframe dla najprostszej konfiguracji lub Web Component dla bardziej elastycznej integracji.

Opcje

Dostosuj wygląd za pomocą parametrów URL (iframe) lub atrybutów (Web Component).

Opcja 1: iframe (najprostszy)

Skopiuj kod poniżej i wklej do HTML swojej strony. Działa wszędzie.

<iframe src="https://petyears.app/en/e/dog/"
        width="100%" height="820" frameborder="0"
        title="PetYears calculator" loading="lazy"
        allow="clipboard-write"></iframe>

Opcja 2: Web Component

Dodaj nasz skrypt raz, potem używaj tagu jak każdego elementu HTML. Automatycznie responsywny.

<script src="https://petyears.app/embed.js" defer></script>
<petyears-calculator animal="dog" lang="en"></petyears-calculator>

Podgląd

Reference

Animal
iframe:
path segment
Web Comp:
animal
Values:
dog, cat, rabbit, hamster, guinea-pig, horse
Language
iframe:
path segment
Web Comp:
lang
Values:
en, de, fr, it, es, pt, pl
Primary color
iframe:
?primary=2b2d5b
Web Comp:
primary
Values:
hex without #
Background color
iframe:
?bg=e8f5ee
Web Comp:
bg
Values:
hex without #
Accent color
iframe:
?accent=a0d4bc
Web Comp:
accent
Values:
hex without #
Text color
iframe:
?text=1f1d4a
Web Comp:
text
Values:
hex without #
Hide share
iframe:
?hideShare=1
Web Comp:
hide-share
Values:
boolean flag
Host URL (share target)
iframe:
?host=https://yoursite.com/page
Web Comp:
auto (top window URL)
Values:
http(s) URL — falls back to referrer, then petyears.app
Height (WC only)
iframe:
iframe height="820"
Web Comp:
height
Values:
pixels (default 820)