From 6e7e304e0a04cb97e4acbae7012266e17b1c915e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 26 Sep 2023 19:38:18 +0200 Subject: [PATCH] wip #6300 @1 --- style/102-intro.sass | 10 ++++++++++ views/index.blade.php | 4 +--- views/screens/intro.blade.php | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/style/102-intro.sass b/style/102-intro.sass index 7719dfb..4ce21ec 100644 --- a/style/102-intro.sass +++ b/style/102-intro.sass @@ -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 diff --git a/views/index.blade.php b/views/index.blade.php index 03b7ee1..5111c3c 100644 --- a/views/index.blade.php +++ b/views/index.blade.php @@ -17,9 +17,7 @@ @endphp
- @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 diff --git a/views/screens/intro.blade.php b/views/screens/intro.blade.php index 543416b..76bbab9 100644 --- a/views/screens/intro.blade.php +++ b/views/screens/intro.blade.php @@ -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 -
- @include('header_title', ['data', $data]) +
+ @include('header_title', ['data'=> $headerData])

{{$data->intro_title?:$__('Welcome')}}

{{$data->intro_text}}

-- 2.39.5