@designliquido/foles
Version:
Linguagem de folhas de estilo para documentos em geral em português
43 lines • 1.86 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjetarSombra = void 0;
const metodo_1 = require("./metodo");
const cores_1 = require("../../../modificadores/atributos/cores");
class ProjetarSombra extends metodo_1.Metodo {
constructor(valor1, quantificador1, valor2, quantificador2, valor3, quantificador3, cor) {
super();
this.valor1 = Number(valor1.lexema);
this.quantificador1 = quantificador1.lexema;
this.valor2 = Number(valor2.lexema);
this.quantificador2 = quantificador2.lexema;
this.valor3 = valor3 ? Number(valor3.lexema) : null;
this.quantificador3 = quantificador3 ? quantificador3.lexema : null;
this.cor = cor ? cor.lexema : null;
this.traducao = "drop-shadow";
}
paraTexto() {
/**
* CASOS:
* 1. Dois valores
* 2. Dois valores + cor
* 3. Três valores
* 4. Três valores + cor
*/
if (!this.valor3) {
if (!this.cor) {
return `drop-shadow(${this.valor1}${this.quantificador1} ${this.valor2}${this.quantificador2})`;
}
else {
this.cor = cores_1.cores[this.cor];
return `drop-shadow(${this.valor1}${this.quantificador1} ${this.valor2}${this.quantificador2} ${this.cor})`;
}
}
else if (!this.cor) {
return `drop-shadow(${this.valor1}${this.quantificador1} ${this.valor2}${this.quantificador2} ${this.valor3}${this.quantificador3})`;
}
this.cor = cores_1.cores[this.cor];
return `drop-shadow(${this.valor1}${this.quantificador1} ${this.valor2}${this.quantificador2} ${this.valor3}${this.quantificador3} ${this.cor})`;
}
}
exports.ProjetarSombra = ProjetarSombra;
//# sourceMappingURL=projetar-sombra.js.map