-
-
-
-
-
-
- ${this.activeTab === "real"
- ? html`
-
-
- ${Countries.filter(
- (country) =>
- country.name
- .toLowerCase()
- .includes(this.search.toLowerCase()) ||
- country.code
- .toLowerCase()
- .includes(this.search.toLowerCase()),
- ).map(
- (country) => html`
-
- `,
- )}
-
- `
- : html`
-
-
-
-
- ${this.colorOptions.map((color) => {
- const isLocked =
- this.lockedColors.includes(color);
- const isSpecial = !color.startsWith("#");
- const colorClass = isSpecial
- ? `flag-color-${color}`
- : "";
- const inlineStyle = isSpecial
- ? ""
- : `background-color: ${color};`;
- const isSelected = this.selectedColor === color;
- return html`
-
- `;
- })}
-
-
-
- Select a Layer
-
-
- ${this.customLayers.length >= MAX_LAYER
- ? html`
-
- You've reached the maximum number of
- layers.
- Please remove some to add new ones.
-
- `
- : null}
-
-
- ${Object.entries(FlagMap)
- .filter(
- ([name]) => name !== "frame" && name !== "full",
- )
- .map(([name, src]) => {
- const isLocked =
- this.lockedLayers.includes(name);
- const isDisabled =
- !isLocked &&
- this.customLayers.length >= MAX_LAYER;
-
- const isSpecial =
- !this.selectedColor.startsWith("#");
- const colorClass = isSpecial
- ? `flag-color-${this.selectedColor}`
- : "";
- const colorStyle = isSpecial
- ? ""
- : `background-color: ${this.selectedColor};`;
-
- const reason = isLocked
- ? this.lockedReasons[name] || "Locked"
- : isDisabled
- ? `You can only add up to ${MAX_LAYER} layers.`
- : "";
-
- return html`
-
- `;
- })}
-
-
-
-
-
-
- Preview
-
-
- ${this.customLayers.map(({ name, color }) => {
- const src = FlagMap[name];
- if (!src) return null;
- console.log("color", color);
- const isSpecial = !color.startsWith("#");
- const colorClass = isSpecial
- ? `flag-color-${color}`
- : "";
- const bgStyle = isSpecial
- ? ""
- : `background-color: ${color};`;
-
- return html`
-
- `;
- })}
-
-
-
-
-
-
- Layers (${this.customLayers.length})
-
-
- ${this.customLayers.map((_, i, arr) => {
- const index = arr.length - 1 - i;
- const { name, color } = arr[index];
- const isFixed =
- name === "full" || name === "frame";
-
- const isSpecial = !color.startsWith("#");
- const colorClass = isSpecial
- ? `flag-color-${color}`
- : "";
- const inlineStyle = isSpecial
- ? ""
- : `background-color: ${color};`;
-
- return html`
- -
-
-
-
- ${name}
- ${isFixed
- ? html`(fixed)`
- : ""}
-
-
- ${!isFixed
- ? html`
- ${index > 1 &&
- this.customLayers[index - 1]
- .name !== "full"
- ? html`
-
- `
- : ""}
- ${index <
- this.customLayers.length - 2 &&
- this.customLayers[index + 1]
- .name !== "frame"
- ? html`
-
- `
- : ""}
-
- `
- : null}
-
-
-
-
- ${this.openColorIndex === index
- ? html`
-
- ${this.colorOptions.map((color) => {
- const isLocked =
- this.lockedColors.includes(
- color,
- );
- const isSpecial =
- !color.startsWith("#");
- const colorClass = isSpecial
- ? `flag-color-${color}`
- : "";
- const inlineStyle = isSpecial
- ? ""
- : `background-color: ${color};`;
-
- return html`
-
- `;
- })}
-
- `
- : ""}
-
- `;
- })}
-
-
-
-
- `}
-