From: Vincent Vanwaelscappel Date: Mon, 16 Jun 2025 13:15:24 +0000 (+0200) Subject: wait #7590 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=82641793c70425ec4a753d350b05ce7a635dd0fd;p=fluidbook-toolbox.git wait #7590 @0.25 --- diff --git a/app/Elearning/QuizCompiler.php b/app/Elearning/QuizCompiler.php index d2fdbd5eb..e0d23100c 100644 --- a/app/Elearning/QuizCompiler.php +++ b/app/Elearning/QuizCompiler.php @@ -168,12 +168,18 @@ class QuizCompiler extends Base $this->sassVariables['neutral-color'] = $this->theme->neutralColor; $this->sassVariables['ok-color'] = $this->theme->okColor; $this->sassVariables['nok-color'] = $this->theme->nokColor; - $this->sassVariables['card-disabled-background'] = $darkTheme ? $this->theme->neutralColor : $textsColor; - $this->sassVariables['card-disabled-color'] = $darkTheme ? $textsColor : $oppositeTextsColor; + + + $this->sassVariables['card-disabled-background'] = $this->theme->matchOtherInvert ? ($darkTheme ? $this->theme->neutralColor : $textsColor) : $this->theme->neutralColor; + $this->sassVariables['card-disabled-color'] = $this->theme->matchOtherInvert ? ($darkTheme ? $textsColor : $oppositeTextsColor) : $textsColor; + $this->sassVariables['card-disabled-opacity'] = max(0, min(100, $this->theme->matchOtherOpacity)) / 100; // Active colors $this->sassVariables['stroke-color'] = $this->theme->strokeColor ?: 'rgba($texts-color, .24)'; $this->sassVariables['active-stroke-color'] = $this->theme->activeStrokeColor ?: $textsColor; $this->sassVariables['active-background-color'] = $this->theme->activeBackgroundColor ?: 'rgba($neutral-color,.8)'; + // Controls buttons + $this->sassVariables['controls-button-background'] = $this->theme->controlsButtonBackground ?: 'rgba($texts-color,0.16)'; + $this->sassVariables['controls-button-color'] = $this->theme->controlsButtonColor ?: 'currentColor'; // Fonts size:Line Height $this->sassVariables['fonts-size'] = "(14: 20px, 16: 22px, 20: 28px, 24: 35px)"; // fill areas diff --git a/app/Models/QuizTheme.php b/app/Models/QuizTheme.php index 7b27b776f..612f12376 100644 --- a/app/Models/QuizTheme.php +++ b/app/Models/QuizTheme.php @@ -4,9 +4,6 @@ namespace App\Models; use App\Fields\FluidbookFont; use App\Fields\FluidbookThemeImage; -use App\Fields\HorizontalAlign; -use App\Fields\ThemeBackgroundSize; -use App\Fields\VerticalAlign; use App\Http\Controllers\Admin\Operations\ChangeownerOperation; use App\Http\Controllers\Admin\Operations\QuizTheme\PreviewOperation; use App\Jobs\GenerateQuizThemePreview; @@ -17,11 +14,11 @@ use Cubist\Backpack\Magic\Fields\FormSection; use Cubist\Backpack\Magic\Fields\FormSectionDescription; use Cubist\Backpack\Magic\Fields\FormSeparator; use Cubist\Backpack\Magic\Fields\Hidden; +use Cubist\Backpack\Magic\Fields\Integer; use Cubist\Backpack\Magic\Fields\SelectFromArray; use Cubist\Util\CommandLine\Imagemagick; use Cubist\Util\Files\Files; use Cubist\Util\Graphics\Resizer; -use function PHPUnit\Framework\matches; class QuizTheme extends ToolboxModel { @@ -85,6 +82,9 @@ class QuizTheme extends ToolboxModel $this->addField('okColor', Color::class, __('Couleur OK'), ['hint' => __('Couleur générale affectée aux bonnes réponses (habituellement vert)')]); $this->addField('nokColor', Color::class, __('Couleur pas OK'), ['hint' => __('Couleur générale affectée aux mauvaises réponses (habituellement rouge)')]); $this->addField('', FormSeparator::class); + $this->addField('controlsButtonBackground', Color::class, __('Couleur de fond des boutons "Déplacer" des questions'), ['hint' => __('Laisser vide pour laisser le système déterminer la couleur'), 'allows_empty' => true]); + $this->addField('controlsButtonColor', Color::class, __('Couleur de texte des boutons "Déplacer" des questions'), ['hint' => __('Laisser vide pour laisser le système déterminer la couleur'), 'allows_empty' => true]); + $this->addField('', FormSeparator::class); $this->addField('strokeColor', Color::class, __('Couleur de contour des tuiles non-sélectionnées'), ['hint' => __('Laisser vide pour laisser le système déterminer la couleur'), 'allows_empty' => true]); $this->addField('', FormSeparator::class); $this->addField('activeStrokeColor', Color::class, __('Couleur de contour des tuiles sélectionnées'), ['hint' => __('Laisser vide pour laisser le système déterminer la couleur'), 'allows_empty' => true]); @@ -144,6 +144,9 @@ class QuizTheme extends ToolboxModel protected function _matchQuestions() { $this->_question('match', __('Questions "faire correspondre les propositions"')); + $this->addField('', FormSeparator::class); + $this->addField('matchOtherInvert', Checkbox::class, 'Inverser les couleurs des cartes non sélectionnées', ['default' => true]); + $this->addField('matchOtherOpacity', Integer::class, 'Opacité des cartes non sélectionnées', ['default' => 24, 'min' => 0, 'max' => 100]); } protected function _outro()