*/
protected function writeAnimations()
{
- $colors = [self::OK_COLOR => /*$this->theme->okColor*/
- '#ffcc00', self::NOK_COLOR => $this->theme->nokColor];
+ $colors = [self::OK_COLOR => $this->theme->okColor, self::NOK_COLOR => $this->theme->nokColor];
$animationReplace = [];
// Replace colors
load: function (name, container, replace) {
let json = this.quiz.data.animations[name];
$.each(replace, function (k, v) {
- console.log(k,v);
+ console.log(k, v);
json = json.replace(new RegExp(k, 'g'), v);
});
lottie.loadAnimation({
- container: $('#anim').get(0),
+ container: $(container).get(0),
renderer: 'svg',
loop: false,
autoplay: true,
this.data = data;
console.log(this.data);
// ICI tout commence vraiment
- this.animations.load('OK', $("#anim"), {'$text': 'Test d\'un message custom'});
+ this.animations.load('OK', $("#anim"), {'\\$text': 'Salut :)'});
// La fonction resize est appellée à chaque fois qu'un resize de la fenêtre survient (et à l'init de l'app)
$(window).on('resize', function () {