]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6300 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Sep 2023 17:38:18 +0000 (19:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Sep 2023 17:38:18 +0000 (19:38 +0200)
style/102-intro.sass
views/index.blade.php
views/screens/intro.blade.php

index 7719dfb3ae6f2bd07f4094541af0ad13a6f816ee..4ce21ec538d7d52d683370083e6b8c48d38a9d7e 100644 (file)
@@ -2,6 +2,16 @@
     .screen-image
         +flex-config(center)
 
+    &.legacy
+        .screen-image
+            background-color: rgba(0, 0, 0, 0.2)
+
+        #welcome
+            h2
+                font-size: 30px
+                text-align: center
+                clip-path: none
+
 #welcome
     max-width: 590px
     margin: 0 auto
index 03b7ee19e0d77847ee0c58d3287ef1057c88196f..5111c3c7b9f5c79a2f27a5d56a808e151cf59644 100644 (file)
@@ -17,9 +17,7 @@
 @endphp
 <div class="container">
     <div id="quiz">
-        @if($data->intro_enable)
-            @include('screens.intro', ['data'=> $data])
-        @endif
+        @include('screens.intro', ['data'=> $data])
         @foreach($data->questions as $key => $question)
             @include('screens.question_'.$question['type'], ['theme' => $data->theme,'data'=> $data, 'question' => $question, 'max' => $totalQuestion, 'position' => $key, 'alphabet' => $alphabet])
         @endforeach
index 543416baf2b86d668535466369dd5d20178564e6..76bbab990c946eb1f12ffd0cfcb2efcce696dc2c 100644 (file)
@@ -1,8 +1,20 @@
 @php
     $absPath = \App\Models\Quiz::find($data->id)->getPreviewURL();
+    $screenClass='';
+
+    // Intro for old quizzes
+    if(!$data->intro_title && !$data->intro_text && !$data->intro_button){
+        $data->intro_title=$data->title;
+        $screenClass='legacy';
+        $headerData=clone $data;
+        $headerData->set('title','');
+    }else{
+        $headerData=$data;
+    }
+
 @endphp
-<div class="container-screen none" data-type="intro" data-screen="welcome">
-    @include('header_title', ['data', $data])
+<div class="container-screen none {{$screenClass}}" data-type="intro" data-screen="welcome">
+    @include('header_title', ['data'=> $headerData])
     <div class="screen vertical-center-screen" id="welcome">
         <h2>{{$data->intro_title?:$__('Welcome')}}</h2>
         <p>{{$data->intro_text}}</p>