import { MotionPathPlugin } from "gsap/MotionPathPlugin.js";
import {CubeSCORM} from '/application/resources/scorm/scorm';
import lottie from "lottie-web";
+import SplitType from 'split-type'
import QuizResize from "./quiz.resize";
$this.next();
})
- console.log(quiz.score)
+ let title = new SplitType("#welcome h2", { types: 'words, chars' })
+ let text = new SplitType("#welcome p", { types: 'words, chars' })
+
+ gsap.from(title.words, {
+ opacity: 0,
+ y: 20,
+ duration: 1,
+ stagger: 0.05,
+ onStart: () => {
+ $(title.elements).removeClass("none")
+ }
+ })
+
+ gsap.to(text.words, {
+ opacity: 1,
+ y: 0,
+ duration: 1,
+ ease: "power1.inOut",
+ stagger: {
+ amount: 0.2
+ },
+ onStart: () => {
+ $(text.elements).removeClass("none")
+ }
+ })
},
updateIcons: function () {
@content
-@mixin opacity($rule: background-color)
- #{$rule}: #{$texts-color}2f
+@mixin opacity($opacity, $rule: background-color)
+ #{$rule}: rgba($texts-color,$opacity)
@mixin flex-config($justify-content: false, $flex: false, $flex-direction: false, $align-items: false)
background: radial-gradient(at 16% 6px, rgb(255, 102, 186) -7%, #D0167C 74%)
box-shadow: 0 4px 6px rgba(0,0,0,.2)
&.secondary
- +opacity()
+ +opacity(.16)
padding-left: 22px
&.reset
max-width: 144px
&.info
max-width: 177px
- .access
- border-radius: 4px
- padding: 6px 12px
- +font-size(16)
- +opacity()
- text-transform: uppercase
- margin-left: 16px
+
+.access
+ border-radius: 4px
+ padding: 6px 12px
+ +font-size(16)
+ +opacity(.16)
+ text-transform: uppercase
+ margin-left: 16px
.screen
position: relative
width: 16px
height: 4px
border-radius: 100px
- +opacity()
+ +opacity(.16)
display: inline-flex
&:not(:last-of-type)
margin-right: 7px
h2
margin: 0 0 12px
+font-size(20)
+ clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%)
+
p
+font-size(16)
+ clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%)
+
+ .word
+ opacity: 0
+ transform: translateY(100px)
--- /dev/null
+.question-multiple
+ top: 93px
+ .list
+ display: grid
+ grid-template-columns: repeat(2, 1fr)
+ grid-gap: 16px
+ &-item
+ width: 100%
+ height: 58px
+ @extend .radius
+ background-color: $neutral-color
+ +flex-config(space-between,false,false,center)
+ padding: 0 16px
+ cursor: pointer
@import 100-global
@import 101-header-footer
@import 102-intro
+@import 103-question-multiple
</head>
<body>
@include("quizv2.sprite")
-@php($totalQuestion = sizeof($data->questions))
+@php
+ $totalQuestion = sizeof($data->questions);
+ $alphabet = range('A', 'Z');
+@endphp
<div class="container">
<div id="quiz">
@if($data->intro_enable)
@include('quizv2.screens.intro', ['data'=> $data])
@endif
@foreach($data->questions as $key => $question)
- @include('quizv2.screens.question_'.$question['type'], ['data'=> $question, 'max' => $totalQuestion, 'position' => $key])
+ @include('quizv2.screens.question_'.$question['type'], ['data'=> $question, 'max' => $totalQuestion, 'position' => $key, 'alphabet' => $alphabet])
@endforeach
</div>
</div>
<div class="container-screen active-screen next">
@include('quizv2.header_title', ['data', $data])
<div class="screen" id="welcome">
- <h2>{{$data->intro_title}}</h2>
- <p>{{$data->intro_text}}</p>
+ <h2 class="none">{{$data->intro_title}}</h2>
+ <p class="none">{{$data->intro_text}}</p>
</div>
<div class="screen-image">
<img src="{{$data->theme->introImage}}">
<div class="container-screen none" data-position="{{$position}}">
@include('quizv2.header_question', ['data' => $data, 'max' => $max, 'position' => $position])
- <div class="screen" id="question_1">
- <ul>
- @foreach($data['answers'] as $answer)
- <li>{{$answer['answer']}}</li>
+ <form class="screen question-multiple">
+ <ul class="list">
+ @foreach($data['answers'] as $key => $answer)
+ <li class="list-item">
+ <label for="question-{{$key}}">
+ {{$answer['answer']}}
+ <input type="checkbox" name="question-{{$key}}" class="none">
+ </label>
+ <span class="access">{{$alphabet[$key]}}</span>
+ </li>
@endforeach
</ul>
- </div>
+ </form>
<div class="screen-image">
</div>
@include('quizv2.footer', ['data' => $data, 'reset' => true, 'text' => 'Validate answer', 'info' => true])