introducing fallback colors for very olf PVO versions

This commit is contained in:
zino
2021-06-10 13:56:08 +02:00
parent 1a788d16fd
commit d190314083
4 changed files with 30699 additions and 287 deletions

30960
client/dist/seatmap.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -39,5 +39,17 @@ export const config: I.Config = {
panzoom: undefined, panzoom: undefined,
inVenueXML: undefined, inVenueXML: undefined,
seatmapXML: undefined, seatmapXML: undefined,
} },
fallbackColors: [
"#ae2fb7",
"#150021",
"#90af80",
"#7f261a",
"#040fdb",
"#5896dd",
"#47994d",
"#6937bf",
"#5b2d53",
"#4f4d28"
]
} }

View File

@@ -96,10 +96,15 @@ export function generatePricescaleCSS(): string {
const venueXML: I.VenueXML = config.state.inVenueXML!; const venueXML: I.VenueXML = config.state.inVenueXML!;
const venuePricescalesArr: I.Pricescale2[] = venueXML.venue[0].pricescales[0].pricescale; const venuePricescalesArr: I.Pricescale2[] = venueXML.venue[0].pricescales[0].pricescale;
return venuePricescalesArr.map(arr => { return venuePricescalesArr.map((arr, i) => {
const ID: string = arr.id[0]; const ID: string = arr.id[0];
let color: string = `#${arr.color[0]} !important`; // Update: Colors are always defined: fallback colors exist in system so every XML provides them const color: string = arr.color[0];
return `._${ID} { background-color: ${color}; }`;
// Update: Colors are always defined: fallback colors exist in system so every XML provides them
// Update 2: Above is not true, since old PVO versions does NOT have default/fallback colors
const colorCSS:string = color ? `#${color} !important` : `${config.fallbackColors[i]} !important`;
return `._${ID} { background-color: ${colorCSS}; }`;
}).join("\r\n"); }).join("\r\n");
} }

View File

@@ -95,6 +95,7 @@ export interface Config {
maxSelectedSeats: number; maxSelectedSeats: number;
state: State; state: State;
resources: Resources; resources: Resources;
fallbackColors: string[];
} }
export interface Resources { export interface Resources {