From: soufiane Date: Tue, 14 May 2024 16:19:11 +0000 (+0200) Subject: wait #6812 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0dcd623bd591f42617b28875986a25cb58d059c4;p=fluidbook-toolbox-quiz.git wait #6812 --- diff --git a/js/quiz.draganddrop.js b/js/quiz.draganddrop.js index 4273307..f1ba64b 100644 --- a/js/quiz.draganddrop.js +++ b/js/quiz.draganddrop.js @@ -27,7 +27,7 @@ QuizDragAndDrop.prototype = { let heightTitle = $("body").find("#titleQuestion").height() - $(".question-draganddrop").css("margin-top", heightTitle+"px") + $(".m .question-draganddrop").css("margin-top", heightTitle+"px") }, start: function () { @@ -43,7 +43,7 @@ QuizDragAndDrop.prototype = { this.htmlZone2 = this.zone2.html() this.offsetLeftItemDragged = 0 this.offsetRightItemDragged = 0 - this.initQuestion(); + this.reset(); this.value_ = 0 let height_ = 400 - $(".card-holder").parent().find(".text").height() @@ -330,6 +330,8 @@ QuizDragAndDrop.prototype = { this.createDraggable(this) let tl = gsap.timeline() this.quiz.animations.animateDragAndDropCarrousel(tl) + + this.reset(); } } diff --git a/js/quiz.resize.js b/js/quiz.resize.js index e0acdc3..6eb7cfe 100644 --- a/js/quiz.resize.js +++ b/js/quiz.resize.js @@ -36,6 +36,8 @@ QuizResize.prototype = { }, resize: function () { + const $this = this + this.measureSizes(); this.updateBackgrounds(); this.updateViewport(); @@ -59,10 +61,12 @@ QuizResize.prototype = { if (this.isMobile()) { $(".btn.reset .text").html(iconReset); $(".btn.moreinfo .text").html(iconInfo); + $("#score").css("height",$this.hh - 110 + 'px') this.centerItems(); } else { $(".btn.reset .text").html(textReset); $(".btn.moreinfo .text").html(textInfo); + $("#score").css("height","calc(100vh - 125px)") this.resetCenterItems(); } }, @@ -95,6 +99,7 @@ QuizResize.prototype = { }, updateViewport: function () { + const $this = this; if (!this.isMobile()) { $('meta[name="viewport"]').attr('content', 'width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, test=yes'); @@ -116,9 +121,10 @@ QuizResize.prototype = { qcss.margin = ''; $("#quiz").css(qcss); } else { + console.log(this.hh, $(window).innerHeight(), $(document).height()) $('html').removeClass('round'); $('meta[name="viewport"]').attr('content', 'width=' + this.mobileWidth + ', user-scalable=no, initial-scale=1.0, shrink-to-fit=no, test=yes'); - $("#quiz").css({transform: '', transformOrigin: '', top: '', left: '', margin: '0 auto'}); + $("#quiz").css({transform: '', transformOrigin: '', top: '', left: '', margin: '0 auto', height: $this.hh}); } }, diff --git a/style/100-global.sass b/style/100-global.sass index df3f237..25b273e 100644 --- a/style/100-global.sass +++ b/style/100-global.sass @@ -35,9 +35,9 @@ body .m & border-radius: 0 box-shadow: 0 0 0 - height: 100vh + //height: 100vh max-height: 100vh - min-height: 100vh + min-height: 0 width: 100% //390px min-width: 320px //390px max-width: 390px diff --git a/style/105-outro.sass b/style/105-outro.sass index 9002bc5..b13ecb9 100644 --- a/style/105-outro.sass +++ b/style/105-outro.sass @@ -486,7 +486,7 @@ height: 90% padding-right: 5px .item - margin-left: 0 + padding-left: 0 &:after display: none diff --git a/style/106-question-draganddrop.sass b/style/106-question-draganddrop.sass index dc54ae9..67406b7 100644 --- a/style/106-question-draganddrop.sass +++ b/style/106-question-draganddrop.sass @@ -340,6 +340,7 @@ .list height: 178px margin: 20px 0 0 + transform: translate3d(0) &-item &:not(.overlay)