Neo-Tokyo Neon Noir design pour fiches items
- Nouvelle palette : #080c14 fond, accents néon par type (#00d4d4 item, #ff3d5a kungfu, #4a9eff spell, #cc44ff supernatural) - Nouveaux composants LESS : .cde-neon-header (clip-path angulaire + accent line), .cde-avatar (clip-path), .cde-stat-grid/.cde-stat-cell (style terminal), .cde-badge (parallélogramme), .cde-neon-tabs (underline néon animé), .cde-check-cell - Fix layout : .cde-sheet width: 100% + height: 100% + overflow: hidden, .cde-tab-body flex: 1 + min-height: 0, .cde-notes-editor flex stretch - Fix positions : DEFAULT_OPTIONS height explicite pour tous les types (item 620x580, spell 660x680, kungfu 720x680, supernatural 560x520) - 4 templates items reécrits avec nouvelles classes et structure épurée Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
49
src/ui/helpers.js
Normal file
49
src/ui/helpers.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import { MAGICS } from "../config/constants.js"
|
||||
|
||||
export function registerHandlebarsHelpers() {
|
||||
const { Handlebars } = globalThis
|
||||
if (!Handlebars) return
|
||||
|
||||
Handlebars.registerHelper("select", function (selected, options) {
|
||||
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected))
|
||||
const rgx = new RegExp(` value=["']${escapedValue}["']`)
|
||||
const html = options.fn(this)
|
||||
return html.replace(rgx, "$& selected")
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicBackground", function (magic) {
|
||||
return game.i18n.localize(MAGICS[magic]?.background ?? "")
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicLabel", function (magic) {
|
||||
return game.i18n.localize(MAGICS[magic]?.label ?? "")
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicAspectLabel", function (magic) {
|
||||
return game.i18n.localize(MAGICS[magic]?.aspectlabel ?? "")
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityLabel", function (magic, speciality) {
|
||||
return game.i18n.localize(MAGICS[magic]?.speciality?.[speciality]?.label ?? "")
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityClassIcon", function (magic, speciality) {
|
||||
return MAGICS[magic]?.speciality?.[speciality]?.classicon ?? ""
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityIcon", function (magic, speciality) {
|
||||
return MAGICS[magic]?.speciality?.[speciality]?.icon ?? ""
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityElementIcon", function (magic, speciality) {
|
||||
return MAGICS[magic]?.speciality?.[speciality]?.elementicon ?? ""
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityLabelIcon", function (magic, speciality) {
|
||||
return MAGICS[magic]?.speciality?.[speciality]?.labelicon ?? ""
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("getMagicSpecialityLabelElement", function (magic, speciality) {
|
||||
return game.i18n.localize(MAGICS[magic]?.speciality?.[speciality]?.labelelement ?? "")
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user