introducing fallback colors for very olf PVO versions
This commit is contained in:
30960
client/dist/seatmap.js
vendored
30960
client/dist/seatmap.js
vendored
File diff suppressed because one or more lines are too long
@@ -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"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
client/src/types/types.d.ts
vendored
1
client/src/types/types.d.ts
vendored
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user