From: soufiane Date: Wed, 16 Aug 2023 16:21:34 +0000 (+0200) Subject: wip #6193 @7:00 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ce925af8c8b9c1096b3764942ac7f0a1a2ef0a81;p=fluidbook-toolbox-quiz.git wip #6193 @7:00 --- diff --git a/.idea/deployment.xml b/.idea/deployment.xml index 4cff5f5..4b83257 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -1,421 +1,15 @@ - + diff --git a/js/quiz.resize.js b/js/quiz.resize.js index b68ab5a..d2e3f0a 100644 --- a/js/quiz.resize.js +++ b/js/quiz.resize.js @@ -6,9 +6,21 @@ QuizResize.prototype = { resize: function () { this.ww = $(window).width(); this.hh = $(window).height(); + let intro_text_mobile = this.quiz.data.intro_text_mobile + let intro_text = this.quiz.data.intro_text // Exécuter ici toutes opérations qui doivent intervenir lorsque la fenêtre est redimensionnée par le système ou l'utilisateur + if(this.ww <= 390) { + $("#welcome p").html(this.nl2br(intro_text_mobile)) + }else { + $("#welcome p").html(this.nl2br(intro_text)) + } }, + + nl2br: function(str) { + if (!str) return str; + return str.replace(/(?:\r\n|\r|\n)/g, '
'); + } } module.exports = QuizResize; diff --git a/style/100-global.sass b/style/100-global.sass index 763a60d..401aeac 100644 --- a/style/100-global.sass +++ b/style/100-global.sass @@ -17,7 +17,7 @@ body max-width: 1200px min-height: 680px margin: 0 auto - padding: 24px 24px + +padding-container() position: relative .btn @@ -84,3 +84,14 @@ body height: 100% width: 100% z-index: 0 + img.mobile + display: inline + height: 100% + width: 100% + object-fit: cover + +above(391px) + display: none + img:not(.mobile) + display: none + +above(391px) + display: inline diff --git a/style/101-header-footer.sass b/style/101-header-footer.sass index d4a269e..c3c6384 100644 --- a/style/101-header-footer.sass +++ b/style/101-header-footer.sass @@ -45,13 +45,17 @@ header left: 0 width: 100% z-index: 2 - +flex-config(space-between,false,row,center) + +flex-config(center,false,row,center) +padding-container() + +breakpoint(md) + +flex-config(space-between,false,row,center) + .btn.primary width: 100% max-width: 400px - position: absolute - left: 50% - bottom: 24px - transform: translateX(-50%) + +breakpoint(md) + position: absolute + left: 50% + bottom: 24px + transform: translateX(-50%) diff --git a/style/102-intro.sass b/style/102-intro.sass index f6d3b32..d0057c1 100644 --- a/style/102-intro.sass +++ b/style/102-intro.sass @@ -1,7 +1,9 @@ #welcome max-width: 590px margin: 0 auto - top: 160px + top: 138px + +breakpoint(md) + top: 160px h2 margin: 0 0 12px +font-size(20) @@ -10,7 +12,7 @@ p +font-size(16) clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%) - + white-space: pre-wrap .word opacity: 0 transform: translateY(100px) diff --git a/views/index.blade.php b/views/index.blade.php index 1a501d7..88b61a0 100644 --- a/views/index.blade.php +++ b/views/index.blade.php @@ -3,7 +3,7 @@ - + {{$data->title}} @@ -28,5 +28,17 @@ + diff --git a/views/screens/intro.blade.php b/views/screens/intro.blade.php index fdb718c..639213b 100644 --- a/views/screens/intro.blade.php +++ b/views/screens/intro.blade.php @@ -4,11 +4,12 @@