}
/**
- * Init data object from Quiz and ThemeQuiz Models * These data will be injected into the quiz at compile time
+ * Init data object from Quiz and ThemeQuiz Models
+ * These data will be injected into the quiz at compile time
*
* @return void
* @throws \Exception
// Load the animation "name" in container
load: function (name, container, replace) {
let json = this.quiz.data.animations[name];
- $.each(replace, function (k, v) {
- console.log(k, v);
- json = json.replace(new RegExp(k, 'g'), v);
- });
+ if(json) {
+ $.each(replace, function (k, v) {
+ console.log(k, v);
+ json = json.replace(new RegExp(k, 'g'), v);
+ });
- lottie.loadAnimation({
- container: $(container).get(0),
- renderer: 'svg',
- loop: false,
- autoplay: true,
- animationData: JSON.parse(json),
- });
+ lottie.loadAnimation({
+ container: $(container).get(0),
+ renderer: 'svg',
+ loop: false,
+ autoplay: true,
+ animationData: JSON.parse(json),
+ });
+ }
}
}
this.data = data;
console.log(this.data);
// ICI tout commence vraiment
+ console.log(this.data.theme)
+ $("#quiz").css("background-image","url("+this.data.theme.backgroundImage+")")
+
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)
--- /dev/null
+<header id="title">
+ <h1 id="quizTitle">{{$data->title}}</h1>
+ <img src="{{$data->theme->logo}}" id="logo"/>
+</header>
<body>
@include("quizv2.sprite")
<div id="quiz">
- <header id="title">
- <h1 id="quizTitle">{{$data->title}}</h1>
- <img src="{{$data->theme->logo}}" id="logo"/>
- </header>
@if($data->intro_enable)
- <div class="screen" id="welcome">
- <h2>{{$data->intro_title}}</h2>
- <p>{{$data->intro_text}}</p>
- <a class="btn primary radius">{{$data->intro_button}} <span data-icon="running-man"></span></a>
- </div>
+ @include('quizv2.screens.intro', ['data'=> $data])
@endif
</div>
<div id="anim"></div>
--- /dev/null
+@include('quizv2.header_title', ['data', $data])
+<div class="screen" id="welcome">
+ <h2>{{$data->intro_title}}</h2>
+ <p>{{$data->intro_text}}</p>
+ <a class="btn primary radius">{{$data->intro_button}} <span data-icon="running-man"></span></a>
+</div>