]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6182 @6:00
authorsoufiane <soufiane@cubedesigners.com>
Tue, 1 Aug 2023 15:06:46 +0000 (17:06 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 1 Aug 2023 15:06:46 +0000 (17:06 +0200)
resources/quizv2/js/quiz.js
resources/quizv2/style/004-mixins.sass
resources/quizv2/style/100-global.sass
resources/quizv2/style/101-header-footer.sass
resources/quizv2/style/102-intro.sass
resources/quizv2/style/103-question-multiple.sass [new file with mode: 0644]
resources/quizv2/style/style.sass
resources/views/quizv2/index.blade.php
resources/views/quizv2/screens/intro.blade.php
resources/views/quizv2/screens/question_multiple.blade.php

index 0041f60bc868c3af7faadfce2d067c45cfd90344..48912a7a62a9482b9ec2fd9b39a230e52952bbcb 100644 (file)
@@ -3,6 +3,7 @@ import gsap from "gsap";
 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";
@@ -56,7 +57,31 @@ Quiz.prototype = {
             $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 () {
index d4c2c2004db9b412dcfbfedf37e30d13f77c6960..2ec7f9b7d3a66cb6aa2c11d4cdbc6ea825c62019 100644 (file)
@@ -15,8 +15,8 @@
         @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)
index 26ae0e89961cf8f18d583a9ae3be084f6c4ef455..445e7dc3544c5d7edd9bf0cdb6c96090006b3ae1 100644 (file)
@@ -35,19 +35,20 @@ body
         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
index 5db18e7d4ca0dc34706f08f9421fdb73f8cd2ac5..40fae65246e75ba295cc77a7cb47e38c4c187e25 100644 (file)
@@ -20,7 +20,7 @@ header,
         width: 16px
         height: 4px
         border-radius: 100px
-        +opacity()
+        +opacity(.16)
         display: inline-flex
         &:not(:last-of-type)
             margin-right: 7px
index d68a01d9b8405a7cb86268780319ad0565a806a0..f6d3b322135de6302615588b4535e9e12ed61c67 100644 (file)
@@ -5,5 +5,12 @@
     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)
diff --git a/resources/quizv2/style/103-question-multiple.sass b/resources/quizv2/style/103-question-multiple.sass
new file mode 100644 (file)
index 0000000..18aa697
--- /dev/null
@@ -0,0 +1,14 @@
+.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
index b40d11bcca5455f170cc583f7f0a4253bd4fb983..b65a3b21423e00cc83c5667be067b309ec605e6e 100644 (file)
@@ -6,3 +6,4 @@
 @import 100-global
 @import 101-header-footer
 @import 102-intro
+@import 103-question-multiple
index 7ab6c34fffec0c22f8de122a05397206e57a961d..ae666d9e58277286bb620904028fab8f801d8692 100644 (file)
 </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>
index 11c599cb23a4dea574c4cbdc5976c9a67fbca1dc..c5c681100013c2e411e158016de307d42c5c1b5f 100644 (file)
@@ -5,8 +5,8 @@
 <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}}">
index 28c96e1f3ee702f5d9e9a7c5d14d95cca327a250..29702f0a3185712f60aec0ac8acd660fbef7748b 100644 (file)
@@ -1,12 +1,18 @@
 <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])