diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..1f4d0e8 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,50 @@ +name: Foundry VTT System Release + +on: + push: + # Der Workflow startet, sobald ein Tag gepusht wird (z.B. v1.0.4) + # Das ist sicherer als jeder normale Merge auf Main, da du so die Versionskontrolle behältst. + tags: + - "v*" + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Code auschecken + uses: actions/checkout@v4 + + - name: Node.js einrichten + uses: actions/setup-node@v4 + with: + node-size: 20 + + - name: Abhängigkeiten installieren + run: npm ci + + # Falls du Vite/Sass nutzt, entkommentiere die nächste Zeile, um dein CSS/JS zu bauen: + - name: System kompilieren + run: npm run vite:build + + - name: Release-Dateien vorbereiten (Script ausführen) + env: + GITEA_URL: ${{ gitea.server_url }} + GITEA_REPOSITORY: ${{ gitea.repository }} + GITEA_REF_NAME: ${{ gitea.ref_name }} + GITEA_REF_TYPE: ${{ gitea.ref_type }} + run: node release.js + + - name: Gitea Release erstellen und Assets hochladen + uses: actions/create-release@v1 + env: + # Dieser Token wird von Gitea automatisch bereitgestellt + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ gitea.ref_name }} + release_name: Release ${{ gitea.ref_name }} + draft: false + prerelease: false + # Hier laden wir die bearbeitete system.json und die zip hoch + files: | + system.json + system.zip diff --git a/README.md b/README.md index 92f80b0..00bfd7e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# fvtt-ts-react-boilerplate +# midgard6-lvd A TypeScript + React + Vite boilerplate for building Foundry VTT (V14) game systems on top of **ApplicationV2**, with full type safety via [`fvtt-types`](https://github.com/League-of-Foundry-Developers/foundry-vtt-types). diff --git a/assets/helmet.svg b/assets/helmet.svg new file mode 100644 index 0000000..ba2d78b --- /dev/null +++ b/assets/helmet.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/assets/sword.svg b/assets/sword.svg new file mode 100644 index 0000000..d19ad05 --- /dev/null +++ b/assets/sword.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/lang/de.json b/lang/de.json new file mode 100644 index 0000000..79ef643 --- /dev/null +++ b/lang/de.json @@ -0,0 +1,192 @@ +{ + "Midgard6": { + "name": "Name", + "Angriff": "Angriff", + "Schaden": "Schaden", + "Zaubern": "Zaubern", + "Fertigkeit": "Fertigkeit", + "Stufe": "Stufe", + "Schicksalsmünzen": "Schicksalsmünzen", + "Grad": { + "grad": "Grad", + "frei": "frei", + "eingesetzt": "eingesetzt", + "gesamt": "gesamt", + "erfahrung": "Erfahrung" + }, + "Biographie": { + "spezies": "Spezies", + "kultur": "Kultur", + "abenteuertyp": "Abenteuertyp", + "glaube": "Glaube", + "mondgestalt": "Mondgestalt" + }, + "Dialog": { + "abbrechen": "Abbrechen", + "würfeln": "Würfeln", + "speichern": "Speichern", + "löschen": "Löschen" + }, + "Gegenstand": { + "wert": "Wert", + "gewicht": "Gewicht", + "anzahl": "Anzahl" + }, + "Skills": { + "gruppen": { + "kampf": "Kampf", + "geist": "Geist", + "körper": "Körper", + "ausdruck": "Ausdruck", + "magie": "Magie" + }, + "athletik": "Athletik", + "anführen": "Anführen", + "beweglichkeit": "Beweglichkeit", + "bildung": "Bildung", + "darbietung": "Darbietung", + "einschüchterung": "Einschüchterung", + "empathie": "Empathie", + "fernkampf": "Fernkampf", + "fingerfertigkeit": "Fingerfertigkeit", + "gassenwissen": "Gassenwissen", + "handwerk": "Handwerk", + "heilkunst": "Heilkunst", + "heimlichkeit": "Heimlichkeit", + "kulturwissen": "Kulturwissen", + "nahkampf": "Nahkampf", + "manipulation": "Manipulation", + "thaumaturgie": "Thaumaturgie", + "tierführung": "Tierführung", + "überlebenskunst": "Überlebenskunst", + "überzeugen": "Überzeugen", + "wahrnehmung": "Wahrnehmung", + "zaubern": "Zaubern", + "zauberwissen": "Zauberwissen" + }, + "Attribute": { + "resistenzen": "Resistenzen", + "lp": "LP", + "ap": "AP" + }, + "Resistenzen": { + "reflexe": "Reflexe", + "willenskraft": "Willenskraft", + "zähigkeit": "Zähigkeit" + }, + "aktuell": "Aktuell", + "maximal": { + "short": "Max.", + "long": "Maximal" + }, + "Zauber": { + "zauberdauer": "Zauberdauer", + "reichweite": "Reichweite", + "wirkungsdauer": "Wirkungsdauer", + "schaden": "Schaden", + "stufe": "Stufe", + "ursprung": "Ursprung", + "ziel": "Ziel", + "wirkungsweise": "Wirkungsweise", + "vorgang": "Zaubervorgang", + "equipped": "Favorisiert" + }, + "Sheets": { + "Tabs": { + "eigenschaften": "Fertigkeiten", + "items": "Gegenstände", + "effects": "Effekte", + "zauber": "Zauber", + "biographie": "Biographie", + "hintergrund": "Hintergrund", + "sperre": "Sperre" + }, + "spezialisierung": "Spezialisierung" + }, + "Item": { + "Quantity": "Anzahl", + "Description": "Beschreibung", + "Eigenschaften": "Eigenschaften", + "rüstwert": "Rüstwert", + "schaden": "Schaden", + "fertigkeit": "Fertigkeit", + "spezialisierung": "Spezialisierung", + "waffenmerkmale": "Waffenmerkmale", + "merkmale": "Merkmale", + "einschränkung": "Einschränkung", + "helm": "Helm", + "type": { + "item": { + "singular": "Gegenstand", + "plural": "Gegenstände" + }, + "weapon": { + "singular": "Waffe", + "plural": "Waffen" + }, + "armor": { + "singular": "Rüstung", + "plural": "Rüstungen" + }, + "zauber": { + "singular": "Zauber", + "plural": "Zauber" + }, + "münze": { + "singular": "Münze", + "plural": "Münzen" + } + } + }, + "Hintergrund": { + "gruppe": "Kategorie", + "type": { + "gunst": { + "singular": "Gunst", + "plural": "Günste" + }, + "makel": { + "singular": "Makel", + "plural": "Makel" + }, + "legende": { + "singular": "Legende", + "plural": "Legenden" + }, + "schicksalsgabe": { + "singular": "Schicksalsgabe", + "plural": "Schicksalsgaben" + } + } + }, + "RollList": { + "RollMode": "Wurf-Modus" + }, + "Settings": { + "zauberAlsTag": { + "name": "Zaubereigenschaften als TAG", + "hint": "Stelle Zaubereigenschaften als TAG Liste im Chat da." + }, + "beschreibungChatActive": { + "name": "Chat-Beschreibungen automatisch ausklappen", + "hint": "Legt fest, ob Beschreibungen von Zaubern und Co. im Chat eingeklappt angezeigt werden oder vollständig." + } + } + }, + "TYPES": { + "Actor": { + "character": "Charakter" + }, + "Item": { + "item": "Gegenstand", + "weapon": "Waffe", + "armor": "Rüstung", + "zauber": "Zauber", + "gunst": "Gunst", + "makel": "Makel", + "schicksalsgabe": "Schicksalsgabe", + "legende": "Legende", + "geld": "Geld" + } + } +} diff --git a/lang/en.json b/lang/en.json index 675acb8..aeaab22 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,20 +1,181 @@ { - "BOILERPLATE": { - "Attributes": { - "strength": "Strength", - "agility": "Agility", - "spirit": "Spirit" + "Midgard6": { + "name": "Name", + "Angriff": "Angriff", + "Schaden": "Schaden", + "Fertigkeit": "Fertigkeit", + "Stufe": "Stufe", + "Schicksalsmünzen": "Schicksalsmünzen", + "Grad": { + "grad": "Grad", + "frei": "frei", + "eingesetzt": "eingesetzt", + "gesamt": "gesamt", + "erfahrung": "Erfahrung" }, - "Sheet": { - "Biography": "Biography", - "Total": "Total", - "TotalMod": "Total mod", - "ChatPlaceholder": "Say something...", - "SendToChat": "Send to chat" + "Biographie": { + "spezies": "Spezies", + "kultur": "Kultur", + "abenteuertyp": "Abenteuertyp", + "glaube": "Glaube", + "mondgestalt": "Mondgestalt" + }, + "Dialog": { + "abbrechen": "Abbrechen", + "würfeln": "Würfeln", + "speichern": "Speichern", + "löschen": "Löschen" + }, + "Gegenstand": { + "wert": "Wert", + "gewicht": "Gewicht", + "anzahl": "Anzahl" + }, + "Skills": { + "gruppen": { + "kampf": "Kampf", + "geist": "Geist", + "körper": "Körper", + "ausdruck": "Ausdruck", + "magie": "Magie" + }, + "athletik": "Athletik", + "anführen": "Anführen", + "beweglichkeit": "Beweglichkeit", + "bildung": "Bildung", + "darbietung": "Darbietung", + "einschüchterung": "Einschüchterung", + "empathie": "Empathie", + "fernkampf": "Fernkampf", + "fingerfertigkeit": "Fingerfertigkeit", + "gassenwissen": "Gassenwissen", + "handwerk": "Handwerk", + "heilkunst": "Heilkunst", + "heimlichkeit": "Heimlichkeit", + "kulturwissen": "Kulturwissen", + "nahkampf": "Nahkampf", + "manipulation": "Manipulation", + "thaumaturgie": "Thaumaturgie", + "tierführung": "Tierführung", + "überlebenskunst": "Überlebenskunst", + "überzeugen": "Überzeugen", + "wahrnehmung": "Wahrnehmung", + "zaubern": "Zaubern", + "zauberwissen": "Zauberwissen" + }, + "Attribute": { + "resistenzen": "Resistenzen", + "lp": "LP", + "ap": "AP" + }, + "Resistenzen": { + "reflexe": "Reflexe", + "willenskraft": "Willenskraft", + "zähigkeit": "Zähigkeit" + }, + "aktuell": "Aktuell", + "maximal": { + "short": "Max.", + "long": "Maximal" + }, + "Zauber": { + "zauberdauer": "Zauberdauer", + "reichweite": "Reichweite", + "wirkungsdauer": "Wirkungsdauer", + "schaden": "Schaden", + "stufe": "Stufe", + "ursprung": "Ursprung", + "ziel": "Ziel", + "wirkungsweise": "Wirkungsweise", + "vorgang": "Zaubervorgang", + "equipped": "Favorisiert" + }, + "Sheets": { + "Tabs": { + "eigenschaften": "Fertigkeiten", + "items": "Gegenstände", + "effects": "Effekte", + "zauber": "Zauber", + "biographie": "Biographie", + "hintergrund": "Hintergrund", + "sperre": "Sperre" + }, + "spezialisierung": "Spezialisierung" }, "Item": { - "Quantity": "Quantity", - "Description": "Description" + "Quantity": "Anzahl", + "Description": "Beschreibung", + "Eigenschaften": "Eigenschaften", + "rüstwert": "Rüstwert", + "schaden": "Schaden", + "fertigkeit": "Fertigkeit", + "spezialisierung": "Spezialisierung", + "waffenmerkmale": "Waffenmerkmale", + "merkmale": "Merkmale", + "einschränkung": "Einschränkung", + "helm": "Helm", + "type": { + "item": { + "singular": "Gegenstand", + "plural": "Gegenstände" + }, + "weapon": { + "singular": "Waffe", + "plural": "Waffen" + }, + "armor": { + "singular": "Rüstung", + "plural": "Rüstungen" + }, + "zauber": { + "singular": "Zauber", + "plural": "Zauber" + }, + "münze": { + "singular": "Münze", + "plural": "Münzen" + } + } + }, + "Hintergrund": { + "gruppe": "Kategorie", + "type": { + "gunst": { + "singular": "Gunst", + "plural": "Günste" + }, + "makel": { + "singular": "Makel", + "plural": "Makel" + }, + "legende": { + "singular": "Legende", + "plural": "Legenden" + }, + "schicksalsgabe": { + "singular": "Schicksalsgabe", + "plural": "Schicksalsgaben" + } + } + }, + "RollList": { + "RollMode": "Wurf-Modus" + } + }, + "TYPES": { + "Actor": { + "character": "Charakter" + }, + "Item": { + "item": "Gegenstand", + "weapon": "Waffe", + "armor": "Rüstung", + "zauber": "Zauber", + "gunst": "Gunst", + "makel": "Makel", + "schicksalsgabe": "Schicksalsgabe", + "legende": "Legende", + "geld": "Geld" } } } diff --git a/lang/fr.json b/lang/fr.json deleted file mode 100644 index 0085782..0000000 --- a/lang/fr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "BOILERPLATE": { - "Attributes": { - "strength": "Force", - "agility": "Agilité", - "spirit": "Esprit" - }, - "Sheet": { - "Biography": "Biographie", - "Total": "Total", - "TotalMod": "Modificateur total", - "ChatPlaceholder": "Dites quelque chose...", - "SendToChat": "Envoyer dans le chat" - }, - "Item": { - "Quantity": "Quantité", - "Description": "Description" - } - } -} diff --git a/package-lock.json b/package-lock.json index a568541..348d0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,12 @@ { - "name": "fvtt-ts-react-boilerplate", + "name": "midgard6-lvd", "version": "0.8.2", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "fvtt-ts-react-boilerplate", + "name": "midgard6-lvd", "version": "0.8.2", - "dependencies": { - "react": "^18.3.0", - "react-dom": "^18.3.0" - }, "devDependencies": { "@eslint/js": "^9.39.4", "@types/react": "^18.3.0", @@ -19,7 +15,7 @@ "eslint": "^9.39.4", "eslint-config-prettier": "^10.1.8", "eslint-plugin-react": "^7.37.5", - "fvtt-types": "^13.346.0-beta.20251209192131", + "fvtt-types": "^13.346.0-beta.20250812191140", "globals": "^17.7.0", "prettier": "^3.8.4", "sass": "^1.101.0", @@ -4994,9 +4990,9 @@ } }, "node_modules/fvtt-types": { - "version": "13.346.0-beta.20251209192131", - "resolved": "https://registry.npmjs.org/fvtt-types/-/fvtt-types-13.346.0-beta.20251209192131.tgz", - "integrity": "sha512-4HhASmSpoibRAo1eeEtkZCSqy68yGFuT6Mkh2nNjM35cot43yo5JBB64owGQ9PK30hY8Ko1OucdjSDf87zdYRg==", + "version": "13.346.0-beta.20250812191140", + "resolved": "https://registry.npmjs.org/fvtt-types/-/fvtt-types-13.346.0-beta.20250812191140.tgz", + "integrity": "sha512-Xa+89ZzxvaGrY507LWb0DY3s6HIOak7pXZGjRuxT+6rLRjluQduiylqAOm4ZTQCRfh7+HdbrUsmrZOKoE/xadQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5922,6 +5918,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -6332,6 +6329,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -7136,31 +7134,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -7471,9 +7444,9 @@ } }, "node_modules/sass": { - "version": "1.101.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.101.0.tgz", - "integrity": "sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==", + "version": "1.105.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.105.2.tgz", + "integrity": "sha512-KxW6ZKZiBKWK3ziQ4YZ3cpqo8/1TlHXE8t9nBNvGDZFoBFbk2MD7RacxYFs8zy8hzeFwpFYkVyAhboi47uYPEQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7491,15 +7464,6 @@ "@parcel/watcher": "^2.4.1" } }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", diff --git a/package.json b/package.json index c24774d..ceeef93 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,13 @@ { - "name": "fvtt-ts-react-boilerplate", + "name": "midgard6-lvd", "version": "0.8.2", "private": true, "type": "module", "scripts": { - "dev": "vite build --watch", - "build": "vite build", + "build": "sass src/styles/M6.scss dist/style.css --style=expanded --no-source-map", + "watch": "sass src/styles/M6.scss dist/style.css --style=expanded --source-map --watch", + "vite:build": "vite build", + "vite:watch": "vite build --watch", "typecheck": "tsc --noEmit", "lint": "eslint .", "lint:fix": "eslint . --fix", @@ -21,7 +23,7 @@ "eslint": "^9.39.4", "eslint-config-prettier": "^10.1.8", "eslint-plugin-react": "^7.37.5", - "fvtt-types": "^13.346.0-beta.20251209192131", + "fvtt-types": "^13.346.0-beta.20250812191140", "globals": "^17.7.0", "prettier": "^3.8.4", "sass": "^1.101.0", @@ -29,9 +31,5 @@ "typescript-eslint": "^8.62.0", "vite": "^5.4.0", "vitest": "^4.1.9" - }, - "dependencies": { - "react": "^18.3.0", - "react-dom": "^18.3.0" } } diff --git a/scripts/release.js b/scripts/release.js new file mode 100644 index 0000000..e1eb985 --- /dev/null +++ b/scripts/release.js @@ -0,0 +1,64 @@ +import fs from "fs"; +import path from "path"; +import archiver from "archiver"; + +// Pfade definieren (Passe an, falls dein Gitea-Benutzer/Repo-Name anders heißt) +const GITEA_URL = process.env.GITEA_URL; +const REPO = process.env.GITEA_REPOSITORY; +const RELEASE_TAG = process.env.GITEA_REF_NAME || "v1.0.0"; + +const systemJsonPath = path.resolve("./system.json"); + +// 1. system.json einlesen und Update-Pfade für Foundry patchen +const systemJson = JSON.parse(fs.readFileSync(systemJsonPath, "utf8")); + +// Wenn das Script über ein Tag läuft, nehmen wir das Tag ohne das "v" als Versionsnummer +if (process.env.GITEA_REF_TYPE === "tag") { + systemJson.version = RELEASE_TAG.replace("v", ""); +} + +// Update-URLs dynamisch generieren +systemJson.manifest = `${GITEA_URL}/api/v1/repos/${REPO}/raw/system.json`; +systemJson.download = `${GITEA_URL}/api/v1/repos/${REPO}/releases/download/${RELEASE_TAG}/system.zip`; + +// Modifizierte system.json zurückschreiben +fs.writeFileSync(systemJsonPath, JSON.stringify(systemJson, null, 2)); +console.log(`✅ system.json erfolgreich für Version ${systemJson.version} aktualisiert.`); + +// 2. zip-Archiv für Foundry erstellen +async function zipDirectory(sourceDir, outPath) { + const archive = archiver("zip", { zlib: { level: 9 } }); + const stream = fs.createWriteStream(outPath); + + return new Promise((resolve, reject) => { + archive + .directory(sourceDir, false) + .on("error", (err) => reject(err)) + .pipe(stream); + + stream.on("close", () => resolve()); + archive.finalize(); + }); +} + +// Kopiert wichtige Dateien in einen temporären Build-Ordner (dist) und zippt ihn +// Passe die Liste an, je nachdem was in deiner system.zip landen muss! +const filesToInclude = ["src/system.json", "templates", "dist", "lang", "assets"]; + +const distDir = path.resolve("./dist"); +if (!fs.existsSync(distDir)) fs.mkdirSync(distDir); + +for (const file of filesToInclude) { + if (fs.existsSync(file)) { + const dest = path.join(distDir, file); + fs.mkdirSync(path.dirname(dest), { recursive: true }); + if (fs.lstatSync(file).isDirectory()) { + fs.cpSync(file, dest, { recursive: true }); + } else { + fs.copyFileSync(file, dest); + } + } +} + +await zipDirectory(distDir, "./system.zip"); +console.log("✅ system.zip wurde erfolgreich generiert."); diff --git a/src/constants.mjs b/src/constants.mjs new file mode 100644 index 0000000..0c0dd12 --- /dev/null +++ b/src/constants.mjs @@ -0,0 +1,11 @@ +export const systemID = "midgard6-lvd"; + +/** + * Translates repository paths to Foundry Data paths. + * @param {string} path - A path relative to the root of this repository. + * @returns {string} The path relative to the Foundry data folder. + */ +export const systemPath = (path) => `systems/${systemID}/${path}`; +export const assetPath = (path) => `systems/${systemID}/assets/${path}`; + +export const swordSVG = "systems/midgard6-lvd/assets/sword.svg"; diff --git a/src/data/armor-data.mjs b/src/data/armor-data.mjs new file mode 100644 index 0000000..9cb8b11 --- /dev/null +++ b/src/data/armor-data.mjs @@ -0,0 +1,23 @@ +import { ItemData } from "./item-data.mjs"; + +function defineSchema() { + const fields = foundry.data.fields; + const baseData = ItemData.defineSchema(); + const extendData = { + rüstwert: new fields.NumberField({ + required: true, + nullable: false, + integer: true, + initial: 1, + min: 0 + }), + zusätzlich: new fields.BooleanField({ inital: false }), + equipped: new fields.BooleanField({ inital: false }) + }; + + return Object.assign(baseData, extendData); +} + +export class ArmorData extends ItemData { + static defineSchema = defineSchema; +} diff --git a/src/data/character-data.mjs b/src/data/character-data.mjs new file mode 100644 index 0000000..d51a4c0 --- /dev/null +++ b/src/data/character-data.mjs @@ -0,0 +1,380 @@ +function defineSchema() { + const fields = foundry.data.fields; + return { + locked: new fields.BooleanField({ initial: false }), + biographie: new fields.SchemaField({ + mondgestalt: new fields.StringField({ initial: "" }), + abenteuertyp: new fields.StringField({ initial: "" }), + glaube: new fields.StringField({ initial: "" }), + spezies: new fields.StringField({ initial: "" }), + kultur: new fields.StringField({ initial: "" }), + beschreibung: new fields.HTMLField({ initial: "" }) + }), + legende: new fields.HTMLField({ initial: "" }), + schicksalsmünzen: new fields.NumberField({ initital: 3, min: 0, required: true }), + grad: new fields.SchemaField({ + erfahrungspunkteFrei: new fields.NumberField({ + required: true, + min: 0, + initial: 0 + }), + erfahrungspunkteEingesetzt: new fields.NumberField({ + required: true, + min: 0, + initial: 0 + }), + erfahrungsschatz: new fields.NumberField({ + required: true, + min: 0, + initial: 0 + }), + grad: new fields.NumberField({ + required: true, + min: 1, + initial: 1 + }) + }), + rüstwert: new fields.SchemaField({ + base: new fields.NumberField({ + required: true, + min: 0, + initial: 0 + }), + mod: new fields.NumberField({ + required: true, + initial: 0 + }) + }), + resources: new fields.SchemaField({ + leben: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + min: 0, + initial: 4 + }), + max: new fields.NumberField({ + required: true, + initial: 8 + }) + }), + ausdauer: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + min: 0, + initial: 4 + }), + max: new fields.NumberField({ + required: true, + initial: 44 + }) + }) + }), + resistenzen: new fields.SchemaField( + { + reflexe: new fields.NumberField({ + required: true, + nullable: false, + min: 0, + initial: 4 + }), + willenskraft: new fields.NumberField({ + required: true, + nullable: false, + min: 0, + initial: 4 + }), + zähigkeit: new fields.NumberField({ + required: true, + nullable: false, + min: 0, + initial: 4 + }) + }, + { label: "resistenzen" } + ), + skills: new fields.SchemaField({ + kampf: new fields.SchemaField( + { + anführen: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "anführen" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + fernkampf: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "fernkampf" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + nahkampf: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "nahkampf" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }) + }, + { label: "kampf" } + ), + körper: new fields.SchemaField( + { + athletik: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "athletik" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + beweglichkeit: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "beweglichkeit" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + fingerfertigkeit: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "fingerfertigkeit" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + heimlichkeit: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "heimlichkeit" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + wahrnehmung: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "wahrnehmung" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }) + }, + { label: "körper" } + ), + ausdruck: new fields.SchemaField( + { + darbietung: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "darbietung" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + einschüchterung: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "einschüchterung" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + empathie: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "empathie" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + gassenwissen: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "gassenwissen" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + manipulation: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "manipulation" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + überzeugen: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "überzeugen" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }) + }, + { label: "ausdruck" } + ), + geist: new fields.SchemaField( + { + bildung: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "bildung" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + handwerk: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "handwerk" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + heilkunst: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "heilkunst" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + kulturwissen: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "kulturwissen" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + tierführung: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "tierführung" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + überlebenskunst: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "überlebenskunst" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }) + }, + { label: "geist" } + ), + magie: new fields.SchemaField( + { + thaumaturgie: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "thaumaturgie" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + zaubern: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "zaubern" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }), + zauberwissen: new fields.SchemaField({ + value: new fields.NumberField({ + required: true, + nullable: false, + max: 15, + min: 5, + initial: 5, + label: "zauberwissen" + }), + bonuses: new fields.ArrayField(new fields.ObjectField()) + }) + }, + { label: "magie" } + ) + }) + }; +} + +export class CharacterData extends foundry.abstract.TypeDataModel { + static defineSchema = defineSchema; +} diff --git a/src/data/character-data.ts b/src/data/character-data.ts deleted file mode 100644 index 506ecb7..0000000 --- a/src/data/character-data.ts +++ /dev/null @@ -1,33 +0,0 @@ -function defineSchema() { - const fields = foundry.data.fields; - return { - biography: new fields.HTMLField({ initial: "" }), - attributes: new fields.SchemaField({ - strength: new fields.NumberField({ - required: true, - nullable: false, - integer: true, - initial: 10 - }), - agility: new fields.NumberField({ - required: true, - nullable: false, - integer: true, - initial: 10 - }), - spirit: new fields.NumberField({ - required: true, - nullable: false, - integer: true, - initial: 10 - }) - }) - }; -} - -export class CharacterData extends foundry.abstract.TypeDataModel< - ReturnType, - Actor.Implementation -> { - static defineSchema = defineSchema; -} diff --git a/src/data/hintergrund-data.mjs b/src/data/hintergrund-data.mjs new file mode 100644 index 0000000..4c98e13 --- /dev/null +++ b/src/data/hintergrund-data.mjs @@ -0,0 +1,12 @@ +function defineSchema() { + const fields = foundry.data.fields; + return { + beschreibung: new fields.HTMLField({ initial: "" }), + gruppe: new fields.StringField({ initial: "" }), + linkId: new fields.StringField({ initial: "" }) + }; +} + +export class HintergrundData extends foundry.abstract.TypeDataModel { + static defineSchema = defineSchema; +} diff --git a/src/data/item-data.mjs b/src/data/item-data.mjs new file mode 100644 index 0000000..5971533 --- /dev/null +++ b/src/data/item-data.mjs @@ -0,0 +1,34 @@ +function defineSchema() { + const fields = foundry.data.fields; + return { + beschreibung: new fields.HTMLField({ initial: "" }), + anzahl: new fields.NumberField({ + required: true, + nullable: false, + integer: true, + initial: 1, + min: 0 + }), + wert: new fields.NumberField({ + required: true, + nullable: false, + integer: true, + initial: 1, + step: 1, + min: 0 + }), + gewicht: new fields.NumberField({ + required: true, + nullable: false, + integer: true, + initial: 1, + step: 1, + min: 0 + }), + merkmale: new fields.ArrayField(new fields.StringField({}), { initial: [] }) + }; +} + +export class ItemData extends foundry.abstract.TypeDataModel { + static defineSchema = defineSchema; +} diff --git a/src/data/item-data.ts b/src/data/item-data.ts deleted file mode 100644 index 332263d..0000000 --- a/src/data/item-data.ts +++ /dev/null @@ -1,20 +0,0 @@ -function defineSchema() { - const fields = foundry.data.fields; - return { - description: new fields.HTMLField({ initial: "" }), - quantity: new fields.NumberField({ - required: true, - nullable: false, - integer: true, - initial: 1, - min: 0 - }) - }; -} - -export class ItemData extends foundry.abstract.TypeDataModel< - ReturnType, - Item.Implementation -> { - static defineSchema = defineSchema; -} diff --git a/src/data/weapon-data.mjs b/src/data/weapon-data.mjs new file mode 100644 index 0000000..4b198e4 --- /dev/null +++ b/src/data/weapon-data.mjs @@ -0,0 +1,19 @@ +import { ItemData } from "./item-data.mjs"; + +function defineSchema() { + const fields = foundry.data.fields; + const baseData = ItemData.defineSchema(); + const extendData = { + schaden: new fields.StringField({ initial: "1d6" }), + equipped: new fields.BooleanField({ inital: false }), + fertigkeit: new fields.StringField({ initial: "system.skills.kampf.nahkampf" }), + spezialisierung: new fields.StringField({ initial: "" }), + customRoll: new fields.StringField({ initial: "" }) + }; + + return Object.assign(baseData, extendData); +} + +export class WeaponData extends ItemData { + static defineSchema = defineSchema; +} diff --git a/src/data/zauber-data.mjs b/src/data/zauber-data.mjs new file mode 100644 index 0000000..2c5d52b --- /dev/null +++ b/src/data/zauber-data.mjs @@ -0,0 +1,29 @@ +function defineSchema() { + const fields = foundry.data.fields; + return { + beschreibung: new fields.HTMLField({ initial: "" }), + eigenschaften: new fields.SchemaField({ + stufe: new fields.NumberField({ + required: true, + nullable: false, + integer: true, + initial: 0, + min: 0, + max: 3 + }), + ursprung: new fields.StringField({ initial: "Kleiner Zauber" }), + schaden: new fields.StringField({ initial: "" }), + reichweite: new fields.StringField({ initial: "Kurz" }), + zauberdauer: new fields.StringField({ initial: "1 Aktion" }), + wirkungsdauer: new fields.StringField({ initial: "1 Runde" }), + wirkungsweise: new fields.StringField({ initial: "Einfluss" }), + ziel: new fields.StringField({ initial: "1 Wesen" }), + vorgang: new fields.StringField({ initial: "Geste" }) + }), + equipped: new fields.BooleanField({ initial: false }) + }; +} + +export class ZauberData extends foundry.abstract.TypeDataModel { + static defineSchema = defineSchema; +} diff --git a/src/helpers/handlebar-helpers.mjs b/src/helpers/handlebar-helpers.mjs new file mode 100644 index 0000000..d79b97f --- /dev/null +++ b/src/helpers/handlebar-helpers.mjs @@ -0,0 +1,33 @@ +export const loadHelpers = async function () { + Handlebars.registerHelper("ifeq", function (arg1, arg2, options) { + return arg1 == arg2 ? options.fn(this) : options.inverse(this); + }); + + Handlebars.registerHelper("unlesseq", function (arg1, arg2, options) { + return arg1 != arg2 ? options.fn(this) : options.inverse(this); + }); + + Handlebars.registerHelper("fetchPath", function (actor, arg1, arg2 = "") { + let arg = arg1; + if (typeof arg2 === "string") { + arg = arg + "" + arg2; + } + return foundry.utils.getProperty(actor, arg); + }); + + Handlebars.registerHelper("isdefined", function (value, options) { + return value !== undefined ? options.fn(this) : options.inverse(this); + }); + + Handlebars.registerHelper("localizeConcat", function (arg1, arg2) { + return game.i18n?.localize(arg1 + arg2); + }); + + Handlebars.registerHelper("splitArray", function (arr) { + if (!Array.isArray(arr)) { + return ""; + } + + return arr.join(", "); + }); +}; diff --git a/src/helpers/partials.mjs b/src/helpers/partials.mjs new file mode 100644 index 0000000..e8914f0 --- /dev/null +++ b/src/helpers/partials.mjs @@ -0,0 +1,6 @@ +export const loadPartials = async function () { + await foundry.applications.handlebars.loadTemplates([ + "systems/midgard6-lvd/templates/chat/chat-message-header.hbs", + "systems/midgard6-lvd/templates/chat/secret-roll.hbs" + ]); +}; diff --git a/src/helpers/settings.mjs b/src/helpers/settings.mjs new file mode 100644 index 0000000..ce25cbf --- /dev/null +++ b/src/helpers/settings.mjs @@ -0,0 +1,21 @@ +export const loadSettings = async function () { + game.settings.register("midgard6-lvd", "zauberAlsTag", { + name: game.i18n.localize("Midgard6.Settings.zauberAlsTag.name"), + hint: game.i18n.localize("Midgard6.Settings.zauberAlsTag.hint"), + scope: "user", + config: true, + default: false, + type: Boolean, + requiresReload: true + }); + + // Automatically collapse chat message descriptions + game.settings.register("midgard6-lvd", "beschreibungChatActive", { + name: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.name"), + hint: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.hint"), + scope: "client", + config: true, + default: false, + type: Boolean + }); +}; diff --git a/src/helpers/utils.mjs b/src/helpers/utils.mjs new file mode 100644 index 0000000..f671895 --- /dev/null +++ b/src/helpers/utils.mjs @@ -0,0 +1,57 @@ +/** + * Searches through an object recursively and localizes strings. + * @param {Record} object + */ +export function localizeHelper(object) { + for (const [key, value] of Object.entries(object)) { + // const type = foundry.utils.getType(value) + switch (typeof value) { + case "object": + if (value) localizeHelper(value); + break; + case "string": + if (key === "label") object[key] = game.i18n.localize(value); + break; + } + } +} + +/* -------------------------------------------------- */ + +/** + * Prepare the data structure for Active Effects which are currently embedded in an Actor or Item. + * @param {ActiveEffect[]} effects A collection or generator of Active Effect documents to prepare sheet data for. + * @return {object} Data for rendering. + */ +export function prepareActiveEffectCategories(effects) { + const categories = { + temporary: { + type: "temporary", + label: game.i18n.localize("M6.Effect.Temporary"), + effects: [] + }, + passive: { + type: "passive", + label: game.i18n.localize("M6.Effect.Passive"), + effects: [] + }, + inactive: { + type: "inactive", + label: game.i18n.localize("M6.Effect.Inactive"), + effects: [] + } + }; + + // Iterate over active effects, classifying them into categories + for (const e of effects) { + if (!e.active) categories.inactive.effects.push(e); + else if (e.isTemporary) categories.temporary.effects.push(e); + else categories.passive.effects.push(e); + } + + // Sort each category + for (const c of Object.values(categories)) { + c.effects.sort((a, b) => (a.sort || 0) - (b.sort || 0)); + } + return categories; +} diff --git a/src/i18n.ts b/src/i18n.mjs similarity index 100% rename from src/i18n.ts rename to src/i18n.mjs diff --git a/src/sheets/armor-sheet.mjs b/src/sheets/armor-sheet.mjs new file mode 100644 index 0000000..e6ad70c --- /dev/null +++ b/src/sheets/armor-sheet.mjs @@ -0,0 +1,79 @@ +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { systemPath } from "../constants.mjs"; +import { M6ItemSheet } from "./item-sheet.mjs"; +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ItemSheet with some very simple modifications. + */ +export class M6ArmorSheet extends M6ItemSheet { + static get DEFAULT_OPTIONS() { + return { + ...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet + actions: { + ...super.DEFAULT_OPTIONS.actions, + cycleEquip: this.#cycleEquip, // Fügt NUR für dieses Sheet die neue Action hinzu + cycleHelmet: this.#cycleHelmet + } + }; + } + + static TABS = { + primary: { + tabs: [ + { + id: "eigenschaften", + icon: "fa-shield-halved" + }, + { + id: "beschreibung", + icon: "fa-feather-pointed" + }, + { + id: "effects", + icon: "fa-bolt" + } + ], + initial: "eigenschaften", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /** @inheritdoc */ + static PARTS = { + header: { + template: systemPath("templates/item/header.hbs") + }, + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + eigenschaften: { + template: systemPath("templates/item/rüstung/eigenschaften.hbs"), + scrollable: [""] + }, + beschreibung: { + template: systemPath("templates/item/description.hbs"), + scrollable: [""] + }, + effects: { + template: systemPath("templates/shared/effects.hbs"), + scrollable: [""] + } + }; + + static #cycleEquip() { + this.item.update({ + system: { + equipped: !this.item.system.equipped + } + }); + } + + static #cycleHelmet() { + this.item.update({ + system: { + zusätzlich: !this.item.system.zusätzlich + } + }); + } +} diff --git a/src/sheets/character-sheet.mjs b/src/sheets/character-sheet.mjs new file mode 100644 index 0000000..77c456c --- /dev/null +++ b/src/sheets/character-sheet.mjs @@ -0,0 +1,829 @@ +import { systemPath } from "../constants.mjs"; +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { addSpezialisierung, editSepzialisierung } from "./components/spezialisierung-actions.mjs"; +import { prepArmor, prepWeapons, prepWeight, prepSpells } from "./components/character-prep.mjs"; +import { rollSpell, rollWeapon, rollSkill } from "./components/roll-actions.mjs"; + +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ActorSheet with some very simple modifications. + */ +export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorSheetV2) { + /** @inheritdoc */ + static DEFAULT_OPTIONS = { + classes: ["M6", "actor"], + window: { + resizable: true + }, + position: { + width: 800, + height: 800 + }, + actions: { + viewDoc: this.#viewDoc, + createDoc: this.#createDoc, + deleteDoc: this.#deleteDoc, + toggleEffect: this.#toggleEffect, + rollSkill: rollSkill, + rollWeapon: rollWeapon, + rollSpell: rollSpell, + cycleEquip: this.#cycleEquip, + cycleLock: this.#cycleLock, + addSpezialisierung: addSpezialisierung, + editSepzialisierung: editSepzialisierung, + increaseDoc: this.#increaseDoc, + decreaseDoc: this.#decreaseDoc + }, + form: { + submitOnChange: true + }, + dragDrop: [{ dragSelector: ".draggable", dropSelector: null }] + }; + + /* -------------------------------------------------- */ + + static TABS = { + primary: { + tabs: [ + { + id: "eigenschaften", + icon: "fa-shield-halved" + }, + + { + id: "items", + icon: "fa-suitcase" + }, + { + id: "zauber", + icon: "fa-hand-sparkles" + }, + { + id: "hintergrund", + icon: "fa-list" + }, + { + id: "biographie", + icon: "fa-feather-pointed" + }, + { + id: "effects", + icon: "fa-bolt" + } + ], + initial: "eigenschaften", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + static PARTS = { + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + header: { + template: systemPath("templates/actor/header.hbs") + }, + eigenschaften: { + template: systemPath("templates/actor/eigenschaften.hbs"), + scrollable: [""] + }, + zauber: { + template: systemPath("templates/actor/zauber.hbs"), + scrollable: [""] + }, + items: { + template: systemPath("templates/actor/items.hbs"), + scrollable: [""] + }, + hintergrund: { + template: systemPath("templates/actor/hintergrund.hbs"), + scrollable: [""] + }, + biographie: { + template: systemPath("templates/actor/biographie.hbs"), + scrollable: [""] + }, + effects: { + template: systemPath("templates/shared/effects.hbs"), + scrollable: [""] + } + }; + + _attachPartListeners(partId, html, bubble) { + super._attachPartListeners(partId, html, bubble); + + switch (partId) { + case "hintergrund": + const collapsible = html.querySelectorAll("div[data-action=collapsible]"); + if (collapsible) { + collapsible.forEach((node) => { + node.addEventListener( + "click", + function () { + node.classList.toggle("active"); + var content = node.nextElementSibling; + content.classList.toggle("active"); + node.getElementsByTagName("i")[0].classList.toggle("fa-compress"); + }, + { capture: true } + ); + }); + } + break; + } + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + _initializeApplicationOptions(options) { + const initialized = super._initializeApplicationOptions(options); + + initialized.classes.push(initialized.document.type); + + return initialized; + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + async _prepareContext(options) { + const context = await super._prepareContext(options); + + Object.assign(context, { + owner: this.document.isOwner, + limited: this.document.limited, + actor: this.actor, + system: this.actor.system, + skills: this.actor.system.skills, + flags: this.actor.flags, + config: CONFIG + }); + console.warn(context); + return context; + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + async _preparePartContext(partId, context) { + switch (partId) { + case "effects": + context.effects = prepareActiveEffectCategories(this.actor.allApplicableEffects()); + context.tab = context.tabs[partId]; + break; + case "eigenschaften": + context.armor = await prepArmor(this.actor); + context.skills = await this._getSkills(); + context.resistenzen = await this._getResistenzen(); + context.equippedWeapons = await prepWeapons(this.actor); + context.equippedSpells = await prepSpells(this.actor); + context.tab = context.tabs[partId]; + break; + case "items": + context.itemTypes = await this._getItems(); + context.gewicht = await prepWeight(this.actor); + context.tab = context.tabs[partId]; + break; + case "zauber": + context.zauber = await this._getZauber(); + context.tab = context.tabs[partId]; + break; + case "hintergrund": + context.fields = await this._getFields(); + context.tab = context.tabs[partId]; + break; + case "biographie": + context.enrichedBeschreibung = + await foundry.applications.ux.TextEditor.implementation.enrichHTML( + this.actor.system.biographie.beschreibung, + { + // Whether to show secret blocks in the finished html + secrets: this.document.isOwner, + // Data to fill in for inline rolls + rollData: this.actor.getRollData(), + // Relative UUID resolution + relativeTo: this.actor + } + ); + context.tab = context.tabs[partId]; + break; + default: + context.tab = context.tabs[partId]; + } + return context; + } + + /** + * Handles the system fields for the form-fields generic. + * @returns {object[]} + */ + async _getFields() { + const doc = this.actor; + const source = doc._source; + const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields; + const fieldSets = []; + // TODO: Find a clever way to handle enrichment + for (const field of Object.values(systemFields ?? {})) { + const path = `system.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + const fieldset = { fieldset: true, legend: field.label, fields: [] }; + await this.#addSystemFields(fieldset, field.fields, source, path); + fieldSets.push(fieldset); + } else { + fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } }); + } + } + return fieldSets; + } + + /* -------------------------------------------------- */ + + async _getSkills() { + const doc = this.actor; + const source = doc._source; + const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.skills.fields; + const fieldSets = []; + // TODO: Find a clever way to handle enrichment + for (const field of Object.values(systemFields ?? {})) { + const path = `system.skills.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + const fieldset = { + fieldset: true, + legend: `Midgard6.Skills.gruppen.${field.label}`, + fields: [] + }; + await this.#addSkillFields(fieldset, field.fields, source, path); + fieldSets.push(fieldset); + } else { + fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } }); + } + } + return fieldSets; + } + + async #addSkillFields(fieldset, schema, source, _path = "system") { + for (const field of Object.values(schema)) { + const path = `${_path}.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + this.#addSkillFields(fieldset, field.fields, source, path); + } else if (field.constructor.hasFormSupport) { + fieldset.fields.push({ + field, + value: foundry.utils.getProperty(source, path), + localizationName: "Midgard6.Skills." + field.label, + bonuses: foundry.utils.getProperty(source, _path).bonuses + }); + } + } + } + + /* -------------------------------------------------- */ + + async _getResistenzen() { + const doc = this.actor; + const source = doc._source; + const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.resistenzen; + const fieldset = { + fieldset: true, + legend: `Midgard6.Attribute.${systemFields.label}`, + fields: [] + }; + for (const field of Object.values(systemFields.fields ?? {})) { + const path = `system.resistenzen.${field.name}`; + fieldset.fields.push({ + field, + value: foundry.utils.getProperty(source, path), + localizationName: "Midgard6.Resistenzen." + field.name + }); + } + return fieldset; + } + + async _getResources() { + const doc = this.actor; + const source = doc._source; + const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.resources.fields; + const fieldSets = []; + // TODO: Find a clever way to handle enrichment + for (const field of Object.values(systemFields ?? {})) { + const path = `system.skills.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + const fieldset = { + fieldset: true, + legend: `Midgard6.resources.${field.label}`, + fields: [] + }; + await this.#addSystemFields(fieldset, field.fields, source, path); + fieldSets.push(fieldset); + } else { + fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } }); + } + } + return fieldSets; + } + + static async #cycleEquip(event, target) { + const item = this.actor.items.get(target.dataset.itemId); + item.update({ + system: { + equipped: !item.system.equipped + } + }); + } + + static async #cycleLock(event) { + const actor = this.actor; + + // Update the locked state + actor.update({ "system.locked": !actor.system.locked }); + } + + /* -------------------------------------------------- */ + + /** + * Recursively add system model fields to the fieldset. + */ + async #addSystemFields(fieldset, schema, source, _path = "system") { + for (const field of Object.values(schema)) { + const path = `${_path}.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + this.#addSystemFields(fieldset, field.fields, source, path); + } else if (field.constructor.hasFormSupport) { + fieldset.fields.push({ + field, + value: foundry.utils.getProperty(source, path), + localizationName: "Midgard6.Skills." + field.label + }); + } + } + } + + /* -------------------------------------------------- */ + + /** + * Adapted from Actor#itemTypes. + */ + _getItems() { + const types = Object.fromEntries( + game.documentTypes.Item.map((t) => { + return [t, { label: game.i18n.localize(CONFIG.Item.typeLabels[t]), items: [] }]; + }) + ); + for (const item of this.actor.items) { + types[item.type].items.push(item); + } + + for (const item of this.actor.items) { + types[item.type].items.sort((a, b) => a.sort - b.sort); + } + // Only show Base if it's actually being used + if (types.base.items.length === 0) delete types.base; + return types; + } + + _getZauber() { + return this.actor.items.filter((item) => item.type === "zauber"); + } + + /* -------------------------------------------------- */ + + /** + * Actions performed after any render of the Application. + * Post-render steps are not awaited by the render process. + * @param {ApplicationRenderContext} context Prepared context data. + * @param {RenderOptions} options Provided render options. + * @protected + * @inheritdoc + */ + async _onRender(context, options) { + await super._onRender(context, options); + this.#disableOverrides(); + } + + /* -------------------------------------------------- */ + /* Event handlers */ + /* -------------------------------------------------- */ + + static async #increaseDoc(event, target) { + const item = this.actor.items.get(target.dataset.itemId); + if (event.shiftKey || event.ctrlKey) { + return item.update({ ["system.anzahl"]: (item.system.anzahl += 10) }); + } + return item.update({ ["system.anzahl"]: (item.system.anzahl += 1) }); + } + + static async #decreaseDoc(event, target) { + const item = this.actor.items.get(target.dataset.itemId); + if (event.shiftKey || event.ctrlKey) { + return item.update({ ["system.anzahl"]: (item.system.anzahl -= 10) }); + } + return item.update({ ["system.anzahl"]: (item.system.anzahl -= 1) }); + } + + /** + * Renders an embedded document's sheet. + * + * @this M6ActorSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @protected + */ + static async #viewDoc(event, target) { + const doc = this._getEmbeddedDocument(target); + doc.sheet.render(true); + } + + /* -------------------------------------------------- */ + + /** + * Handles item deletion. + * + * @this M6ActorSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @protected + */ + static async #deleteDoc(event, target) { + const doc = this._getEmbeddedDocument(target); + doc.delete(); + } + + /* -------------------------------------------------- */ + + /** + * Handle creating a new Owned Item or ActiveEffect for the actor using initial data defined in the HTML dataset. + * + * @this M6ActorSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @private + */ + static async #createDoc(event, target) { + const docCls = getDocumentClass(target.dataset.documentClass); + const docData = { + name: docCls.defaultName({ + type: target.dataset.type, + parent: this.actor + }) + }; + for (const [dataKey, value] of Object.entries(target.dataset)) { + if (["action", "documentClass"].includes(dataKey)) continue; + foundry.utils.setProperty(docData, dataKey, value); + } + docCls.create(docData, { parent: this.actor }); + } + + /* -------------------------------------------------- */ + + /** + * Determines effect parent to pass to helper. + * + * @this M6ActorSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @private + */ + static async #toggleEffect(event, target) { + const effect = this._getEmbeddedDocument(target); + effect.update({ disabled: !effect.disabled }); + } + + /* -------------------------------------------------- */ + /* Helper functions */ + /* -------------------------------------------------- */ + + /** + * Fetches the embedded document representing the containing HTML element. + * + * @param {HTMLElement} target The element subject to search. + * @returns {Item|ActiveEffect} The embedded Item or ActiveEffect. + */ + _getEmbeddedDocument(target) { + const docRow = target.closest("[data-document-class]"); + if (docRow.dataset.documentClass === "Item") { + return this.actor.items.get(docRow.dataset.itemId); + } else if (docRow.dataset.documentClass === "ActiveEffect") { + const parent = + docRow.dataset.parentId === this.actor.id + ? this.actor + : this.actor.items.get(docRow?.dataset.parentId); + return parent.effects.get(docRow.dataset.effectId); + } else { + console.warn("Could not find document class"); + } + } + + /* -------------------------------------------------- */ + /* Actor override handling */ + /* -------------------------------------------------- */ + + /** + * Submit a document update based on the processed form data. + * @param {SubmitEvent} event The originating form submission event. + * @param {HTMLFormElement} form The form element that was submitted. + * @param {object} submitData Processed and validated form data to be used for a document update. + * @returns {Promise} + * @protected + * @inheritdoc + */ + async _processSubmitData(event, form, submitData) { + const overrides = foundry.utils.flattenObject(this.actor.overrides); + for (const k of Object.keys(overrides)) delete submitData[k]; + this.document.update(submitData); + } + + /* -------------------------------------------------- */ + + /** + * Disables inputs subject to active effects. + */ + #disableOverrides() { + const flatOverrides = foundry.utils.flattenObject(this.actor.overrides); + for (const override of Object.keys(flatOverrides)) { + const input = this.element.querySelector(`[name="${override}"]`); + if (input) input.disabled = true; + } + } + + /* -------------------------------------------------- */ + /* Drag and drop */ + /* -------------------------------------------------- */ + + /** + * Define whether a user is able to begin a dragstart workflow for a given drag selector. + * @param {string} selector The candidate HTML selector for dragging. + * @returns {boolean} Can the current user drag this selector? + * @protected + */ + _canDragStart(selector) { + return this.isEditable; + } + + /* -------------------------------------------------- */ + + /** + * Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector. + * @param {string} selector The candidate HTML selector for the drop target. + * @returns {boolean} Can the current user drop on this selector? + * @protected + */ + _canDragDrop(selector) { + return this.isEditable; + } + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur at the beginning of a drag start workflow. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + _onDragStart(event) { + const li = event.currentTarget; + const dataset = event.target.dataset; + + if ("link" in event.target.dataset) return; + + let dragData = null; + + if (li.dataset.effectId) { + const effect = this.item.effects.get(li.dataset.effectId); + dragData = effect.toDragData(); + } + + dragData = { + type: dataset.type, + itemId: dataset.itemId + }; + + if (!dragData) return; + + event.dataTransfer.setData("text/plain", JSON.stringify(dragData)); + } + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur when a dragged element is over a drop target. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + _onDragOver(event) {} + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur when a dragged element is dropped on a target. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + async _onDrop(event) { + const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); + const item = this.item; + + const allowed = Hooks.call("dropItemSheetData", item, this, data); + if (allowed === false) return; + // Handle different data types + switch (data.type) { + case "ActiveEffect": + return this._onDropActiveEffect(event, data); + case "Actor": + return this._onDropActor(event, data); + case "Item": + return this._onDropItem(event, data); + case "Folder": + return this._onDropFolder(event, data); + } + } + + /* -------------------------------------------------- */ + + /** + * Handle the dropping of ActiveEffect data onto an Actor Sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} The created ActiveEffect object or false if it couldn't be created. + * @protected + */ + async _onDropActiveEffect(event, data) { + const aeCls = getDocumentClass("ActiveEffect"); + const effect = await aeCls.fromDropData(data); + if (!this.item.isOwner || !effect) return false; + + if (this.item.uuid === effect.parent?.uuid) return this._onEffectSort(event, effect); + aeCls.create(effect, { parent: this.item }); + } + + /* -------------------------------------------------- */ + + /** + * Sorts an Active Effect based on its surrounding attributes. + * + * @param {DragEvent} event + * @param {ActiveEffect} effect + */ + _onEffectSort(event, effect) { + const effects = this.item.effects; + const dropTarget = event.target.closest("[data-effect-id]"); + if (!dropTarget) return; + const target = effects.get(dropTarget.dataset.effectId); + + // Don't sort on yourself + if (effect.id === target.id) return; + + // Identify sibling items based on adjacent HTML elements + const siblings = []; + for (let el of dropTarget.parentElement.children) { + const siblingId = el.dataset.effectId; + if (siblingId && siblingId !== effect.id) siblings.push(effects.get(el.dataset.effectId)); + } + + // Perform the sort + const sortUpdates = foundry.utils.performIntegerSort(effect, { + target, + siblings + }); + const updateData = sortUpdates.map((u) => { + const update = u.update; + update._id = u.target._id; + return update; + }); + + // Perform the update + this.item.updateEmbeddedDocuments("ActiveEffect", updateData); + } + + /* -------------------------------------------------- */ + + /** + * Handle dropping of an Actor data onto another Actor sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} A data object which describes the result of the drop, or false if the drop was + * not permitted. + * @protected + */ + async _onDropActor(event, data) { + if (!this.item.isOwner) return false; + } + + /* -------------------------------------------------- */ + + async _onDropItemCreate(actor, itemData) { + itemData = itemData instanceof Array ? itemData : [itemData]; + return actor.createEmbeddedDocuments("Item", itemData); + } + + /** + * Handle dropping of an item reference or item data onto an Actor Sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} The created or updated Item instances, or false if the drop was not permitted. + * @protected + */ + async _onDropItem(event, data) { + if (!this.actor.isOwner) return false; + + if (this.actor.items.get(data.itemId)) return this._onSortItem(event, data); + + const item = await Item.implementation.fromDropData(data); + const itemData = item.toObject(); + + return this._onDropItemCreate(this.actor, itemData); + } + + /** + * Handle a drop event for an existing embedded Item to sort that Item relative to its siblings + * @param {Event} event + * @param {Item} item + * @private + */ + _onSortItem(event, item) { + // Get the drag source and drop target + const items = this.actor.items; + const dropTarget = event.target.closest("[data-item-id]"); + const source = items.get(item.itemId); + if (!dropTarget) return; + const target = items.get(dropTarget.dataset.itemId); + // Don't sort on yourself + if (source.id === target.id) return; + // Identify sibling items based on adjacent HTML elements + const siblings = []; + for (let el of dropTarget.parentElement.children) { + const siblingId = el.dataset.itemId; + if (siblingId && siblingId !== source.id) siblings.push(items.get(siblingId)); + } + + // Perform the sort + const sortUpdates = foundry.utils.performIntegerSort(source, { + target, + siblings + }); + const updateData = sortUpdates.map((u) => { + const update = u.update; + update._id = u.target.id; + return update; + }); + + // Perform the update + return this.actor.updateEmbeddedDocuments("Item", updateData); + } + + /* -------------------------------------------------- */ + + /** + * Handle dropping of a Folder on an Actor Sheet. + * The core sheet currently supports dropping a Folder of Items to create all items as owned items. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} + * @protected + */ + async _onDropFolder(event, data) { + if (!this.item.isOwner) return []; + } + + /* -------------------------------------------------- */ + /* The following pieces set up drag */ + /* handling and are unlikely to need modification */ + /* -------------------------------------------------- */ + + // This is marked as private because there's no real need + // for subclasses or external hooks to mess with it directly + #dragDrop = this.#createDragDropHandlers(); + + /** + * Returns an array of DragDrop instances. + * @type {DragDrop[]} + */ + get dragDrop() { + return this.#dragDrop; + } + + /* -------------------------------------------------- */ + + /** + * Create drag-and-drop workflow handlers for this Application. + * @returns {DragDrop[]} An array of DragDrop handlers. + * @private + */ + #createDragDropHandlers() { + return this.options.dragDrop.map((d) => { + d.permissions = { + dragstart: this._canDragStart.bind(this), + drop: this._canDragDrop.bind(this) + }; + d.callbacks = { + dragstart: this._onDragStart.bind(this), + dragover: this._onDragOver.bind(this), + drop: this._onDrop.bind(this) + }; + return new foundry.applications.ux.DragDrop(d); + }); + } +} diff --git a/src/sheets/character-sheet.ts b/src/sheets/character-sheet.ts deleted file mode 100644 index 1bb7ebf..0000000 --- a/src/sheets/character-sheet.ts +++ /dev/null @@ -1,32 +0,0 @@ -import React from "react"; -import { createRoot, type Root } from "react-dom/client"; -import { CharacterSheetApp } from "./components/CharacterSheetApp"; - -export class CharacterSheet extends foundry.applications.sheets.ActorSheetV2 { - static DEFAULT_OPTIONS = { - classes: ["fvtt-ts-react-boilerplate", "sheet", "actor"], - position: { width: 600, height: 480 } - }; - - #root: Root | null = null; - - override async _renderHTML( - ...args: Parameters - ) { - return args[0]; - } - - override _replaceHTML( - ...args: Parameters - ) { - const content = args[1]; - if (!this.#root) this.#root = createRoot(content); - this.#root.render(React.createElement(CharacterSheetApp, { actor: this.document })); - } - - override async close(...args: Parameters) { - this.#root?.unmount(); - this.#root = null; - return super.close(...args); - } -} diff --git a/src/sheets/components/CharacterSheetApp.logic.test.ts b/src/sheets/components/CharacterSheetApp.logic.test.ts deleted file mode 100644 index d0931eb..0000000 --- a/src/sheets/components/CharacterSheetApp.logic.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { fmtMod, modifier } from "./CharacterSheetApp.logic"; - -describe("modifier", () => { - it("matches the d20-style table around the 10 baseline", () => { - expect(modifier(10)).toBe(0); - expect(modifier(11)).toBe(0); - expect(modifier(12)).toBe(1); - expect(modifier(9)).toBe(-1); - expect(modifier(20)).toBe(5); - }); -}); - -describe("fmtMod", () => { - it("prefixes non-negative values with +", () => { - expect(fmtMod(0)).toBe("+0"); - expect(fmtMod(3)).toBe("+3"); - }); - - it("leaves negative values as-is", () => { - expect(fmtMod(-2)).toBe("-2"); - }); -}); diff --git a/src/sheets/components/CharacterSheetApp.logic.ts b/src/sheets/components/CharacterSheetApp.logic.ts deleted file mode 100644 index f19cda1..0000000 --- a/src/sheets/components/CharacterSheetApp.logic.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Pure game-logic helpers, deliberately kept free of any Foundry global. -// Code that touches `actor`/`ChatMessage`/etc. needs a running Foundry instance -// and isn't realistically unit-testable — this is the boundary to keep that out. -export const modifier = (score: number) => Math.floor((score - 10) / 2); - -export const fmtMod = (mod: number) => (mod >= 0 ? `+${mod}` : `${mod}`); diff --git a/src/sheets/components/CharacterSheetApp.module.scss b/src/sheets/components/CharacterSheetApp.module.scss deleted file mode 100644 index 4d0a7e2..0000000 --- a/src/sheets/components/CharacterSheetApp.module.scss +++ /dev/null @@ -1,38 +0,0 @@ -.sheet { - display: flex; - flex-direction: column; - gap: 0.5rem; - padding: 0.5rem; -} - -.attributes { - display: flex; - gap: 1rem; -} - -.attributeLabel { - display: flex; - flex-direction: column; - font-size: 0.8rem; - text-transform: capitalize; - - .modifier { - font-weight: bold; - text-align: center; - } -} - -.totals { - display: flex; - gap: 1rem; - font-weight: bold; -} - -.chatRow { - display: flex; - gap: 0.5rem; - - input { - flex: 1; - } -} diff --git a/src/sheets/components/CharacterSheetApp.tsx b/src/sheets/components/CharacterSheetApp.tsx deleted file mode 100644 index 6110091..0000000 --- a/src/sheets/components/CharacterSheetApp.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React, { useState } from "react"; -import styles from "./CharacterSheetApp.module.scss"; -import { localize } from "../../i18n"; -import { modifier, fmtMod } from "./CharacterSheetApp.logic"; - -export function CharacterSheetApp({ actor }: { actor: Actor.Implementation }) { - const system = actor.system; - const attrs = system.attributes; - const [chatMessage, setChatMessage] = useState(""); - - const updateAttribute = (key: "strength" | "agility" | "spirit", value: number) => { - actor.update({ system: { attributes: { [key]: value } } }); - }; - - const updateBiography = (value: string) => { - actor.update({ system: { biography: value } }); - }; - - const sendChatMessage = () => { - if (!chatMessage.trim()) return; - ChatMessage.create({ - speaker: ChatMessage.getSpeaker({ actor }), - content: chatMessage - }); - setChatMessage(""); - }; - - // derived purely from current doc state — recomputed every render, no local state needed - const total = attrs.strength + attrs.agility + attrs.spirit; - const totalMod = modifier(attrs.strength) + modifier(attrs.agility) + modifier(attrs.spirit); - - return ( - - {actor.name} - - {(["strength", "agility", "spirit"] as const).map((key) => ( - - {localize(`BOILERPLATE.Attributes.${key}`)} - updateAttribute(key, Number(e.target.value))} - /> - {fmtMod(modifier(attrs[key]))} - - ))} - - - - {localize("BOILERPLATE.Sheet.Total")}: {total} - - - {localize("BOILERPLATE.Sheet.TotalMod")}: {fmtMod(totalMod)} - - - - {localize("BOILERPLATE.Sheet.Biography")} - updateBiography(e.target.value)} /> - - - - setChatMessage(e.target.value)} - onKeyDown={(e) => e.key === "Enter" && sendChatMessage()} - /> - - {localize("BOILERPLATE.Sheet.SendToChat")} - - - - ); -} diff --git a/src/sheets/components/ItemSheetApp.module.scss b/src/sheets/components/ItemSheetApp.module.scss deleted file mode 100644 index 74acb9b..0000000 --- a/src/sheets/components/ItemSheetApp.module.scss +++ /dev/null @@ -1,13 +0,0 @@ -.sheet { - display: flex; - flex-direction: column; - gap: 0.5rem; - padding: 0.5rem; -} - -.label { - display: flex; - flex-direction: column; - font-size: 0.8rem; - text-transform: capitalize; -} diff --git a/src/sheets/components/ItemSheetApp.tsx b/src/sheets/components/ItemSheetApp.tsx deleted file mode 100644 index 1f565cc..0000000 --- a/src/sheets/components/ItemSheetApp.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; -import styles from "./ItemSheetApp.module.scss"; -import { localize } from "../../i18n"; - -export function ItemSheetApp({ item }: { item: Item.Implementation }) { - const system = item.system; - - const updateQuantity = (value: number) => { - item.update({ system: { quantity: value } }); - }; - - const updateDescription = (value: string) => { - item.update({ system: { description: value } }); - }; - - return ( - - {item.name} - - {localize("BOILERPLATE.Item.Quantity")} - updateQuantity(Number(e.target.value))} - /> - - - {localize("BOILERPLATE.Item.Description")} - updateDescription(e.target.value)} - /> - - - ); -} diff --git a/src/sheets/components/character-prep.mjs b/src/sheets/components/character-prep.mjs new file mode 100644 index 0000000..49a8560 --- /dev/null +++ b/src/sheets/components/character-prep.mjs @@ -0,0 +1,88 @@ +export async function prepArmor(actor) { + const actorData = actor.system; + // 1. Basis-Wert festlegen + let baseRüstwert = actorData.rüstwert.base || 0; + // 2. Ausgerüstete Rüstung finden und addieren + const equippedMainArmor = actor.items.filter( + (i) => i.type === "armor" && i.system.equipped && !i.system.zusätzlich + ); + const equippedAddArmor = actor.items.filter( + (i) => i.type === "armor" && i.system.equipped && i.system.zusätzlich + ); + let armorBonus = Math.max(...equippedMainArmor.map((x) => x.system.rüstwert), 0); + for (let armor of equippedAddArmor) { + armorBonus += armor.system.rüstwert; + } + // 3. Finalen Standard-Wert berechnen + actorData.rüstwert.mod = baseRüstwert + armorBonus; + + const armors = []; + const einschränkungen = []; + [...equippedMainArmor, ...equippedAddArmor]?.forEach((armor) => { + einschränkungen.push(...armor.system.merkmale); + + const w = { + name: armor.name, + rüstwert: armor.system.rüstwert, + img: armor.img, + id: armor.id + }; + armors.push(w); + }); + + return { armors: armors, einschränkungen: [...new Set(einschränkungen)] }; +} + +export async function prepWeapons(actor) { + const weaponItems = actor.items.filter((x) => x.type === "weapon" && x.system.equipped); + const weapons = []; + weaponItems.forEach((weapon) => { + const skill = foundry.utils.getProperty(actor, weapon.system.fertigkeit); + const w = { + name: weapon.name, + skillValue: skill.value, + bonusValue: + skill.bonuses.find((x) => x.name === weapon.system.spezialisierung)?.level + 1 || "", + img: weapon.img, + skillPath: weapon.system.fertigkeit, + path: weapon.system.fertigkeit, + id: weapon.id + }; + weapons.push(w); + }); + return weapons; +} + +export async function prepSpells(actor) { + const spellItems = actor.items.filter((x) => x.type === "zauber" && x.system.equipped); + const spells = []; + const skill = foundry.utils.getProperty(actor, "system.skills.magie.zaubern"); + spellItems.forEach((spell) => { + const w = { + name: spell.name, + skillValue: skill.value, + bonusValue: + skill.bonuses.find((x) => x.name === spell.system.eigenschaften.ursprung)?.level + 1 || "", + img: spell.img, + skillPath: "system.skills.magie.zaubern", + path: "Zaubern", + id: spell.id + }; + spells.push(w); + }); + return spells; +} + +export async function prepWeight(actor) { + const items = actor.items.filter((x) => x.system.gewicht && !x.system.equipped); + let gewicht = items.reduce( + (accumulator, item) => accumulator + item.system.gewicht * item.system.anzahl, + 0 + ); + + let traglast = Math.max(actor.system.skills.körper.athletik.value, 10); + return { + traglast, + gewicht + }; +} diff --git a/src/sheets/components/roll-actions.mjs b/src/sheets/components/roll-actions.mjs new file mode 100644 index 0000000..37993dd --- /dev/null +++ b/src/sheets/components/roll-actions.mjs @@ -0,0 +1,361 @@ +import { systemPath } from "../../constants.mjs"; + +export async function rollSpell(event, target) { + const dataset = target.dataset; + const skill = foundry.utils.getProperty(this.actor, "system.skills.magie.zaubern"); + const item = this.actor.items.get(dataset.itemId); + const actor = this.actor; + const dialogResult = await rollDialog({ + name: dataset.name, + skill, + damageRoll: item.system.eigenschaften.schaden, + preSelectedSpez: item.system.eigenschaften.ursprung, + actor + }); + console.log("Dialog Result", dialogResult); + if (dialogResult === "abort") { + return; + } + // Construct the Roll instance + const skillValue = skill.value; + let die = ""; + switch (dialogResult.vorteil) { + case -1: + die = "2d20kl"; + break; + case 1: + die = "2d20kh"; + break; + default: + die = "1d20"; + break; + } + + let rollTerm = "@die + @skill"; + let rollFlavor = game.i18n.localize("Midgard6.Zaubern") + ": " + item.name; + let roll; + + if (dialogResult.spezLevel) { + rollTerm += " + @spezBonus"; + rollFlavor += ": " + dialogResult.spezName; + } + + if (dialogResult.customRoll) { + roll = new Roll(dialogResult.customRoll, {}, { title: rollFlavor }); + } else { + roll = new Roll( + rollTerm, + { + die: die, + skill: skillValue, + spezBonus: dialogResult.spezLevel + 1 + }, + { title: rollFlavor } + ); + } + + if (item.system.eigenschaften.schaden) { + const attackRoll = await roll.evaluate(); + roll = [ + attackRoll, + await new Roll( + "@die", + { die: item.system.eigenschaften.schaden }, + { title: game.i18n.localize("Midgard6.Schaden") } + ).evaluate() + ]; + } else { + // Execute the roll + await roll.evaluate(); + } + + // The parsed terms of the roll formula + console.log("Roll:", roll); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm] + + const chatData = { + rolls: roll, + speaker: ChatMessage.getSpeaker(), + flags: { + "midgard6-lvd": { + title: rollFlavor, + eigenschaften: item.system.eigenschaften, + isSpell: true, + beschreibung: await foundry.applications.ux.TextEditor.implementation.enrichHTML( + item.system.beschreibung, + { + // Whether to show secret blocks in the finished html + secrets: false, + // Data to fill in for inline rolls + rollData: this.actor.getRollData(), + // Relative UUID resolution + relativeTo: this.actor + } + ) + } + } + }; + + ChatMessage.applyMode(chatData, dialogResult.rollMode); + + await ChatMessage.create(chatData); +} + +export async function rollSkill(event, target) { + const dataset = target.dataset; + const skill = foundry.utils.getProperty(this.actor, target.dataset.path.replace(".value", "")); + const actor = this.actor; + const dialogResult = await rollDialog({ + name: dataset.name, + skill, + actor + }); + console.log("Dialog Result", dialogResult); + if (dialogResult === "abort") { + return; + } + // Construct the Roll instance + const skillValue = skill.value || skill; + let die = ""; + switch (dialogResult.vorteil) { + case -1: + die = "2d20kl"; + break; + case 1: + die = "2d20kh"; + break; + default: + die = "1d20"; + break; + } + + let rollTerm = "@die + @skill"; + let rollFlavor = dataset.name; + let roll; + + if (dialogResult.spezLevel) { + rollTerm += " + @spezBonus"; + rollFlavor += ": " + dialogResult.spezName; + } + + if (dialogResult.customRoll) { + roll = new Roll(dialogResult.customRoll, {}, { title: rollFlavor }); + } else { + roll = new Roll( + rollTerm, + { + die: die, + skill: skillValue, + spezBonus: dialogResult.spezLevel + 1 + }, + { title: rollFlavor } + ); + } + + // The parsed terms of the roll formula + console.log("Roll:", roll); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm] + + // Execute the roll + await roll.evaluate(); + + const chatData = { + rolls: roll, + speaker: ChatMessage.getSpeaker(), + flags: { + "midgard6-lvd": { + title: rollFlavor + } + } + }; + + // Nutze applyRollMode, um Sichtbarkeiten (Whisper, Blind) korrekt zu setzen + ChatMessage.applyMode(chatData, dialogResult.rollMode); + + // Erstelle die Nachricht mit den manipulierten Daten + await ChatMessage.create(chatData); +} + +export async function rollWeapon(event, target) { + const dataset = target.dataset; + const weapon = this.actor.items.get(dataset.itemId); + const skill = foundry.utils.getProperty(this.actor, weapon.system.fertigkeit); + const actor = this.actor; + const dialogResult = await rollDialog({ + name: weapon.name, + skill, + damageRoll: weapon.system.schaden, + preSelectedSpez: weapon.system.spezialisierung, + actor + }); + console.log("Dialog Result", dialogResult); + if (dialogResult === "abort") { + return; + } + // Construct the Roll instance + const skillValue = skill.value; + let die = ""; + switch (dialogResult.vorteil) { + case -1: + die = "2d20kl"; + break; + case 1: + die = "2d20kh"; + break; + default: + die = "1d20"; + break; + } + + let rollTerm = "@die + @skill"; + let rollFlavor = game.i18n.localize("Midgard6.Angriff"); + let attackRoll; + let damageRoll; + + if (dialogResult.spezLevel) { + rollTerm += " + @spezBonus"; + rollFlavor += " (" + dialogResult.spezName + ")"; + } + rollFlavor += ": " + weapon.name; + + if (dialogResult.customRoll) { + attackRoll = await new Roll(dialogResult.customRoll, {}, { title: rollFlavor }).evaluate(); + } else { + attackRoll = await new Roll( + rollTerm, + { + die: die, + skill: skillValue, + spezBonus: dialogResult.spezLevel + 1 + }, + { + title: rollFlavor + } + ).evaluate(); + } + + damageRoll = await new Roll( + "@die", + { die: weapon.system.schaden }, + { title: game.i18n.localize("Midgard6.Schaden") } + ).evaluate(); + + // The parsed terms of the roll formula + const chatData = { + rolls: [attackRoll, damageRoll], + speaker: ChatMessage.getSpeaker(), + flags: { + "midgard6-lvd": { + title: rollFlavor, + eigenschaften: weapon.eigenschaften, + merkmale: weapon.system.merkmale, + beschreibung: await foundry.applications.ux.TextEditor.implementation.enrichHTML( + weapon.system.beschreibung, + { + secrets: false, + rollData: this.actor.getRollData(), + relativeTo: this.actor + } + ) + } + } + }; + + ChatMessage.applyMode(chatData, dialogResult.rollMode); + + await ChatMessage.create(chatData); +} + +async function rollDialog(rollDialogRequest) { + // Assamble dialog depending on roll type + let label = rollDialogRequest.name; + let skillValue = rollDialogRequest.skill.value || rollDialogRequest.skill; + let bonuses = rollDialogRequest.skill.bonuses || []; + let damageRoll = rollDialogRequest.damageRoll || ""; + let preSelectedSpez = rollDialogRequest.preSelectedSpez || ""; + let vorteil = 0; + let customRoll = ""; + let spezLevel; + let spezName = ""; + // 1. Define the path to .hbs template + const templatePath = systemPath("templates/dialog/roll-dialog.hbs"); + const templateData = { + skillValue, + bonuses, + vorteil, + damageRoll, + preSelectedSpez, + customRoll, + rollModes: CONFIG.ChatMessage.modes + }; + // 2. Render the Handlebars template into an HTML string + const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData); + // return new Promise((resolve, reject) => { + // const dialog = new foundry.applications.api.DialogV2({ + return foundry.applications.api.DialogV2.wait({ + window: { title: "Würfel Modifikatoren: " + label }, + position: { + width: 600 + }, + classes: ["M6", "dialog"], + content, + actions: {}, + render: (_event, dialog) => { + const dialogHTML = dialog.element; + + const display = dialogHTML.querySelector("#rollDisplay"); + + // Variable bei jeder Änderung aktualisieren + document.querySelectorAll('input[name="vorteil-segment"]').forEach((radio) => { + radio.addEventListener("change", (e) => { + vorteil = parseInt(e.target.value); + switch (vorteil) { + case 1: + display.placeholder = `2d20kh + ${skillValue} (Vorteil)`; + break; + case -1: + display.placeholder = `2d20kl + ${skillValue} (Nachteil)`; + break; + default: + display.placeholder = `1d20 + ${skillValue}`; + break; + } + }); + }); + + document.querySelectorAll('input[name="spezialisierung-segment"]').forEach((radio) => { + radio.addEventListener("change", (e) => { + spezLevel = parseInt(e.target.value); + spezName = e.target.dataset.name; + }); + if (radio.dataset.name === preSelectedSpez) { + radio.click(); + } + }); + }, + buttons: [ + { + action: "abort", + label: "Midgard6.Dialog.abbrechen", + callback: (event, button, dialog) => { + return null; + } + }, + { + action: "roll", + label: "Midgard6.Dialog.würfeln", + default: true, + callback: (event, button, dialog) => { + const rollData = { + customRoll: button.form.elements.customRoll.value, + customDamageRoll: button.form.elements.customDamageRoll?.value || "", + vorteil, + spezLevel, + spezName, + rollMode: + button.form.elements.rollMode?.value || game.settings.get("core", "messageMode") + }; + return rollData; + } + } + ] + }); +} diff --git a/src/sheets/components/spezialisierung-actions.mjs b/src/sheets/components/spezialisierung-actions.mjs new file mode 100644 index 0000000..694d7bf --- /dev/null +++ b/src/sheets/components/spezialisierung-actions.mjs @@ -0,0 +1,131 @@ +import { systemPath } from "../../constants.mjs"; + +/* -------------------------------------------------- */ +export async function addSpezialisierung(event, target) { + const dataset = target.dataset; + const path = dataset.path.replace(".value", ""); + const name = dataset.name; + const skill = foundry.utils.getProperty(this.actor, path); + + let level = 1; + + const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs"); + const templateData = { + level + }; + const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData); + return foundry.applications.api.DialogV2.wait({ + window: { + title: + game.i18n.localize("Midgard6.Sheets.spezialisierung") + + " " + + game.i18n.localize(`Midgard6.Skills.${name}`) + }, + classes: ["M6", "dialog"], + position: { + width: 600 + }, + content, + actions: {}, + render: (_event, dialog) => { + const dialogHTML = dialog.element; + // Variable bei jeder Änderung aktualisieren + dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => { + radio.addEventListener("change", (e) => { + level = parseInt(e.target.value); + }); + }); + }, + buttons: [ + { + action: "abort", + label: "Midgard6.Dialog.abbrechen" + }, + { + action: "safe", + label: "Midgard6.Dialog.speichern", + default: true, + callback: async (event, button, dialog) => { + const spez = { + name: button.form.elements.spezName.value, + level, + path + }; + skill.bonuses.push(spez); + await this.actor.update({ [`${path}.bonuses`]: skill.bonuses }); + } + } + ] + }); +} + +export async function editSepzialisierung(event, target) { + const dataset = target.dataset; + const path = dataset.path; + const name = dataset.name; + const skill = foundry.utils.getProperty(this.actor, path); + + let level = 1; + let spezName = dataset.name; + + const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs"); + const templateData = { + spezName, + level + }; + // 2. Render the Handlebars template into an HTML string + const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData); + return foundry.applications.api.DialogV2.wait({ + window: { + title: + game.i18n.localize("Midgard6.Sheets.spezialisierung") + + " " + + game.i18n.localize(path.replace(/^.*\.(?=[^.]+$)/g, "Midgard6.Skills.")) + }, + classes: ["M6", "dialog"], + position: { + width: 600 + }, + content, + actions: {}, + render: (_event, dialog) => { + const dialogHTML = dialog.element; + + dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => { + radio.addEventListener("change", (e) => { + level = parseInt(e.target.value); + }); + }); + }, + buttons: [ + { + action: "abort", + label: "Midgard6.Dialog.abbrechen" + }, + { + action: "delete", + label: "Midgard6.Dialog.löschen", + callback: async (event, button, dialog) => { + // const bonuses = this.actor[path].bonuses || []; + const bonuses = skill.bonuses.filter((x) => x.name !== name); + await this.actor.update({ [`${path}.bonuses`]: bonuses }); + } + }, + { + action: "safe", + label: "Midgard6.Dialog.speichern", + default: true, + callback: async (event, button, dialog) => { + const spez = { + name: button.form.elements.spezName.value, + level, + path + }; + const index = skill.bonuses.findIndex((x) => x.name === name); + skill.bonuses.splice(index, 1, spez); + await this.actor.update({ [`${path}.bonuses`]: skill.bonuses }); + } + } + ] + }); +} diff --git a/src/sheets/hintergrund-sheet.mjs b/src/sheets/hintergrund-sheet.mjs new file mode 100644 index 0000000..fcb4132 --- /dev/null +++ b/src/sheets/hintergrund-sheet.mjs @@ -0,0 +1,60 @@ +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { systemPath } from "../constants.mjs"; +import { M6ItemSheet } from "./item-sheet.mjs"; +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ItemSheet with some very simple modifications. + */ +export class M6HintergrundSheet extends M6ItemSheet { + static get DEFAULT_OPTIONS() { + return { + ...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet + actions: { + ...super.DEFAULT_OPTIONS.actions + } + }; + } + + static TABS = { + primary: { + tabs: [ + { + id: "beschreibung", + icon: "fa-feather-pointed" + }, + { + id: "effects", + icon: "fa-bolt" + } + ], + initial: "beschreibung", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /** @inheritdoc */ + static PARTS = { + header: { + template: systemPath("templates/hintergrund/header.hbs") + }, + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + beschreibung: { + template: systemPath("templates/hintergrund/description.hbs"), + scrollable: [""] + }, + effects: { + template: systemPath("templates/shared/effects.hbs"), + scrollable: [""] + } + }; + + _addSpecifics(context) { + if (context.source.type === "legende") { + const schicksalsgaben = context.actor.items.filter((x) => x.type === "schicksalsgabe"); + context.schicksalsgaben = schicksalsgaben; + } + } +} diff --git a/src/sheets/item-sheet.mjs b/src/sheets/item-sheet.mjs new file mode 100644 index 0000000..8732ea6 --- /dev/null +++ b/src/sheets/item-sheet.mjs @@ -0,0 +1,573 @@ +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { systemPath } from "../constants.mjs"; +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ItemSheet with some very simple modifications. + */ +export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet) { + /** @inheritdoc */ + + static DEFAULT_OPTIONS = { + window: { + resizable: true + }, + position: { + width: 650, + height: 450 + }, + classes: ["M6", "item", "standard-form"], + actions: { + viewDoc: this.#viewEffect, + createDoc: this.#createEffect, + deleteDoc: this.#deleteEffect, + toggleEffect: this.#toggleEffect + }, + form: { + submitOnChange: true + }, + // Custom property that's merged into `this.options` + dragDrop: [{ dragSelector: ".draggable", dropSelector: null }] + }; + + /* -------------------------------------------------- */ + + static TABS = { + primary: { + tabs: [ + { + id: "beschreibung", + icon: "fa-feather-pointed" + }, + { + id: "effects", + icon: "fa-bolt" + } + ], + initial: "beschreibung", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + static PARTS = { + header: { + template: systemPath("templates/item/header.hbs") + }, + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + beschreibung: { + template: systemPath("templates/item/description.hbs"), + scrollable: [""] + }, + effects: { + template: systemPath("templates/shared/effects.hbs"), + scrollable: [""] + } + }; + + _attachPartListeners(partId, html, bubble) { + super._attachPartListeners(partId, html, bubble); + + if (partId === "eigenschaften") { + const inputs = html.querySelectorAll("input[data-action=splitIntoArray]"); + + if (inputs) { + inputs.forEach((input) => { + input.addEventListener("blur", this._onInputBlur.bind(this)); + }); + } + } + } + + // Die eigentliche Funktion, die beim Verlassen des Feldes feuert + _onInputBlur(event) { + event.preventDefault(); + const currentInput = event.currentTarget; + const value = currentInput.value; + console.log("Feld verlassen! Aktueller Wert:", value); + this.item.update({ [`${currentInput.name}`]: value.split(/[\s,]+/) }); + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + _initializeApplicationOptions(options) { + const initialized = super._initializeApplicationOptions(options); + + initialized.classes.push(initialized.document.type); + + return initialized; + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + async _prepareContext(options) { + const context = await super._prepareContext(options); + + Object.assign(context, { + owner: this.document.isOwner, + limited: this.document.limited, + item: this.item, + actor: this.actor, + system: this.item.system, + flags: this.item.flags, + itemFields: this.item.schema.fields, + config: CONFIG + }); + + return context; + } + + /* -------------------------------------------------- */ + + /** @inheritdoc */ + async _preparePartContext(partId, context) { + // TODO: Come up with clever way to automatically handle enriching HTML fields + switch (partId) { + case "effects": + context.effects = prepareActiveEffectCategories(this.item.effects); + context.tab = context.tabs[partId]; + break; + case "beschreibung": + context.fields = await this._getFields(); + context.enrichedBeschreibung = + await foundry.applications.ux.TextEditor.implementation.enrichHTML( + this.item.system.beschreibung, + { + // Whether to show secret blocks in the finished html + secrets: this.document.isOwner, + // Data to fill in for inline rolls + rollData: this.item.getRollData(), + // Relative UUID resolution + relativeTo: this.item + } + ); + context.tab = context.tabs[partId]; + break; + default: + await this._addSpecifics(context); + context.tab = context.tabs[partId]; + } + + return context; + } + + /* -------------------------------------------------- */ + + /** + * Handles the system fields for the form-fields generic. + */ + async _getFields() { + const doc = this.item; + const source = doc._source; + const systemFields = CONFIG.Item.dataModels[doc.type]?.schema.fields; + const fieldSets = []; + // TODO: Find a clever way to handle enrichment + for (const field of Object.values(systemFields ?? {})) { + const path = `system.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + const fieldset = { fieldset: true, legend: field.label, fields: [] }; + await this.#addSystemFields(fieldset, field.fields, source, path); + fieldSets.push(fieldset); + } else { + fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } }); + } + } + return fieldSets; + } + + /* -------------------------------------------------- */ + + /** + * Recursively add system model fields to the fieldset. + */ + async #addSystemFields(fieldset, schema, source, _path = "system") { + for (const field of Object.values(schema)) { + const path = `${_path}.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + this.#addSystemFields(fieldset, field.fields, source, path); + } else if (field.constructor.hasFormSupport) { + fieldset.fields.push({ field, value: foundry.utils.getProperty(source, path) }); + } + } + } + + /* -------------------------------------------------- */ + + /** + * Actions performed after any render of the Application. + * Post-render steps are not awaited by the render process. + * @param {ApplicationRenderContext} context Prepared context data. + * @param {RenderOptions} options Provided render options. + * @protected + */ + _onRender(context, options) { + this.#dragDrop.forEach((d) => d.bind(this.element)); + } + + /* -------------------------------------------------- */ + /* Event handlers */ + /* -------------------------------------------------- */ + + /** + * Renders an embedded document's sheet. + * + * @this UTSItemSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @protected + */ + static async #viewEffect(event, target) { + const effect = this._getEffect(target); + effect.sheet.render(true); + } + + /* -------------------------------------------------- */ + + /** + * Handles item deletion. + * + * @this UTSItemSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @protected + */ + static async #deleteEffect(event, target) { + const effect = this._getEffect(target); + effect.delete(); + } + + /* -------------------------------------------------- */ + + /** + * Handle creating a new Owned Item or ActiveEffect for the actor using initial data defined in the HTML dataset. + * + * @this UTSItemSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @private + */ + static async #createEffect(event, target) { + const aeCls = getDocumentClass("ActiveEffect"); + const effectData = { + name: aeCls.defaultName({ + type: target.dataset.type, + parent: this.item + }) + }; + for (const [dataKey, value] of Object.entries(target.dataset)) { + if (["action", "documentClass"].includes(dataKey)) continue; + foundry.utils.setProperty(effectData, dataKey, value); + } + + aeCls.create(effectData, { parent: this.item }); + } + + /* -------------------------------------------------- */ + + /** + * Determines effect parent to pass to helper. + * + * @this UTSItemSheet + * @param {PointerEvent} event The originating click event. + * @param {HTMLElement} target The capturing HTML element which defined a [data-action]. + * @private + */ + static async #toggleEffect(event, target) { + const effect = this._getEffect(target); + effect.update({ disabled: !effect.disabled }); + } + + /* -------------------------------------------------- */ + /* Helper functions */ + /* -------------------------------------------------- */ + + /** + * Fetches the row with the data for the rendered embedded document. + * + * @param {HTMLElement} target The element with the action. + * @returns {HTMLLIElement} The document's row. + */ + _getEffect(target) { + const li = target.closest(".effect"); + return this.item.effects.get(li?.dataset?.effectId); + } + + /* -------------------------------------------------- */ + /* Drag and drop */ + /* -------------------------------------------------- */ + + /** + * Define whether a user is able to begin a dragstart workflow for a given drag selector. + * @param {string} selector The candidate HTML selector for dragging. + * @returns {boolean} Can the current user drag this selector? + * @protected + */ + _canDragStart(selector) { + return this.isEditable; + } + + /* -------------------------------------------------- */ + + /** + * Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector. + * @param {string} selector The candidate HTML selector for the drop target. + * @returns {boolean} Can the current user drop on this selector? + * @protected + */ + _canDragDrop(selector) { + return this.isEditable; + } + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur at the beginning of a drag start workflow. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + _onDragStart(event) { + const li = event.currentTarget; + if ("link" in event.target.dataset) return; + + let dragData = null; + + if (li.dataset.effectId) { + const effect = this.item.effects.get(li.dataset.effectId); + dragData = effect.toDragData(); + } + + if (!dragData) return; + + event.dataTransfer.setData("text/plain", JSON.stringify(dragData)); + } + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur when a dragged element is over a drop target. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + _onDragOver(event) {} + + /* -------------------------------------------------- */ + + /** + * Callback actions which occur when a dragged element is dropped on a target. + * @param {DragEvent} event The originating DragEvent. + * @protected + */ + async _onDrop(event) { + const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); + const item = this.item; + + const allowed = Hooks.call("dropItemSheetData", item, this, data); + // if (allowed === false) return; + + // Handle different data types + switch (data.type) { + case "ActiveEffect": + return this._onDropActiveEffect(event, data); + case "Actor": + return this._onDropActor(event, data); + case "Item": + return this._onDropItem(event, data); + case "Folder": + return this._onDropFolder(event, data); + } + } + + /* -------------------------------------------------- */ + + /** + * Handle the dropping of ActiveEffect data onto an Actor Sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} The created ActiveEffect object or false if it couldn't be created. + * @protected + */ + async _onDropActiveEffect(event, data) { + const aeCls = getDocumentClass("ActiveEffect"); + const effect = await aeCls.fromDropData(data); + if (!this.item.isOwner || !effect) return false; + + if (this.item.uuid === effect.parent?.uuid) return this._onEffectSort(event, effect); + aeCls.create(effect, { parent: this.item }); + } + + /* -------------------------------------------------- */ + + /** + * Sorts an Active Effect based on its surrounding attributes. + * + * @param {DragEvent} event + * @param {ActiveEffect} effect + */ + _onEffectSort(event, effect) { + const effects = this.item.effects; + const dropTarget = event.target.closest("[data-effect-id]"); + if (!dropTarget) return; + const target = effects.get(dropTarget.dataset.effectId); + + // Don't sort on yourself + if (effect.id === target.id) return; + + // Identify sibling items based on adjacent HTML elements + const siblings = []; + for (let el of dropTarget.parentElement.children) { + const siblingId = el.dataset.effectId; + if (siblingId && siblingId !== effect.id) siblings.push(effects.get(el.dataset.effectId)); + } + + // Perform the sort + const sortUpdates = foundry.utils.performIntegerSort(effect, { + target, + siblings + }); + const updateData = sortUpdates.map((u) => { + const update = u.update; + update._id = u.target._id; + return update; + }); + + // Perform the update + this.item.updateEmbeddedDocuments("ActiveEffect", updateData); + } + + /* -------------------------------------------------- */ + + /** + * Handle dropping of an Actor data onto another Actor sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} A data object which describes the result of the drop, or false if the drop was + * not permitted. + * @protected + */ + async _onDropActor(event, data) { + if (!this.item.isOwner) return false; + } + + /* -------------------------------------------------- */ + + /** + * Handle dropping of an item reference or item data onto an Actor Sheet. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} The created or updated Item instances, or false if the drop was not permitted. + * @protected + */ + async _onDropItem(event, data) { + if (!this.item.isOwner) return false; + + // Prüfen, ob das Item von diesem Actor stammt und Shift NICHT gedrückt ist + const isSameActor = this.actor.uuid === item.parent?.uuid; + const isShift = event.shiftKey; + + if (isSameActor) { + // Sortieren, nicht kopieren/verschieben + return this._onSortItem(event, item); + } + } + + /** + * Handle a drop event for an existing embedded Item to sort that Item relative to its siblings + * @param {Event} event + * @param {Item} item + * @private + */ + _onSortItem(event, item) { + // Get the drag source and drop target + const items = this.actor.items; + const dropTarget = event.target.closest("[data-item-id]"); + if (!dropTarget) return; + const target = items.get(dropTarget.dataset.itemId); + + // Don't sort on yourself + if (item.id === target.id) return; + + // Identify sibling items based on adjacent HTML elements + const siblings = []; + for (let el of dropTarget.parentElement.children) { + const siblingId = el.dataset.itemId; + if (siblingId && siblingId !== item.id) siblings.push(items.get(el.dataset.itemId)); + } + + // Perform the sort + const sortUpdates = foundry.utils.SortingHelpers.performIntegerSort(item, { + target, + siblings + }); + const updateData = sortUpdates.map((u) => { + const update = u.update; + update._id = u.target._id; + return update; + }); + + // Perform the update + return this.actor.updateEmbeddedDocuments("Item", updateData); + } + + /* -------------------------------------------------- */ + + /** + * Handle dropping of a Folder on an Actor Sheet. + * The core sheet currently supports dropping a Folder of Items to create all items as owned items. + * @param {DragEvent} event The concluding DragEvent which contains drop data. + * @param {object} data The data transfer extracted from the event. + * @returns {Promise} + * @protected + */ + async _onDropFolder(event, data) { + if (!this.item.isOwner) return []; + } + + /* -------------------------------------------------- */ + /* The following pieces set up drag */ + /* handling and are unlikely to need modification */ + /* -------------------------------------------------- */ + + // This is marked as private because there's no real need + // for subclasses or external hooks to mess with it directly + #dragDrop = this.#createDragDropHandlers(); + + /** + * Returns an array of DragDrop instances. + * @type {DragDrop[]} + */ + get dragDrop() { + return this.#dragDrop; + } + + /* -------------------------------------------------- */ + + /** + * Create drag-and-drop workflow handlers for this Application. + * @returns {DragDrop[]} An array of DragDrop handlers. + * @private + */ + #createDragDropHandlers() { + return this.options.dragDrop.map((d) => { + d.permissions = { + dragstart: this._canDragStart.bind(this), + drop: this._canDragDrop.bind(this) + }; + d.callbacks = { + dragstart: this._onDragStart.bind(this), + dragover: this._onDragOver.bind(this), + drop: this._onDrop.bind(this) + }; + return new foundry.applications.ux.DragDrop(d); + }); + } + + async _addSpecifics(context) { + return null; + } +} diff --git a/src/sheets/item-sheet.ts b/src/sheets/item-sheet.ts deleted file mode 100644 index dbd8e53..0000000 --- a/src/sheets/item-sheet.ts +++ /dev/null @@ -1,32 +0,0 @@ -import React from "react"; -import { createRoot, type Root } from "react-dom/client"; -import { ItemSheetApp } from "./components/ItemSheetApp"; - -export class ItemSheet extends foundry.applications.sheets.ItemSheetV2 { - static DEFAULT_OPTIONS = { - classes: ["fvtt-ts-react-boilerplate", "sheet", "item"], - position: { width: 480, height: 360 } - }; - - #root: Root | null = null; - - override async _renderHTML( - ...args: Parameters - ) { - return args[0]; - } - - override _replaceHTML( - ...args: Parameters - ) { - const content = args[1]; - if (!this.#root) this.#root = createRoot(content); - this.#root.render(React.createElement(ItemSheetApp, { item: this.document })); - } - - override async close(...args: Parameters) { - this.#root?.unmount(); - this.#root = null; - return super.close(...args); - } -} diff --git a/src/sheets/weapon-sheet.mjs b/src/sheets/weapon-sheet.mjs new file mode 100644 index 0000000..b63b5c0 --- /dev/null +++ b/src/sheets/weapon-sheet.mjs @@ -0,0 +1,75 @@ +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { systemPath } from "../constants.mjs"; +import { M6ItemSheet } from "./item-sheet.mjs"; +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ItemSheet with some very simple modifications. + */ +export class M6WeaponSheet extends M6ItemSheet { + static get DEFAULT_OPTIONS() { + return { + ...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet + actions: { + ...super.DEFAULT_OPTIONS.actions, + cycleEquip: this.#cycleEquip + } + }; + } + + static TABS = { + primary: { + tabs: [ + { + id: "eigenschaften", + icon: "fa-shield-halved" + }, + { + id: "beschreibung", + icon: "fa-feather-pointed" + }, + { + id: "effects", + icon: "fa-bolt" + } + ], + initial: "eigenschaften", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /** @inheritdoc */ + static PARTS = { + header: { + template: systemPath("templates/item/header.hbs") + }, + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + eigenschaften: { + template: systemPath("templates/item/waffen/eigenschaften.hbs"), + scrollable: [""] + }, + beschreibung: { + template: systemPath("templates/item/description.hbs"), + scrollable: [""] + }, + effects: { + template: systemPath("templates/shared/effects.hbs"), + scrollable: [""] + } + }; + + async _addSpecifics(context) { + context.bonuses = + foundry.utils.getProperty(this.actor, this.item.system.fertigkeit)?.bonuses || []; + } + + static #cycleEquip() { + this.item.update({ + system: { + equipped: !this.item.system.equipped + } + }); + } +} diff --git a/src/sheets/zauber-sheet.mjs b/src/sheets/zauber-sheet.mjs new file mode 100644 index 0000000..24bd9bb --- /dev/null +++ b/src/sheets/zauber-sheet.mjs @@ -0,0 +1,108 @@ +import { prepareActiveEffectCategories } from "../helpers/utils.mjs"; +import { systemPath } from "../constants.mjs"; +import { M6ItemSheet } from "./item-sheet.mjs"; +const { api, sheets } = foundry.applications; + +/** + * Extend the basic ItemSheet with some very simple modifications. + */ +export class M6ZauberSheet extends M6ItemSheet { + static get DEFAULT_OPTIONS() { + return { + ...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet + actions: { + ...super.DEFAULT_OPTIONS.actions, + cycleEquip: this.#cycleEquip // Fügt NUR für dieses Sheet die neue Action hinzu + } + }; + } + + static TABS = { + primary: { + tabs: [ + { + id: "eigenschaften", + icon: "fa-shield-halved" + }, + { + id: "beschreibung", + icon: "fa-feather-pointed" + } + ], + initial: "eigenschaften", + labelPrefix: "Midgard6.Sheets.Tabs" + } + }; + + /** @inheritdoc */ + static PARTS = { + header: { + template: systemPath("templates/zauber/header.hbs") + }, + tabs: { + template: systemPath("templates/shared/tabs.hbs") + }, + eigenschaften: { + template: systemPath("templates/zauber/eigenschaften.hbs"), + scrollable: [""] + }, + beschreibung: { + template: systemPath("templates/zauber/description.hbs"), + scrollable: [""] + } + }; + + async _addSpecifics(context) { + context.zauberFields = await this._getFields(); + context.bonuses = + foundry.utils.getProperty(this.actor, "system.skills.magie.zaubern")?.bonuses || []; + } + + static #cycleEquip() { + this.item.update({ + system: { + equipped: !this.item.system.equipped + } + }); + } + + /* -------------------------------------------------- */ + + /** + * Handles the system fields for the form-fields generic. + */ + async _getFields() { + const doc = this.item; + const source = doc._source; + const systemFields = CONFIG.Item.dataModels[doc.type]?.schema.fields; + const fieldSets = {}; + // TODO: Find a clever way to handle enrichment + for (const field of Object.values(systemFields ?? {})) { + const path = `system.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + const fieldset = { fieldset: true, legend: field.label, fields: {} }; + await this.#addSystemFields(fieldset, field.fields, source, path); + fieldSets[field.name] = fieldset; + } else { + fieldSets[field.name] = { field, value: foundry.utils.getProperty(source, path) }; + } + } + return fieldSets; + } + + /* -------------------------------------------------- */ + + /** + * Recursively add system model fields to the fieldset. + */ + async #addSystemFields(fieldset, schema, source, _path = "system") { + for (const field of Object.values(schema)) { + const path = `${_path}.${field.name}`; + if (field instanceof foundry.data.fields.SchemaField) { + this.#addSystemFields(fieldset, field.fields, source, path); + } else if (field.constructor.hasFormSupport) { + fieldset.fields[field.name] = { field, value: foundry.utils.getProperty(source, path) }; + } + } + } +} diff --git a/src/styles/M6.scss b/src/styles/M6.scss new file mode 100644 index 0000000..ade715f --- /dev/null +++ b/src/styles/M6.scss @@ -0,0 +1,200 @@ +@import url("flex/bootstrap-grid.css"); +@import url("./header.scss"); +@import url("./tabs.scss"); +@import url("./resistenzen.scss"); +@import url("./dialog.scss"); +@import url("./items-page.scss"); +@import url("./hintergrund.scss"); +@import url("./icons.scss"); +@import url("./chat-messages.scss"); + +:root { + --M6-background-grey: #d3d7d7; + --M6-background-brown: #eedecd; + --M6-background-white: #fdfeff; + --M6-text-grey: #595d5f; + --M6-text-brown: #be7742; +} + +.inline-roll { + background-color: var(--M6-background-brown); +} +.M6 { + fieldset { + border-radius: 0; + border: none; + background-color: var(--M6-background-grey); + + &.highlight { + background-color: var(--M6-background-brown); + } + legend { + color: var(--M6-text-brown); + font-size: 24px; + } + } + h5 { + color: var(--M6-text-grey); + } + i { + font-size: 18px; + text-shadow: 0 0 10px var(--M6-background-white); + } + i:hover { + text-shadow: 0 0 10px var(--M6-background-brown); + } + + prose-mirror.active { + background-color: var(--M6-background-white); + } +} + +.application { + overflow: visible; +} + +.M6 { + background-color: var(--M6-background-white); + color: var(--M6-text-grey); + + input { + background-color: var(--M6-background-white); + color: black; + border-radius: 0; + transition: none; + &.skill { + max-width: 2rem; + text-align: center; + margin-left: 0.5rem; + height: 24px; + } + &.attribut { + max-width: 2rem; + text-align: center; + margin: 0 0.5rem; + } + &.text { + &.center { + text-align: center; + } + &.right { + text-align: end; + } + } + } + input:disabled { + border: none; + } + input:focus { + outline: none; + } + + select { + background-color: var(--M6-background-white); + color: black; + border-radius: 0; + transition: none; + margin-bottom: 4px; + option:hover { + background-color: var(--M6-background-brown); + } + } + p { + &.center { + text-align: center; + } + &.right { + text-align: end; + } + } + + .armor-box { + position: absolute; + margin-left: -8px; + i { + font-size: 20px; + } + } + + .armor-value { + position: absolute; + right: 8px; + font-size: 16px; + color: var(--M6-background-white); + } + + .sheet-header { + img { + border-radius: 0 0 50% 50%; + border: solid 8px var(--M6-background-grey); + border-top: none; + flex: 0 0 100px; + object-fit: fill; + } + } + .tab { + height: 100%; + padding-top: 10px; + } + .tab { + ul { + list-style: none; + padding-left: 5px; + } + .itemHeader { + border-bottom: 1px solid var(--color-border-light-primary); + .type-label { + font-size: 20px; + } + .document-controls { + flex: 0 0 100px; + } + } + .item { + img { + border: none; + flex: 0 0 30px; + padding-right: 5px; + } + .document-controls { + flex: 0 0 50px; + } + } + } + .tab[data-tab="effects"] { + ul { + list-style: none; + padding-left: 5px; + margin-top: 0; + margin-bottom: 0; + } + .effects-header { + font-size: 16px; + border-bottom: 1px solid var(--color-border-light-primary); + .document-controls { + flex: 0 0 100px; + } + } + .effect { + .effect-label { + img { + border: none; + flex: 0 0 30px; + padding-right: 5px; + } + .effect-name { + line-height: 24px; + } + } + .effect-duration { + flex: 0 0 130px; + } + .document-controls { + flex: 0 0 80px; + } + } + .effect-label { + flex: 2; + } + } +} diff --git a/src/styles/chat-messages.scss b/src/styles/chat-messages.scss new file mode 100644 index 0000000..b827ad6 --- /dev/null +++ b/src/styles/chat-messages.scss @@ -0,0 +1,96 @@ +.chat-message { + background: none; + border-radius: 0; +} +.message-header { + .message-names { + color: var(--M6-text-brown); + font-weight: bold; + font-size: 18px; + } + + .portrait { + padding: 0 4px; + } +} +.chat-message.message { + background-color: var(--M6-background-grey); + + fieldset { + background-color: var(--M6-background-white); + + &.highlight { + background-color: var(--M6-background-brown); + } + legend { + color: var(--M6-text-brown); + font-size: 18px; + font-weight: bold; + } + } + + .collapsible { + background-color: var(--M6-background-white); + cursor: pointer; + padding: 12px; + font-size: 15px; + margin-bottom: 4px; + display: flex; + justify-content: space-between; + margin: 8px 4px; + + &.active { + background-color: var(--M6-background-brown); + box-shadow: none; + margin-bottom: 0px; + } + } + + /* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ + + /* Style the collapsible content. Note: hidden by default */ + .content { + padding: 0 18px; + display: none; + width: auto; + overflow: hidden; + background-color: var(--M6-background-white); + &.active { + display: block; + width: auto; + margin: 8px 4px; + margin-top: 0; + } + .hidden { + display: none; + } + } + + .tags { + align-items: center; + display: flex; + flex-wrap: wrap; + gap: 0.125rem; + list-style-type: none; + padding-left: 0; + margin: 0.25rem; + .hidden { + display: none; + } + } + .tag { + background-color: var(--M6-background-brown); + color: black; + font-family: var(--sans-serif); + font-size: var(--font-size-10); + text-transform: uppercase; + letter-spacing: 0.05em; + text-rendering: optimizeLegibility; + align-items: center; + border-radius: 2px; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); + display: inline-flex; + font-weight: 500; + padding: 0.3em; + } +} diff --git a/src/styles/dialog.scss b/src/styles/dialog.scss new file mode 100644 index 0000000..c1ae867 --- /dev/null +++ b/src/styles/dialog.scss @@ -0,0 +1,123 @@ +.application.dialog.M6 { + background-color: var(--M6-background-white); + color: var(--M6-text-grey); + + fieldset { + border-radius: 0; + border: none; + background-color: var(--M6-background-grey); + + &.highlight { + background-color: var(--M6-background-brown); + } + legend { + color: var(--M6-text-brown); + font-size: 24px; + } + } + h5 { + color: var(--M6-text-grey); + } + i { + font-size: 18px; + text-shadow: 0 0 10px var(--M6-background-white); + } + i:hover { + text-shadow: 0 0 10px var(--M6-background-brown); + } + input { + background-color: var(--M6-background-white); + color: black; + border-radius: 0; + &.skill { + max-width: 2rem; + text-align: center; + margin-left: 0.5rem; + } + &.attribut { + max-width: 2rem; + text-align: center; + margin: 0 0.5rem; + } + &.text { + &.right { + text-align: end; + } + } + } + p { + &.center { + text-align: center; + } + } + fieldset { + background-color: var(--M6-background-grey); + legend { + color: var(--M6-text-brown); + font-size: 20px; + } + } +} + +/* Container für die gesamte Reihe */ +.segmented-button-row { + display: inline-flex; + overflow: hidden; + height: 32px; +} + +/* Einzelnes Segment */ +.segmented-button { + position: relative; + cursor: pointer; + display: flex; + align-items: center; +} + +/* Versteckt den echten Radio-Button, behält aber die Tastatur-Navigation */ +.segmented-button input[type="radio"] { + position: absolute; + opacity: 0; + width: 0; + height: 0; +} + +/* Inhalt des Segments (Layout & Abstände) */ +.segmented-button__content { + display: flex; + align-items: center; + justify-content: center; + padding: 0 8px; + height: 100%; + transition: + background-color 0.2s, + color 0.2s; + background-color: transparent; + user-select: none; +} + +/* --- ZUSTÄNDE --- */ + +/* Selektiert (Selected State) */ +.segmented-button input[type="radio"]:checked + .segmented-button__content { + // background-color: #e8def8; /* M3 Secondary Container Color */ + text-shadow: 0 0 10px var(--M6-text-brown) !important; + color: #1d192b; /* M3 On-Secondary Container Text */ + .icon { + text-shadow: 0 0 10px var(--M6-text-brown) !important; + } +} + +/* Hover-Effekt */ +.segmented-button:hover .segmented-button__content { + background-color: rgba(73, 69, 79, 0.08); +} +.segmented-button input[type="radio"]:checked:hover + .segmented-button__content { + background-color: rgba(232, 222, 248, 0.85); +} + +/* Tastatur-Fokus (Barrierefreiheit) */ +.segmented-button input[type="radio"]:focus-visible + .segmented-button__content { + outline: 2px solid #6750a4; + outline-offset: -2px; +} diff --git a/src/styles/flex/bootstrap-grid.css b/src/styles/flex/bootstrap-grid.css new file mode 100644 index 0000000..b1220af --- /dev/null +++ b/src/styles/flex/bootstrap-grid.css @@ -0,0 +1,1978 @@ +/*! + * Bootstrap Grid v4.1.3 (https://getbootstrap.com/) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +@-ms-viewport { + width: device-width; +} + +html { + box-sizing: border-box; + -ms-overflow-style: scrollbar; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +.M6 { + .container { + width: 100%; + /* padding-right: 15px; + padding-left: 15px; */ + margin-right: auto; + margin-left: auto; + } + + @media (min-width: 576px) { + .container { + max-width: 540px; + } + } + + @media (min-width: 768px) { + .container { + max-width: 720px; + } + } + + @media (min-width: 992px) { + .container { + max-width: 960px; + } + } + + @media (min-width: 1200px) { + .container { + max-width: 1140px; + } + } + + .container-fluid { + width: 100%; + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; + } + + .row { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -15px; + margin-left: -15px; + } + + .no-gutters { + margin-right: 0; + margin-left: 0; + } + + .no-gutters > .col, + .no-gutters > [class*="col-"] { + padding-right: 0; + padding-left: 0; + } + + .col-1, + .col-2, + .col-3, + .col-4, + .col-5, + .col-6, + .col-7, + .col-8, + .col-9, + .col-10, + .col-11, + .col-12, + .col, + .col-auto, + .col-sm-1, + .col-sm-2, + .col-sm-3, + .col-sm-4, + .col-sm-5, + .col-sm-6, + .col-sm-7, + .col-sm-8, + .col-sm-9, + .col-sm-10, + .col-sm-11, + .col-sm-12, + .col-sm, + .col-sm-auto, + .col-md-1, + .col-md-2, + .col-md-3, + .col-md-4, + .col-md-5, + .col-md-6, + .col-md-7, + .col-md-8, + .col-md-9, + .col-md-10, + .col-md-11, + .col-md-12, + .col-md, + .col-md-auto, + .col-lg-1, + .col-lg-2, + .col-lg-3, + .col-lg-4, + .col-lg-5, + .col-lg-6, + .col-lg-7, + .col-lg-8, + .col-lg-9, + .col-lg-10, + .col-lg-11, + .col-lg-12, + .col-lg, + .col-lg-auto, + .col-xl-1, + .col-xl-2, + .col-xl-3, + .col-xl-4, + .col-xl-5, + .col-xl-6, + .col-xl-7, + .col-xl-8, + .col-xl-9, + .col-xl-10, + .col-xl-11, + .col-xl-12, + .col-xl, + .col-xl-auto { + position: relative; + width: 100%; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; + } + + .col { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + + .col-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + + .col-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + + .col-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + + .col-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + + .col-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + + .col-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + + .col-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + + .col-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + + .col-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + + .col-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + + .col-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + + .col-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + + .col-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + + .order-first { + -ms-flex-order: -1; + order: -1; + } + + .order-last { + -ms-flex-order: 13; + order: 13; + } + + .order-0 { + -ms-flex-order: 0; + order: 0; + } + + .order-1 { + -ms-flex-order: 1; + order: 1; + } + + .order-2 { + -ms-flex-order: 2; + order: 2; + } + + .order-3 { + -ms-flex-order: 3; + order: 3; + } + + .order-4 { + -ms-flex-order: 4; + order: 4; + } + + .order-5 { + -ms-flex-order: 5; + order: 5; + } + + .order-6 { + -ms-flex-order: 6; + order: 6; + } + + .order-7 { + -ms-flex-order: 7; + order: 7; + } + + .order-8 { + -ms-flex-order: 8; + order: 8; + } + + .order-9 { + -ms-flex-order: 9; + order: 9; + } + + .order-10 { + -ms-flex-order: 10; + order: 10; + } + + .order-11 { + -ms-flex-order: 11; + order: 11; + } + + .order-12 { + -ms-flex-order: 12; + order: 12; + } + + .offset-1 { + margin-left: 8.333333%; + } + + .offset-2 { + margin-left: 16.666667%; + } + + .offset-3 { + margin-left: 25%; + } + + .offset-4 { + margin-left: 33.333333%; + } + + .offset-5 { + margin-left: 41.666667%; + } + + .offset-6 { + margin-left: 50%; + } + + .offset-7 { + margin-left: 58.333333%; + } + + .offset-8 { + margin-left: 66.666667%; + } + + .offset-9 { + margin-left: 75%; + } + + .offset-10 { + margin-left: 83.333333%; + } + + .offset-11 { + margin-left: 91.666667%; + } + + @media (min-width: 576px) { + .col-sm { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-sm-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-sm-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-sm-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-sm-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-sm-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-sm-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-sm-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-sm-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-sm-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-sm-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-sm-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-sm-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-sm-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-sm-first { + -ms-flex-order: -1; + order: -1; + } + .order-sm-last { + -ms-flex-order: 13; + order: 13; + } + .order-sm-0 { + -ms-flex-order: 0; + order: 0; + } + .order-sm-1 { + -ms-flex-order: 1; + order: 1; + } + .order-sm-2 { + -ms-flex-order: 2; + order: 2; + } + .order-sm-3 { + -ms-flex-order: 3; + order: 3; + } + .order-sm-4 { + -ms-flex-order: 4; + order: 4; + } + .order-sm-5 { + -ms-flex-order: 5; + order: 5; + } + .order-sm-6 { + -ms-flex-order: 6; + order: 6; + } + .order-sm-7 { + -ms-flex-order: 7; + order: 7; + } + .order-sm-8 { + -ms-flex-order: 8; + order: 8; + } + .order-sm-9 { + -ms-flex-order: 9; + order: 9; + } + .order-sm-10 { + -ms-flex-order: 10; + order: 10; + } + .order-sm-11 { + -ms-flex-order: 11; + order: 11; + } + .order-sm-12 { + -ms-flex-order: 12; + order: 12; + } + .offset-sm-0 { + margin-left: 0; + } + .offset-sm-1 { + margin-left: 8.333333%; + } + .offset-sm-2 { + margin-left: 16.666667%; + } + .offset-sm-3 { + margin-left: 25%; + } + .offset-sm-4 { + margin-left: 33.333333%; + } + .offset-sm-5 { + margin-left: 41.666667%; + } + .offset-sm-6 { + margin-left: 50%; + } + .offset-sm-7 { + margin-left: 58.333333%; + } + .offset-sm-8 { + margin-left: 66.666667%; + } + .offset-sm-9 { + margin-left: 75%; + } + .offset-sm-10 { + margin-left: 83.333333%; + } + .offset-sm-11 { + margin-left: 91.666667%; + } + } + + @media (min-width: 768px) { + .col-md { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-md-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-md-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-md-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-md-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-md-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-md-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-md-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-md-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-md-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-md-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-md-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-md-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-md-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-md-first { + -ms-flex-order: -1; + order: -1; + } + .order-md-last { + -ms-flex-order: 13; + order: 13; + } + .order-md-0 { + -ms-flex-order: 0; + order: 0; + } + .order-md-1 { + -ms-flex-order: 1; + order: 1; + } + .order-md-2 { + -ms-flex-order: 2; + order: 2; + } + .order-md-3 { + -ms-flex-order: 3; + order: 3; + } + .order-md-4 { + -ms-flex-order: 4; + order: 4; + } + .order-md-5 { + -ms-flex-order: 5; + order: 5; + } + .order-md-6 { + -ms-flex-order: 6; + order: 6; + } + .order-md-7 { + -ms-flex-order: 7; + order: 7; + } + .order-md-8 { + -ms-flex-order: 8; + order: 8; + } + .order-md-9 { + -ms-flex-order: 9; + order: 9; + } + .order-md-10 { + -ms-flex-order: 10; + order: 10; + } + .order-md-11 { + -ms-flex-order: 11; + order: 11; + } + .order-md-12 { + -ms-flex-order: 12; + order: 12; + } + .offset-md-0 { + margin-left: 0; + } + .offset-md-1 { + margin-left: 8.333333%; + } + .offset-md-2 { + margin-left: 16.666667%; + } + .offset-md-3 { + margin-left: 25%; + } + .offset-md-4 { + margin-left: 33.333333%; + } + .offset-md-5 { + margin-left: 41.666667%; + } + .offset-md-6 { + margin-left: 50%; + } + .offset-md-7 { + margin-left: 58.333333%; + } + .offset-md-8 { + margin-left: 66.666667%; + } + .offset-md-9 { + margin-left: 75%; + } + .offset-md-10 { + margin-left: 83.333333%; + } + .offset-md-11 { + margin-left: 91.666667%; + } + } + + @media (min-width: 992px) { + .col-lg { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-lg-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-lg-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-lg-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-lg-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-lg-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-lg-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-lg-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-lg-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-lg-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-lg-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-lg-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-lg-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-lg-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-lg-first { + -ms-flex-order: -1; + order: -1; + } + .order-lg-last { + -ms-flex-order: 13; + order: 13; + } + .order-lg-0 { + -ms-flex-order: 0; + order: 0; + } + .order-lg-1 { + -ms-flex-order: 1; + order: 1; + } + .order-lg-2 { + -ms-flex-order: 2; + order: 2; + } + .order-lg-3 { + -ms-flex-order: 3; + order: 3; + } + .order-lg-4 { + -ms-flex-order: 4; + order: 4; + } + .order-lg-5 { + -ms-flex-order: 5; + order: 5; + } + .order-lg-6 { + -ms-flex-order: 6; + order: 6; + } + .order-lg-7 { + -ms-flex-order: 7; + order: 7; + } + .order-lg-8 { + -ms-flex-order: 8; + order: 8; + } + .order-lg-9 { + -ms-flex-order: 9; + order: 9; + } + .order-lg-10 { + -ms-flex-order: 10; + order: 10; + } + .order-lg-11 { + -ms-flex-order: 11; + order: 11; + } + .order-lg-12 { + -ms-flex-order: 12; + order: 12; + } + .offset-lg-0 { + margin-left: 0; + } + .offset-lg-1 { + margin-left: 8.333333%; + } + .offset-lg-2 { + margin-left: 16.666667%; + } + .offset-lg-3 { + margin-left: 25%; + } + .offset-lg-4 { + margin-left: 33.333333%; + } + .offset-lg-5 { + margin-left: 41.666667%; + } + .offset-lg-6 { + margin-left: 50%; + } + .offset-lg-7 { + margin-left: 58.333333%; + } + .offset-lg-8 { + margin-left: 66.666667%; + } + .offset-lg-9 { + margin-left: 75%; + } + .offset-lg-10 { + margin-left: 83.333333%; + } + .offset-lg-11 { + margin-left: 91.666667%; + } + } + + @media (min-width: 1200px) { + .col-xl { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-xl-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-xl-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-xl-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-xl-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-xl-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-xl-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-xl-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-xl-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-xl-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-xl-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-xl-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-xl-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-xl-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-xl-first { + -ms-flex-order: -1; + order: -1; + } + .order-xl-last { + -ms-flex-order: 13; + order: 13; + } + .order-xl-0 { + -ms-flex-order: 0; + order: 0; + } + .order-xl-1 { + -ms-flex-order: 1; + order: 1; + } + .order-xl-2 { + -ms-flex-order: 2; + order: 2; + } + .order-xl-3 { + -ms-flex-order: 3; + order: 3; + } + .order-xl-4 { + -ms-flex-order: 4; + order: 4; + } + .order-xl-5 { + -ms-flex-order: 5; + order: 5; + } + .order-xl-6 { + -ms-flex-order: 6; + order: 6; + } + .order-xl-7 { + -ms-flex-order: 7; + order: 7; + } + .order-xl-8 { + -ms-flex-order: 8; + order: 8; + } + .order-xl-9 { + -ms-flex-order: 9; + order: 9; + } + .order-xl-10 { + -ms-flex-order: 10; + order: 10; + } + .order-xl-11 { + -ms-flex-order: 11; + order: 11; + } + .order-xl-12 { + -ms-flex-order: 12; + order: 12; + } + .offset-xl-0 { + margin-left: 0; + } + .offset-xl-1 { + margin-left: 8.333333%; + } + .offset-xl-2 { + margin-left: 16.666667%; + } + .offset-xl-3 { + margin-left: 25%; + } + .offset-xl-4 { + margin-left: 33.333333%; + } + .offset-xl-5 { + margin-left: 41.666667%; + } + .offset-xl-6 { + margin-left: 50%; + } + .offset-xl-7 { + margin-left: 58.333333%; + } + .offset-xl-8 { + margin-left: 66.666667%; + } + .offset-xl-9 { + margin-left: 75%; + } + .offset-xl-10 { + margin-left: 83.333333%; + } + .offset-xl-11 { + margin-left: 91.666667%; + } + } + + .d-none { + display: none !important; + } + + .d-inline { + display: inline !important; + } + + .d-inline-block { + display: inline-block !important; + } + + .d-block { + display: block !important; + } + + .d-table { + display: table !important; + } + + .d-table-row { + display: table-row !important; + } + + .d-table-cell { + display: table-cell !important; + } + + .d-flex { + display: -ms-flexbox !important; + display: flex !important; + } + + .d-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + + @media (min-width: 576px) { + .d-sm-none { + display: none !important; + } + .d-sm-inline { + display: inline !important; + } + .d-sm-inline-block { + display: inline-block !important; + } + .d-sm-block { + display: block !important; + } + .d-sm-table { + display: table !important; + } + .d-sm-table-row { + display: table-row !important; + } + .d-sm-table-cell { + display: table-cell !important; + } + .d-sm-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-sm-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + } + + @media (min-width: 768px) { + .d-md-none { + display: none !important; + } + .d-md-inline { + display: inline !important; + } + .d-md-inline-block { + display: inline-block !important; + } + .d-md-block { + display: block !important; + } + .d-md-table { + display: table !important; + } + .d-md-table-row { + display: table-row !important; + } + .d-md-table-cell { + display: table-cell !important; + } + .d-md-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-md-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + } + + @media (min-width: 992px) { + .d-lg-none { + display: none !important; + } + .d-lg-inline { + display: inline !important; + } + .d-lg-inline-block { + display: inline-block !important; + } + .d-lg-block { + display: block !important; + } + .d-lg-table { + display: table !important; + } + .d-lg-table-row { + display: table-row !important; + } + .d-lg-table-cell { + display: table-cell !important; + } + .d-lg-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-lg-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + } + + @media (min-width: 1200px) { + .d-xl-none { + display: none !important; + } + .d-xl-inline { + display: inline !important; + } + .d-xl-inline-block { + display: inline-block !important; + } + .d-xl-block { + display: block !important; + } + .d-xl-table { + display: table !important; + } + .d-xl-table-row { + display: table-row !important; + } + .d-xl-table-cell { + display: table-cell !important; + } + .d-xl-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-xl-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + } + + @media print { + .d-print-none { + display: none !important; + } + .d-print-inline { + display: inline !important; + } + .d-print-inline-block { + display: inline-block !important; + } + .d-print-block { + display: block !important; + } + .d-print-table { + display: table !important; + } + .d-print-table-row { + display: table-row !important; + } + .d-print-table-cell { + display: table-cell !important; + } + .d-print-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-print-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } + } + + .flex-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + + .flex-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + + .flex-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + + .flex-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + + .flex-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + + .flex-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + + .flex-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + + .flex-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important; + } + + .flex-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important; + } + + .flex-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important; + } + + .flex-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important; + } + + .flex-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !important; + } + + .justify-content-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + + .justify-content-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + + .justify-content-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + + .justify-content-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + + .justify-content-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + + .align-items-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + + .align-items-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + + .align-items-center { + -ms-flex-align: center !important; + align-items: center !important; + } + + .align-items-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + + .align-items-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + + .align-content-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + + .align-content-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + + .align-content-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + + .align-content-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + + .align-content-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + + .align-content-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + + .align-self-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + + .align-self-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + + .align-self-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + + .align-self-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + + .align-self-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + + .align-self-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } + + @media (min-width: 576px) { + .flex-sm-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-sm-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-sm-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-sm-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-sm-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-sm-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-sm-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .flex-sm-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important; + } + .flex-sm-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important; + } + .flex-sm-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important; + } + .flex-sm-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important; + } + .flex-sm-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !important; + } + .justify-content-sm-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-sm-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-sm-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-sm-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-sm-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-sm-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-sm-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-sm-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-sm-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-sm-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-sm-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-sm-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-sm-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-sm-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-sm-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-sm-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-sm-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-sm-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-sm-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-sm-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-sm-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-sm-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } + } + + @media (min-width: 768px) { + .flex-md-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-md-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-md-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-md-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-md-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-md-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-md-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .flex-md-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important; + } + .flex-md-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important; + } + .flex-md-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important; + } + .flex-md-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important; + } + .flex-md-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !important; + } + .justify-content-md-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-md-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-md-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-md-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-md-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-md-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-md-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-md-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-md-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-md-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-md-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-md-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-md-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-md-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-md-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-md-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-md-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-md-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-md-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-md-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-md-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-md-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } + } + + @media (min-width: 992px) { + .flex-lg-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-lg-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-lg-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-lg-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-lg-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-lg-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-lg-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .flex-lg-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important; + } + .flex-lg-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important; + } + .flex-lg-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important; + } + .flex-lg-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important; + } + .flex-lg-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !important; + } + .justify-content-lg-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-lg-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-lg-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-lg-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-lg-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-lg-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-lg-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-lg-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-lg-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-lg-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-lg-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-lg-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-lg-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-lg-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-lg-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-lg-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-lg-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-lg-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-lg-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-lg-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-lg-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-lg-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } + } + + @media (min-width: 1200px) { + .flex-xl-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-xl-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-xl-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-xl-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-xl-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-xl-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-xl-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .flex-xl-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important; + } + .flex-xl-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important; + } + .flex-xl-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important; + } + .flex-xl-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important; + } + .flex-xl-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !important; + } + .justify-content-xl-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-xl-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-xl-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-xl-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-xl-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-xl-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-xl-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-xl-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-xl-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-xl-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-xl-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-xl-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-xl-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-xl-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-xl-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-xl-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-xl-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-xl-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-xl-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-xl-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-xl-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-xl-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } + } + /*# sourceMappingURL=bootstrap-grid.css.map */ +} diff --git a/src/styles/flex/bootstrap-grid.min.css b/src/styles/flex/bootstrap-grid.min.css new file mode 100644 index 0000000..63e1bc6 --- /dev/null +++ b/src/styles/flex/bootstrap-grid.min.css @@ -0,0 +1,7 @@ +/*! + * Bootstrap Grid v4.1.3 (https://getbootstrap.com/) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */@-ms-viewport{width:device-width}html{box-sizing:border-box;-ms-overflow-style:scrollbar}*,::after,::before{box-sizing:inherit}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}} +/*# sourceMappingURL=bootstrap-grid.min.css.map */ \ No newline at end of file diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000..c46c42d --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,52 @@ +.application.sheet.M6 { + .sheet-header { + margin-top: 8px; + margin-right: 12px; + .profile-img { + position: absolute; + top: 24px; + left: calc(50% - 50px - 6px); + background-color: var(--M6-background-white); + &:hover { + cursor: pointer; + } + } + .text { + margin-bottom: 4px; + } + + .container { + padding: 8px; + background-color: var(--M6-background-grey); + } + } + &.item { + .custom-input { + &.left { + padding-left: 30px; + } + &.right { + padding-right: 30px; + } + } + + .input-icon { + position: absolute; + top: 40%; + transform: translateY(-50%); + color: #888; + /* Prevent the icon from blocking input clicks if it's purely decorative */ + pointer-events: none; + &.left { + left: 18px; + } + &.right { + right: 18px; + } + } + } + + .icon-checked { + background-color: var(--M6-text-brown); + } +} diff --git a/src/styles/hintergrund.scss b/src/styles/hintergrund.scss new file mode 100644 index 0000000..591e896 --- /dev/null +++ b/src/styles/hintergrund.scss @@ -0,0 +1,33 @@ +.application.sheet.M6 { + .collapsible { + background-color: var(--M6-background-white); + cursor: pointer; + padding: 12px; + font-size: 15px; + margin-bottom: 4px; + display: flex; + justify-content: space-between; + + &.active { + background-color: var(--M6-background-brown); + box-shadow: none; + margin-bottom: 0px; + } + } + + /* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ + + /* Style the collapsible content. Note: hidden by default */ + .content { + padding: 0 18px; + display: none; + width: 100%; + overflow: hidden; + background-color: var(--M6-background-white); + &.active { + display: block; + width: 100%; + margin-bottom: 4px; + } + } +} diff --git a/src/styles/icons.scss b/src/styles/icons.scss new file mode 100644 index 0000000..0a47561 --- /dev/null +++ b/src/styles/icons.scss @@ -0,0 +1,21 @@ +.sword { + width: 24px; + height: 24px; + /* Das SVG wird als Maske geladen */ + mask: url("../assets/sword.svg") no-repeat center / contain; + -webkit-mask: url("../assets/sword.svg") no-repeat center / contain; + + /* Standardfarbe (wird durch die Maske in die Form des SVGs gepresst) */ + background-color: var(--M6-text-grey); +} + +.helmet { + width: 24px; + height: 24px; + /* Das SVG wird als Maske geladen */ + mask: url("../assets/helmet.svg") no-repeat center / contain; + -webkit-mask: url("../assets/helmet.svg") no-repeat center / contain; + + /* Standardfarbe (wird durch die Maske in die Form des SVGs gepresst) */ + background-color: var(--M6-text-grey); +} diff --git a/src/styles/items-page.scss b/src/styles/items-page.scss new file mode 100644 index 0000000..6053313 --- /dev/null +++ b/src/styles/items-page.scss @@ -0,0 +1,54 @@ +.application.sheet.M6.actor { + .tab[data-tab="items"] { + ul { + padding-bottom: 20px; + margin: 0; + list-style: none; + padding-left: 5px; + } + + .sticky-progress-container { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + background-color: #f1f1f1; + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); + padding: 10px 0; + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; /* Bleibt immer im Vordergrund */ + } + + /* Der graue Hintergrund des Balkens */ + .progress-background { + width: 90%; /* Breite des Balkens auf dem Bildschirm */ + max-width: 800px; /* Maximale Breite auf großen Bildschirmen */ + background-color: #e0e0e0; + overflow: hidden; /* Schneidet den inneren Balken sauber ab */ + transform: skewX(-30deg); + } + + /* Der eigentliche, animierte Ladebalken */ + .progress-bar { + height: 20px; + background-color: var(--M6-background-brown); /* Grün */ + text-align: center; + line-height: 20px; + color: white; + font-size: 12px; + font-weight: bold; + width: 100%; + } + progress::-moz-progress-bar { + background: var(--M6-background-brown); + } + progress::-webkit-progress-value { + background: var(--M6-background-brown); + } + progress { + color: var(--M6-background-brown); + } + } +} diff --git a/src/styles/resistenzen.scss b/src/styles/resistenzen.scss new file mode 100644 index 0000000..6f214d7 --- /dev/null +++ b/src/styles/resistenzen.scss @@ -0,0 +1,21 @@ +.application.sheet.M6.actor { + .resistenzenHeader { + font-weight: bold; + font-size: 16px; + text-align: center; + } + + .resistenzenAttribut { + max-width: 2rem; + text-align: center; + margin: 0; + } + + .fa-dice-d20 { + border-radius: 40%; + background-color: var(--M6-background-grey); + margin-right: -7px; + position: relative; + font-size: 18px; + } +} diff --git a/src/styles/tabs.scss b/src/styles/tabs.scss new file mode 100644 index 0000000..e641609 --- /dev/null +++ b/src/styles/tabs.scss @@ -0,0 +1,69 @@ +.application.sheet.M6 { + section { + &.window-content { + backdrop-filter: blur(0rem); + overflow: visible; + min-height: 0; + } + } + .tabs { + border: none; + position: absolute; + flex-direction: column; + align-items: flex-start; + gap: 0.625rem; + left: calc(100% + 3px); + top: 20%; + + .sheet-stack { + display: flex; + flex-direction: column; + align-items: center; + color: var(--M6-text-grey); + + .container { + position: relative; + text-align: center; + width: 32px; + height: 36px; + + .background { + position: absolute; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + mask: var(--mask-square) no-repeat center; + background-color: var(--M6-background-grey); + } + + .border { + position: absolute; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + background-color: var(--M6-background-grey); + mask: var(--mask-square) no-repeat center; + } + + .value { + position: relative; + font-family: var(--cosmere-font-header); + font-weight: 600; + color: var(--M6-text-brown); + z-index: 1; + } + } + } + + .active { + text-shadow: 0 0 10px var(--M6-text-brown); + + .container { + width: 38px; + height: 36px; + } + } + } +} diff --git a/src/system.mjs b/src/system.mjs new file mode 100644 index 0000000..59dabfa --- /dev/null +++ b/src/system.mjs @@ -0,0 +1,119 @@ +import { systemPath } from "./constants.mjs"; +import { loadHelpers } from "./helpers/handlebar-helpers.mjs"; +import { loadPartials } from "./helpers/partials.mjs"; +import { loadSettings } from "./helpers/settings.mjs"; + +import { CharacterData } from "./data/character-data.mjs"; +import { WeaponData } from "./data/weapon-data.mjs"; +import { ItemData } from "./data/item-data.mjs"; +import { ArmorData } from "./data/armor-data.mjs"; +import { ZauberData } from "./data/zauber-data.mjs"; +import { HintergrundData } from "./data/hintergrund-data.mjs"; +import { M6ActorSheet } from "./sheets/character-sheet.mjs"; +import { M6ItemSheet } from "./sheets/item-sheet.mjs"; +import { M6WeaponSheet } from "./sheets/weapon-sheet.mjs"; +import { M6ArmorSheet } from "./sheets/armor-sheet.mjs"; +import { M6ZauberSheet } from "./sheets/zauber-sheet.mjs"; +import { M6HintergrundSheet } from "./sheets/hintergrund-sheet.mjs"; +import { M6ChatMessage } from "./ui/chat-message.mjs"; +import "./styles/M6.scss"; + +Hooks.once("init", () => { + CONFIG.ChatMessage.documentClass = M6ChatMessage; + CONFIG.ChatMessage.template = systemPath("templates/chat/message-default.hbs"); + + CONFIG.Actor.dataModels.character = CharacterData; + CONFIG.Actor.trackableAttributes = { + pc: { + bar: ["resources.leben", "resources.ausdauer"], + value: ["level"] + }, + npc: { + bar: ["resources.leben", "resources.ausdauer"], + value: [] + } + }; + CONFIG.Item.dataModels.item = ItemData; + CONFIG.Item.dataModels.geld = ItemData; + CONFIG.Item.dataModels.weapon = WeaponData; + CONFIG.Item.dataModels.armor = ArmorData; + CONFIG.Item.dataModels.zauber = ZauberData; + CONFIG.Item.dataModels.hintergrund = HintergrundData; + + foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "midgard6-lvd", M6ActorSheet, { + types: ["character"], + makeDefault: true + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ItemSheet, { + types: ["item"], + makeDefault: true + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ItemSheet, { + types: ["geld"] + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6WeaponSheet, { + types: ["weapon"] + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ArmorSheet, { + types: ["armor"] + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ZauberSheet, { + types: ["zauber"] + }); + foundry.applications.apps.DocumentSheetConfig.registerSheet( + Item, + "midgard6-lvd", + M6HintergrundSheet, + { + types: ["gunst"] + } + ); + foundry.applications.apps.DocumentSheetConfig.registerSheet( + Item, + "midgard6-lvd", + M6HintergrundSheet, + { + types: ["makel"] + } + ); + foundry.applications.apps.DocumentSheetConfig.registerSheet( + Item, + "midgard6-lvd", + M6HintergrundSheet, + { + types: ["schicksalsgabe"] + } + ); + foundry.applications.apps.DocumentSheetConfig.registerSheet( + Item, + "midgard6-lvd", + M6HintergrundSheet, + { + types: ["legende"] + } + ); + + loadSettings(); + + loadHelpers(); + + loadPartials(); +}); + +Hooks.on("renderChatMessageHTML", (message, html, data) => { + const collapsible = html.querySelectorAll("div[data-action=collapsible]"); + if (collapsible) { + collapsible.forEach((node) => { + node.addEventListener( + "click", + function () { + node.classList.toggle("active"); + var content = node.nextElementSibling; + content.classList.toggle("active"); + node.getElementsByTagName("i")[0].classList.toggle("fa-compress"); + }, + { capture: true } + ); + }); + } +}); diff --git a/src/system.ts b/src/system.ts deleted file mode 100644 index ad5f384..0000000 --- a/src/system.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { CharacterData } from "./data/character-data"; -import { ItemData } from "./data/item-data"; -import { CharacterSheet } from "./sheets/character-sheet"; -import { ItemSheet } from "./sheets/item-sheet"; - -Hooks.once("init", () => { - CONFIG.Actor.dataModels.character = CharacterData; - CONFIG.Item.dataModels.item = ItemData; - - foundry.applications.apps.DocumentSheetConfig.registerSheet( - Actor, - "fvtt-ts-react-boilerplate", - CharacterSheet, - { - types: ["character"], - makeDefault: true - } - ); - foundry.applications.apps.DocumentSheetConfig.registerSheet( - Item, - "fvtt-ts-react-boilerplate", - ItemSheet, - { - types: ["item"], - makeDefault: true - } - ); -}); diff --git a/src/types/data-config.d.mjs b/src/types/data-config.d.mjs new file mode 100644 index 0000000..490951d --- /dev/null +++ b/src/types/data-config.d.mjs @@ -0,0 +1,18 @@ +import { CharacterData } from "../data/character-data"; +import { ItemData } from "../data/item-data"; +import { WeaponData } from "../data/weapon-data"; +import { ArmorData } from "../data/armor-data"; +import { ZauberData } from "../data/zauber-data"; +import { HintergrundData } from "../data/hintergrund-data"; + +declare module "fvtt-types/configuration" { + interface DataModelConfig { + Actor: { character: typeof CharacterData }; + Item: { + item: typeof ItemData, + weapon: typeof WeaponData, + armor: typeof ArmorData, + zauber: typeof ZauberData + hintergrund: typeof HintergrundData }; + } +} diff --git a/src/types/data-config.d.ts b/src/types/data-config.d.ts deleted file mode 100644 index 6ff03ea..0000000 --- a/src/types/data-config.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CharacterData } from "../data/character-data"; -import type { ItemData } from "../data/item-data"; - -declare module "fvtt-types/configuration" { - interface DataModelConfig { - Actor: { character: typeof CharacterData }; - Item: { item: typeof ItemData }; - } -} diff --git a/src/types/foundry.d.ts b/src/types/foundry.d.mjs similarity index 100% rename from src/types/foundry.d.ts rename to src/types/foundry.d.mjs diff --git a/src/ui/chat-message.mjs b/src/ui/chat-message.mjs new file mode 100644 index 0000000..ab35e35 --- /dev/null +++ b/src/ui/chat-message.mjs @@ -0,0 +1,170 @@ +// import { processMessage } from "./message-logic/process-message.js"; + +export class M6ChatMessage extends ChatMessage { + // Default avatar for the chat message + static DEFAULT_AVATAR = "icons/svg/mystery-man.svg"; + + /** + * Render the HTML for the ChatMessage which should be added to the log + * @param {object} [options] Additional options passed to the Handlebars template. + * @param {boolean} [options.canDelete] Render a delete button. By default, this is true for GM users. + * @param {boolean} [options.canClose] Render a close button for dismissing chat card notifications. + * @returns {Promise} + */ + async renderHTML({ canDelete, canClose = false, ...rest } = {}) { + // Default message template + this.template = CONFIG.ChatMessage.template; + + // By default, GM users have the trash-bin icon in the chat log itself + canDelete ??= game.user.isGM || game.user === this.author; + + if (typeof this.system.renderHTML === "function") { + const html = await this.system.renderHTML({ canDelete, canClose, ...rest }); + Hooks.callAll("renderChatMessageHTML", this, html); + return html; + } + // Determine some metadata + const speakerActor = this.speakerActor; + const data = this.toObject(false); + if (!this.isRoll || this.isContentVisible) { + data.content = await foundry.applications.ux.TextEditor.implementation.enrichHTML( + data?.flags?.m6?.description || this.content, + { + rollData: this.getRollData(), + secrets: speakerActor?.isOwner ?? game.user.isGM + } + ); + } + const isWhisper = this.whisper.length; + + // Construct message data + this.messageData = { + // Base messageData and permissions + ...rest, + message: data, + canDelete, + canClose, + isGM: game.user.isGM, + isWhisper: this.whisper.length, + whisperTo: this.whisper.map((u) => game.users.get(u)?.name).filterJoin(", "), + isContentVisible: this.isContentVisible, + + // User and author data + user: game.user, + author: this.author, + + // Display info + title: this.flags["midgard6-lvd"]?.title, + name: this.flags["midgard6-lvd"]?.name, + description: this.flags["midgard6-lvd"]?.description, + alias: this.alias, + speakerActor, + + // If the user can't see the currently visible content, then prefer the author's avatar; + // Otherwise, use the character's avatar (if present), and fall back to the default avatar + // as a last resort + portrait: + ((this.isContentVisible ? speakerActor?.img : undefined) ?? this.author?.avatar) || + this.constructor.DEFAULT_AVATAR, + + // CSS classes + cssClass: [ + this.style === CONST.CHAT_MESSAGE_STYLES.IC ? "ic" : null, + this.style === CONST.CHAT_MESSAGE_STYLES.EMOTE ? "emote" : null, + isWhisper ? "whisper" : null, + this.blind ? "blind" : null + ].filterJoin(" "), + + // System-specific flags + eigenschaften: this.isContentVisible ? this.getFlag("midgard6-lvd", "eigenschaften") : "", + merkmale: this.isContentVisible ? this.getFlag("midgard6-lvd", "merkmale") : "", + beschreibung: this.isContentVisible ? this.getFlag("midgard6-lvd", "beschreibung") : "", + zeigeZauberAlsTag: game.settings.get("midgard6-lvd", "zauberAlsTag"), + isSpell: this.getFlag("midgard6-lvd", "isSpell"), + isRoll: this?.isRoll || false + }; + // Render additional message data + if (this.isRoll) { + await this.#renderRollContent(this.messageData); + } + + // Add a check in for in case modules are adding content to use that as the description + // if (this.messageData?.message?.content) { + // this.messageData.description = this.messageData?.message?.content; + // } + // Render the chat message + let html = await foundry.applications.handlebars.renderTemplate( + this.template, + this.messageData + ); + html = foundry.utils.parseHTML(html); + // Flag expanded state of dice rolls + Hooks.callAll("renderChatMessageHTML", this, html, this.messageData); + + // Get whether descriptions should auto-expand for this user or not and apply the styling + const autoExpand = game.settings.get("midgard6-lvd", "beschreibungChatActive"); + if (autoExpand) { + const collapsibleContent = html.querySelector(".collapsible.beschreibung"); + if (collapsibleContent) { + collapsibleContent.classList.toggle("active"); + var content = collapsibleContent.nextElementSibling; + content.classList.toggle("active"); + collapsibleContent.getElementsByTagName("i")[0].classList.toggle("fa-compress"); + } + } + + return html; + } + + // Code pulled from core since this is a private method as of V13 + async #renderRollContent(messageData) { + const data = messageData.message; + const renderRolls = async (isPrivate) => { + let html = ""; + let content = []; + + for (const roll of this.rolls) { + html = await roll.render({ + isPrivate + }); + content.push({ options: roll.options, html }); + } + return content; + }; + + // Suppress the "to:" whisper flavor for private rolls + if (this.blind || this.whisper.length) messageData.isWhisper = false; + + // Display standard Roll HTML content + if (this.isContentVisible) { + const el = document.createElement("div"); + el.innerHTML = data.content; // Ensure the content does not already contain custom HTML + if (!el.childElementCount && this.rolls.length) { + data.content = await this.#renderRollHTML(false); + } + } else { + // Otherwise, show "rolled privately" messages for Roll content + const name = this.author?.name ?? game.i18n.localize("CHAT.UnknownUser"); + data.flavor = game.i18n.format("CHAT.PrivateRollContent", { + user: foundry.utils.escapeHTML(name) + }); + data.content = await renderRolls(true); + messageData.alias = name; + } + } + + async #renderRollHTML(isPrivate) { + let html = ""; + let content = []; + + for (const roll of this.rolls) { + html = await roll.render({ + isPrivate, + message: this + }); + content.push({ options: roll.options, html }); + } + + return content; + } +} diff --git a/system.json b/system.json index 429cbf6..84eb7a8 100644 --- a/system.json +++ b/system.json @@ -1,14 +1,14 @@ { - "id": "fvtt-ts-react-boilerplate", + "id": "midgard6-lvd", "version": "0.8.2", - "title": "FVTT TS+React Boilerplate", + "title": "Midgard: Legenden von Damatu", "url": "", - "description": "A TypeScript + React + Vite boilerplate for Foundry VTT V14 system development", + "description": "Eine Midgard: LvD implementation", "license": "LICENSE.txt", "authors": [ { - "name": "Nyukhu", - "url": "https://foundryvtt.com", + "name": "Byroks", + "url": "https://git.byroks.de", "flags": {} } ], @@ -16,15 +16,15 @@ "styles": ["dist/style.css"], "languages": [ { - "lang": "en", - "name": "English", - "path": "lang/en.json", + "lang": "de", + "name": "Deutsch", + "path": "lang/de.json", "flags": {} }, { - "lang": "fr", - "name": "Français", - "path": "lang/fr.json", + "lang": "en", + "name": "English", + "path": "lang/en.json", "flags": {} } ], @@ -33,17 +33,31 @@ "character": {} }, "Item": { - "item": {} + "item": {}, + "weapon": {}, + "armor": {}, + "zauber": {}, + "gunst": {}, + "makel": {}, + "schicksalsgabe": {}, + "legende": {}, + "geld": {} } }, "compatibility": { - "minimum": "14", + "minimum": "13", "verified": "14" }, "manifest": "", "download": "", "grid": { - "distance": 5, - "units": "ft" + "distance": 1, + "units": "m" + }, + "flags": { + "hotReload": { + "extensions": ["css", "scss", "html", "hbs", "json"], + "paths": ["dist", "templates", "lang", "src", "src/styles/M6.scss"] + } } } diff --git a/templates/actor/biographie.hbs b/templates/actor/biographie.hbs new file mode 100644 index 0000000..8d8eecc --- /dev/null +++ b/templates/actor/biographie.hbs @@ -0,0 +1,24 @@ +{{! Beschreibung Allgemein Tab }} + + + {{localize "Midgard6.Sheets.Tabs.biographie"}} + {{#if editable}} + + {{{enrichedBeschreibung}}} + + {{else}} + {{{enrichedBeschreibung}}} + {{/if}} + + \ No newline at end of file diff --git a/templates/actor/eigenschaften.hbs b/templates/actor/eigenschaften.hbs new file mode 100644 index 0000000..28ec145 --- /dev/null +++ b/templates/actor/eigenschaften.hbs @@ -0,0 +1,280 @@ + + + + + {{#each skills}} + {{#if fieldset}} + + {{localize legend}} + {{#each fields}} + + + + {{localize + localizationName + }} + + + + + + + + + + {{#each bonuses}} + {{name}}: {{level}}{{#unless @last}},{{/unless}} + {{/each}} + + + + {{/each}} + + {{/if}} + {{/each}} + + + + {{localize "Midgard6.Attribute.resistenzen"}} + + {{#each resistenzen.fields}} + + + {{localize localizationName}} + + + + + + + + {{/each}} + + + + + {{localize "Midgard6.Attribute.lp"}} + + + {{localize "Midgard6.aktuell"}} + + + + {{system.rüstwert.mod}} + + + + + / + + {{localize "Midgard6.maximal.short"}} + + + + + + {{localize "Midgard6.Attribute.ap"}} + + + {{localize "Midgard6.aktuell"}} + + + + / + + {{localize "Midgard6.maximal.short"}} + + + + + + + + {{localize "Midgard6.Schicksalsmünzen"}} + + + + + Misserfolg geringer Erfolg + Würfelwurf wiederholen + Geistesblitz + Mitspielende belohnen + + + + + + + + {{localize "Midgard6.Item.type.weapon.plural" }} + + {{#each equippedWeapons as |weapon|}} + + + + + {{weapon.name}}: + + + + {{weapon.skillValue}} {{#if weapon.bonusValue}}+ {{weapon.bonusValue}}{{/if}} + + + + + + + + + {{/each}} + + + + + + {{localize "Midgard6.Item.type.armor.plural" }} + + {{#each armor.armors as |armor|}} + + + + + {{armor.name}} + + + + + + {{armor.rüstwert}} + + + + {{/each}} + {{#if armor.einschränkungen}} + {{localize "Midgard6.Item.einschränkung"}} + {{splitArray armor.einschränkungen}} + {{/if}} + + + + + + {{localize "Midgard6.Item.type.zauber.plural" }} + + {{#each equippedSpells as |weapon|}} + + + + + {{weapon.name}}: + + + + {{weapon.skillValue}} {{#if weapon.bonusValue}}+ {{weapon.bonusValue}}{{/if}} + + + + + + + + + {{/each}} + + + + + + + \ No newline at end of file diff --git a/templates/actor/header.hbs b/templates/actor/header.hbs new file mode 100644 index 0000000..61915ad --- /dev/null +++ b/templates/actor/header.hbs @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + diff --git a/templates/actor/hintergrund.hbs b/templates/actor/hintergrund.hbs new file mode 100644 index 0000000..25f3213 --- /dev/null +++ b/templates/actor/hintergrund.hbs @@ -0,0 +1,266 @@ +{{! Beschreibung Allgemein Tab }} + + + + + + {{localize "Midgard6.Grad.grad"}} + + + {{localize + "Midgard6.Grad.erfahrung" + }} + + {{localize + "Midgard6.Grad.frei" + }} + + + + + + {{localize + "Midgard6.Grad.eingesetzt" + }} + + + + = + + {{localize + "Midgard6.Grad.gesamt" + }} + + + + + + + + + + {{localize "Midgard6.Hintergrund.type.gunst.singular"}} + & + {{localize "Midgard6.Hintergrund.type.makel.singular"}} + + + {{#with itemTypes.gunst}} + {{#each this.items as |gunst|}} + {{gunst.name}} + + + {{#if @root.editable}} + + + + {{/if}} + + + + + {{{gunst.system.beschreibung}}} + + {{/each}} + {{/with}} + + + {{#with itemTypes.makel}} + {{#each this.items as |makel|}} + {{makel.name}} + + + {{#if @root.editable}} + + + + {{/if}} + + + + {{{makel.system.beschreibung}}} + + {{/each}} + {{/with}} + + + + + + + + {{localize "Midgard6.Hintergrund.type.legende.plural"}} + + + {{#with itemTypes.legende}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + {{#each this.items as |legende|}} + {{legende.name}} + + + + + + {{#if @root.editable}} + + + + {{/if}} + + + + + {{{legende.system.beschreibung}}} + + {{/each}} + {{/with}} + + + + + + + + {{localize "Midgard6.Hintergrund.type.schicksalsgabe.plural"}} + + + {{#with itemTypes.schicksalsgabe}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + {{#each this.items as |schicksalsgabe|}} + {{schicksalsgabe.name}} + + + {{#if @root.editable}} + + + + {{/if}} + + + + + {{{gunst.system.beschreibung}}} + + {{/each}} + {{/with}} + + + + + + + \ No newline at end of file diff --git a/templates/actor/items.hbs b/templates/actor/items.hbs new file mode 100644 index 0000000..cd9cd19 --- /dev/null +++ b/templates/actor/items.hbs @@ -0,0 +1,237 @@ +{{! Items Tab }} + + + + + + {{localize "Midgard6.Item.type.münze.plural" }} + + {{#with itemTypes.geld}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + + {{#each this.items as |item|}} + + + {{item.system.anzahl}}x {{item.name}} + {{#if @root.editable}} + + + + + + + + + + + + + + + + + {{/if}} + + {{/each}} + + {{/with}} + + + {{localize "Midgard6.Item.type.item.plural" }} + + {{#with itemTypes.item}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + + {{#each this.items as |item|}} + + + {{item.system.anzahl}}x {{item.name}} + + {{#if @root.editable}} + + + + + + + {{/if}} + + + {{/each}} + + {{/with}} + + + + {{!-- Waffen --}} + + + {{localize "Midgard6.Item.type.weapon.plural" }} + + {{#with itemTypes.weapon}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + + {{#each this.items as |item|}} + + + {{item.system.anzahl}}x {{item.name}} + + + + {{#if @root.editable}} + + + + + + + {{/if}} + + + {{/each}} + + {{/with}} + + + {{!-- Rüstung --}} + + + {{localize "Midgard6.Item.type.armor.plural" }} + + {{#with itemTypes.armor}} + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type=this.label}} + + {{/if}} + + + + {{#each this.items as |item|}} + + + {{item.system.anzahl}}x {{item.name}} + + + {{#if @root.editable}} + + + + + + + {{/if}} + + + {{/each}} + + {{/with}} + + + + + + + + + + + \ No newline at end of file diff --git a/templates/actor/zauber.hbs b/templates/actor/zauber.hbs new file mode 100644 index 0000000..9cc98ed --- /dev/null +++ b/templates/actor/zauber.hbs @@ -0,0 +1,60 @@ +{{! Items Tab }} + + + + + + {{localize "Midgard6.Item.type.zauber.plural" }} + + + + + {{#if @root.editable}} + + + {{localize "DOCUMENT.Create" type="Zauber"}} + + {{/if}} + + + + {{#each zauber as |zauber|}} + + {{zauber.name}} + {{zauber.system.eigenschaften.ursprung}} + {{localize "Midgard6.Zauber.stufe"}} {{zauber.system.eigenschaften.stufe}} + + + + {{#if @root.editable}} + + + + + + + {{/if}} + + + {{/each}} + + + + + + + \ No newline at end of file diff --git a/templates/chat/chat-message-header.hbs b/templates/chat/chat-message-header.hbs new file mode 100644 index 0000000..88608c6 --- /dev/null +++ b/templates/chat/chat-message-header.hbs @@ -0,0 +1,37 @@ + + + + + + + {{alias}} + + + {{author.name}} + + {{#if isWhisper}} + {{localize "CHAT.To"}}: {{whisperTo}} + {{/if}} + + + {{!-- {{timeSinceShort message.timestamp}} --}} + {{#if canDelete}} + + + + {{/if}} + {{#if canClose}} + + + + {{/if}} + + + {{#if message.flavor}} + {{{message.flavor}}} + {{/if}} + \ No newline at end of file diff --git a/templates/chat/message-default.hbs b/templates/chat/message-default.hbs new file mode 100644 index 0000000..05a306b --- /dev/null +++ b/templates/chat/message-default.hbs @@ -0,0 +1,69 @@ + + {{> "systems/midgard6-lvd/templates/chat/chat-message-header.hbs"}} + + {{!-- --}} + {{#if isContentVisible}} + + {{#if isSpell}} + + {{#each eigenschaften as |eigenschaft|}} + {{#if eigenschaft}} + {{eigenschaft}} + {{/if}} + {{/each}} + + {{localize "Midgard6.Item.merkmale"}} + + + + + + {{#each eigenschaften as |eigenschaft|}} + {{#if eigenschaft}} + {{localizeConcat "Midgard6.Zauber." @key}}: {{eigenschaft}} + {{/if}} + {{/each}} + + {{/if}} + {{#if merkmale}} + + {{#each merkmale as |merkmal|}} + {{merkmal}} + {{/each}} + + {{/if}} + {{#if isRoll}} + {{#each message.content as |roll|}} + + {{#if roll.options.title}}{{roll.options.title}}{{/if}} + {{{roll.html}}} + + + {{/each}} + {{else}} + + {{#if title}}{{title}}{{/if}} + {{{message.content}}} + + {{/if}} + + {{#if beschreibung}} + {{localize "Midgard6.Item.Description"}} + + + + + + {{{beschreibung}}} + + {{/if}} + {{else}} + {{> "systems/midgard6-lvd/templates/chat/secret-roll.hbs"}} + {{/if}} + \ No newline at end of file diff --git a/templates/chat/secret-roll.hbs b/templates/chat/secret-roll.hbs new file mode 100644 index 0000000..13e55cc --- /dev/null +++ b/templates/chat/secret-roll.hbs @@ -0,0 +1,13 @@ + + {{#if isRoll}} + ??? + + + ??? + ? + + + {{else}} + ??? + {{/if}} + \ No newline at end of file diff --git a/templates/combat/create-dialog.hbs b/templates/combat/create-dialog.hbs new file mode 100644 index 0000000..8020209 --- /dev/null +++ b/templates/combat/create-dialog.hbs @@ -0,0 +1,9 @@ + + + {{localize "Type"}} + + + {{selectOptions types selected=type}} + + + diff --git a/templates/dialog/roll-dialog.hbs b/templates/dialog/roll-dialog.hbs new file mode 100644 index 0000000..cbd3490 --- /dev/null +++ b/templates/dialog/roll-dialog.hbs @@ -0,0 +1,91 @@ + + + Modifikation + + + {{! }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{! }} + + + + + {{#each bonuses}} + + + + {{name}}: + {{level}} + + + {{/each}} + + + + {{#if damageRoll}} + + + + {{/if}} + + + + {{selectOptions rollModes selected=rollMode localize=true}} + + + + + + \ No newline at end of file diff --git a/templates/dialog/spezialisierung-dialog.hbs b/templates/dialog/spezialisierung-dialog.hbs new file mode 100644 index 0000000..affc4a0 --- /dev/null +++ b/templates/dialog/spezialisierung-dialog.hbs @@ -0,0 +1,46 @@ + + + {{localize "Midgard6.Sheets.spezialisierung"}} + + + + + + + {{localize "Midgard6.Stufe"}}: + + + + + 1 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + \ No newline at end of file diff --git a/templates/hintergrund/description.hbs b/templates/hintergrund/description.hbs new file mode 100644 index 0000000..1427d59 --- /dev/null +++ b/templates/hintergrund/description.hbs @@ -0,0 +1,25 @@ +{{! Beschreibung Allgemein Tab }} + + {{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }} + + {{localize "Midgard6.Item.Description"}} + {{#if editable}} + + {{{enrichedBeschreibung}}} + + {{else}} + {{{enrichedBeschreibung}}} + {{/if}} + + \ No newline at end of file diff --git a/templates/hintergrund/header.hbs b/templates/hintergrund/header.hbs new file mode 100644 index 0000000..1fc36bc --- /dev/null +++ b/templates/hintergrund/header.hbs @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + {{#each schicksalsgaben as |schicksalsgabe|}} + + {{schicksalsgabe.name}} + + {{/each}} + + + + + + \ No newline at end of file diff --git a/templates/item/description.hbs b/templates/item/description.hbs new file mode 100644 index 0000000..1427d59 --- /dev/null +++ b/templates/item/description.hbs @@ -0,0 +1,25 @@ +{{! Beschreibung Allgemein Tab }} + + {{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }} + + {{localize "Midgard6.Item.Description"}} + {{#if editable}} + + {{{enrichedBeschreibung}}} + + {{else}} + {{{enrichedBeschreibung}}} + {{/if}} + + \ No newline at end of file diff --git a/templates/item/header.hbs b/templates/item/header.hbs new file mode 100644 index 0000000..14e9066 --- /dev/null +++ b/templates/item/header.hbs @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/item/rüstung/eigenschaften.hbs b/templates/item/rüstung/eigenschaften.hbs new file mode 100644 index 0000000..3380ef2 --- /dev/null +++ b/templates/item/rüstung/eigenschaften.hbs @@ -0,0 +1,46 @@ + + + {{localize "Midgard6.Item.Eigenschaften"}} + + + + + {{localize "Midgard6.Item.rüstwert"}} + + + + + + {{localize "Midgard6.Item.helm"}} + + + + + + {{localize "Midgard6.Item.einschränkung"}} + + + + + + + \ No newline at end of file diff --git a/templates/item/waffen/eigenschaften.hbs b/templates/item/waffen/eigenschaften.hbs new file mode 100644 index 0000000..6aaf74a --- /dev/null +++ b/templates/item/waffen/eigenschaften.hbs @@ -0,0 +1,72 @@ + + + {{localize "Midgard6.Item.Eigenschaften"}} + + + + + {{localize "Midgard6.Item.schaden"}} + + + + + + + {{localize "Midgard6.Item.fertigkeit"}} + + {{localize + "Midgard6.Skills.fernkampf" + }} + {{localize + "Midgard6.Skills.nahkampf" + }} + + + + + + {{localize "Midgard6.Item.spezialisierung"}} + + + {{#each bonuses as |bonus|}} + + {{bonus.name}} + + {{/each}} + + + + + + {{localize "Midgard6.Item.waffenmerkmale"}} + + + + + + + \ No newline at end of file diff --git a/templates/shared/effects.hbs b/templates/shared/effects.hbs new file mode 100644 index 0000000..ae67156 --- /dev/null +++ b/templates/shared/effects.hbs @@ -0,0 +1,59 @@ +{{! Effects Tab }} + + + {{#each effects as |section sid|}} + + + {{localize section.label}} + + + {{localize "EFFECT.FIELDS.origin.label"}} + + {{localize "EFFECT.TABS.duration"}} + + --}} + {{#if (eq section.type "inactive" )}} data-disabled="true" + {{else if (eq section.type "temporary" )}} data-duration.rounds="1" {{/if}} + data-origin="{{@root.document.uuid}}" + title="{{localize 'DOCUMENT.Create' type=(localize 'DOCUMENT.ActiveEffect')}}" + data-img="icons/svg/aura.svg" + > + + {{localize "DOCUMENT.New" type=(localize "UTS.Effect.Label")}} + + + + + + {{#each section.effects as |effect|}} + + + + {{effect.name}} + + {{effect.sourceName}} + {{effect.duration.label}} + + {{#if @root.editable}} + + + + {{/if}} + + + + {{#if @root.editable}} + + + + {{/if}} + + + {{/each}} + + {{/each}} + + diff --git a/templates/shared/tabs.hbs b/templates/shared/tabs.hbs new file mode 100644 index 0000000..c47d806 --- /dev/null +++ b/templates/shared/tabs.hbs @@ -0,0 +1,42 @@ + + {{#each tabs}} + + + + + + + + + + {{/each}} + {{#isdefined system.locked}} + {{#if @root.editable}} + + + + + + {{#if system.locked}} + + {{else}} + + {{/if}} + + + + {{/if}} + {{/isdefined}} + \ No newline at end of file diff --git a/templates/zauber/description.hbs b/templates/zauber/description.hbs new file mode 100644 index 0000000..a61840e --- /dev/null +++ b/templates/zauber/description.hbs @@ -0,0 +1,26 @@ +{{! Beschreibung Allgemein Tab }} + + {{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }} + + {{localize "Midgard6.Item.Description"}} + {{#if editable}} + + {{{enrichedBeschreibung}}} + + {{else}} + {{{enrichedBeschreibung}}} + {{/if}} + + \ No newline at end of file diff --git a/templates/zauber/eigenschaften.hbs b/templates/zauber/eigenschaften.hbs new file mode 100644 index 0000000..8afbd85 --- /dev/null +++ b/templates/zauber/eigenschaften.hbs @@ -0,0 +1,31 @@ + + + {{localize "Midgard6.Item.Eigenschaften"}} + + + {{#each zauberFields.eigenschaften.fields}} + {{#unlesseq field.name "ursprung"}} + {{#unlesseq field.name "stufe"}} + + + {{localizeConcat "Midgard6.Zauber." field.name}} + + + + {{/unlesseq}} + {{/unlesseq}} + {{/each}} + + + + \ No newline at end of file diff --git a/templates/zauber/header.hbs b/templates/zauber/header.hbs new file mode 100644 index 0000000..eaaae57 --- /dev/null +++ b/templates/zauber/header.hbs @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + {{#each bonuses as |bonus|}} + + {{bonus.name}} + + {{/each}} + Kleiner Zauber + Zaubersalz + + + + + + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index bfb7026..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022", "DOM"], - "module": "ESNext", - "moduleResolution": "Bundler", - "types": ["fvtt-types"], - "jsx": "react-jsx", - "strict": true, - "skipLibCheck": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "isolatedModules": true - }, - "include": ["src"] -} diff --git a/vite.config.ts b/vite.config.ts index f06c7cf..40e0149 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ outDir: "dist", emptyOutDir: true, lib: { - entry: "src/system.ts", + entry: "src/system.mjs", formats: ["es"], fileName: () => "system.mjs" },
{{localize + localizationName + }}
{{localize localizationName}}
{{localize "Midgard6.aktuell"}}
/
{{localize "Midgard6.maximal.short"}}
{{weapon.name}}:
+ + + {{weapon.skillValue}} {{#if weapon.bonusValue}}+ {{weapon.bonusValue}}{{/if}}
{{armor.name}}
{{localize "Midgard6.Item.einschränkung"}}
{{splitArray armor.einschränkungen}}
{{localize + "Midgard6.Grad.erfahrung" + }}
+
=
{{zauber.name}}
{{zauber.system.eigenschaften.ursprung}}
{{localize "Midgard6.Zauber.stufe"}} {{zauber.system.eigenschaften.stufe}}
{{localizeConcat "Midgard6.Zauber." @key}}: {{eigenschaft}}
???
{{localize "Midgard6.Stufe"}}:
1
2
3
{{localize "Midgard6.Item.rüstwert"}}
{{localize "Midgard6.Item.helm"}}
{{localize "Midgard6.Item.schaden"}}
{{localize "Midgard6.Item.fertigkeit"}}
{{localize "Midgard6.Item.spezialisierung"}}
{{localize "Midgard6.Item.waffenmerkmale"}}
{{localizeConcat "Midgard6.Zauber." field.name}}