-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FInaliza implementação de metodos na tradução reversa
- Loading branch information
1 parent
314a966
commit bfb5cd3
Showing
10 changed files
with
328 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Simbolo } from "../../../lexador"; | ||
import { MetodoCss } from "./metodo-css"; | ||
|
||
export class Translate extends MetodoCss { | ||
valor1: number; | ||
quantificador1: string; | ||
valor2: number; | ||
quantificador2: string; | ||
traducao: string; | ||
|
||
constructor(valor1: Simbolo, quantificador1: Simbolo, valor2: Simbolo, quantificador2: Simbolo) { | ||
super(); | ||
this.valor1 = Number(valor1.lexema); | ||
this.quantificador1 = quantificador1 ? quantificador1.lexema : null; | ||
this.valor2 = valor2 ? Number(valor2.lexema) : null; | ||
this.quantificador2 = quantificador2 ? quantificador2.lexema : null; | ||
this.traducao = 'translate'; | ||
} | ||
|
||
paraTexto() { | ||
if (!this.quantificador1 && !this.valor2 && !this.quantificador2) { | ||
return `translacao(${this.valor1})` | ||
} | ||
|
||
if (!this.valor2 && !this.quantificador2) { | ||
this.quantificador1 === 'graus' ? this.quantificador1 = 'deg' : null; | ||
return `translacao(${this.valor1}${this.quantificador1})` | ||
} | ||
|
||
this.quantificador1 === 'graus' ? this.quantificador1 = 'deg' : null; | ||
this.quantificador2 === 'graus' ? this.quantificador2 = 'deg' : null; | ||
|
||
return `translacao(${this.valor1}${this.quantificador1}, ${this.valor2}${this.quantificador2})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Simbolo } from "../../../lexador"; | ||
import { MetodoCss } from "./metodo-css"; | ||
|
||
export class Translate3d extends MetodoCss { | ||
valor1: number; | ||
quantificador1: string; | ||
valor2: number; | ||
quantificador2: string; | ||
valor3: number; | ||
quantificador3: string; | ||
traducao: string; | ||
|
||
constructor(valor1: Simbolo, quantificador1: Simbolo, valor2: Simbolo, quantificador2: Simbolo, valor3: Simbolo, quantificador3: Simbolo) { | ||
super(); | ||
this.valor1 = Number(valor1.lexema); | ||
this.quantificador1 = quantificador1 ? quantificador1.lexema : null; | ||
this.valor2 = valor2 ? Number(valor2.lexema) : null; | ||
this.quantificador2 = quantificador2 ? quantificador2.lexema : null; | ||
this.valor3 = valor3 ? Number(valor3.lexema) : null; | ||
this.quantificador3 = quantificador3 ? quantificador3.lexema : null; | ||
this.traducao = 'translate3d'; | ||
} | ||
|
||
paraTexto() { | ||
if (!this.quantificador1 && !this.valor2 && !this.quantificador2 && !this.valor3 && !this.quantificador3) { | ||
return `translacao-3d(${this.valor1})` | ||
} | ||
|
||
if (!this.quantificador1 && this.quantificador2 && this.quantificador3) { | ||
return `translacao-3d(${this.valor1}, ${this.valor2}${this.quantificador2}, ${this.valor3}${this.quantificador3})` | ||
} | ||
|
||
if (!this.quantificador2 && this.quantificador1 && this.quantificador3) { | ||
return `translacao-3d(${this.valor1}${this.quantificador1}, ${this.valor2}, ${this.valor3}${this.quantificador3})` | ||
} | ||
|
||
if (!this.quantificador3 && this.quantificador2 && this.quantificador1) { | ||
return `translacao-3d(${this.valor1}${this.quantificador1}, ${this.valor2}${this.quantificador2}, ${this.valor3})` | ||
} | ||
|
||
if (!this.quantificador1 && !this.quantificador2 && this.quantificador3) { | ||
return `translacao-3d(${this.valor1}, ${this.valor2}, ${this.valor3}${this.quantificador3})` | ||
} | ||
|
||
if (!this.quantificador3 && this.quantificador2 && !this.quantificador1) { | ||
return `translacao-3d(${this.valor1}, ${this.valor2}${this.quantificador2}, ${this.valor3})` | ||
} | ||
|
||
if (!this.quantificador3 && !this.quantificador2 && this.quantificador1) { | ||
return `translacao-3d(${this.valor1}${this.quantificador1}, ${this.valor2}, ${this.valor3})` | ||
} | ||
|
||
return `translacao-3d(${this.valor1}${this.quantificador1}, ${this.valor2}${this.quantificador2}, ${this.valor3}${this.quantificador3})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Simbolo } from "../../../lexador"; | ||
import { MetodoCss } from "./metodo-css"; | ||
|
||
export class TranslateX extends MetodoCss { | ||
valor: number; | ||
quantificador: string; | ||
traducao: string; | ||
|
||
constructor(valor: Simbolo, quantificador: Simbolo) { | ||
super(); | ||
this.valor = Number(valor.lexema); | ||
this.quantificador = quantificador ? quantificador.lexema : null; | ||
this.traducao = 'translateX'; | ||
} | ||
|
||
paraTexto() { | ||
if (this.quantificador) { | ||
return `translacao-horizontal(${this.valor}${this.quantificador})` | ||
} | ||
|
||
return `translacao-horizontal(${this.valor})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Simbolo } from "../../../lexador"; | ||
import { MetodoCss } from "./metodo-css"; | ||
|
||
export class TranslateY extends MetodoCss { | ||
valor: number; | ||
quantificador: string; | ||
traducao: string; | ||
|
||
constructor(valor: Simbolo, quantificador: Simbolo) { | ||
super(); | ||
this.valor = Number(valor.lexema); | ||
this.quantificador = quantificador ? quantificador.lexema : null; | ||
this.traducao = 'translateY'; | ||
} | ||
|
||
paraTexto() { | ||
if (this.quantificador) { | ||
return `translacao-vertical(${this.valor}${this.quantificador})` | ||
} | ||
|
||
return `translacao-vertical(${this.valor})` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Simbolo } from "../../../lexador"; | ||
import { MetodoCss } from "./metodo-css"; | ||
|
||
export class TranslateZ extends MetodoCss { | ||
valor: number; | ||
quantificador: string; | ||
traducao: string; | ||
|
||
constructor(valor: Simbolo, quantificador: Simbolo) { | ||
super(); | ||
this.valor = Number(valor.lexema); | ||
this.quantificador = quantificador ? quantificador.lexema : null; | ||
this.traducao = 'translateZ'; | ||
} | ||
|
||
paraTexto() { | ||
if (this.quantificador) { | ||
return `translacao-eixo-z(${this.valor}${this.quantificador})` | ||
} | ||
|
||
return `translacao-eixo-z(${this.valor})` | ||
} | ||
} |
Oops, something went wrong.