--- /dev/null
+import SimpleBar from 'simplebar'
+import 'simplebar/dist/simplebar.css'
+
+function QuizCountriesList(quiz) {
+ this.dropdown = '';
+ this.quiz = quiz;
+}
+
+QuizCountriesList.prototype = {
+
+ start: function () {
+ const $this = this
+ this.dropdown = this.quiz.screens.getActiveScreen().find(".dropdown")
+
+ //
+ $(document).on("click", "label[for=toggleDropdown]", function() {
+ $this.dropdown.addClass("active")
+ })
+
+ //
+ $(document).on("click", ".country", function() {
+ $this.dropdown.removeClass("active")
+ let value = $(this).text()
+ $(".active-screen input").val(value)
+ })
+
+ this.setScrollBarDropdown()
+ },
+
+ setScrollBarDropdown: function() {
+ let dp = new SimpleBar(this.dropdown.get(0))
+ },
+
+}
+
+export default QuizCountriesList;
import QuizDraganddrop from "./quiz.draganddrop";
import QuizMatch from "./quiz.match";
import QuizAttemptsLog from "./quiz.attemptslog";
+import QuizCountriesList from "./quiz.countriesList";
window.$ = window.jQuery = $;
this.draganddrop = new QuizDraganddrop(this);
this.match = new QuizMatch(this);
this.attemptsLog = new QuizAttemptsLog(this);
+ this.countriesList = new QuizCountriesList(this);
this.scorm = new QuizScorm(this);
},
import gsap from "gsap";
+import SimpleBar from 'simplebar'
+import 'simplebar/dist/simplebar.css'
import QuizScreenIntro from './quiz.screen.intro';
import QuizScreenOutro from "./quiz.screen.outro";
this.intervalCountDown = 0;
this.runningManTimeout = 0;
this.timeline = null;
+ this.scrollBarDropdown = null;
this.intro = new QuizScreenIntro(this);
this.outro = new QuizScreenOutro(this);
}
//
-
if ($(this).hasClass('validate')) {
let review = $this.sendUserAnswers();
// Si la revue instantanée est activée, on affiche les résultats
$this.quiz.draganddrop.start()
} else if($this.getActiveScreenType() === 'match') {
$this.quiz.match.start()
+ } else if($this.getActiveScreenType() === 'country') {
+ $this.quiz.countriesList.start()
}
//
width: 100%
height: 100%
pointer-events: none
+
+// SimpleBar personalisation
+.simplebar-wrapper
+ height: 100%
+.simplebar-track
+ +opacity(.08,background-color,$texts-color)
+ border-radius: 20px
+ &.simplebar-vertical
+ .simplebar-scrollbar::before
+ background-color: #77679f
+ opacity: 1 !important
+ width: 3px
+ top: 1px
+ bottom: 1px
+ left: 1px
+ right: 1px
+ &.simplebar-horizontal
+ display: none
// SimpleBar personalisation
- .simplebar-wrapper
- height: 100%
.simplebar-track
- +opacity(.08,background-color,$texts-color)
- border-radius: 20px
&.simplebar-vertical
height: 93%
width: 5px
- .simplebar-scrollbar::before
- background-color: #77679f
- opacity: 1 !important
- width: 3px
- top: 1px
- bottom: 1px
- left: 1px
- right: 1px
#anime-result
transform: scale(1.7)
.question-text
top: 93px
+ &.question-country
+ input
+ pointer-events: none
+
.form-group
width: 100%
max-width: 568px
margin: 0 auto
position: relative
+ label
+ color: $texts-color
+ position: relative
+ cursor: pointer
+ display: block
+
input,
textarea,
.dropdown
+radius(16px)
padding: 20px 16px
font-size: 16px
- overflow: hidden
background-color: $neutral-color
border: 2px solid $texts-color
color: $texts-color
position: relative
z-index: 1
+ .arrow
+ position: absolute
+ top: 50%
+ right: 20px
+ transform: translateY(-50%)
+ z-index: 2
+
.dropdown
max-height: 63px
position: absolute
top: 0
- transition: all .3s
+ transition: max-height .3s
opacity: 0
+ visibility: hidden
+ z-index: 2
&.active
max-height: 325px
+ opacity: 1
+ visibility: visible
+
+ ul.countrylist
+ width: 98%
li
padding: 14px 0
+ cursor: pointer
&.placeholder
padding-top: 0
.country
border-top: 1px solid rgba($texts-color,.16)
+ // SimpleBar personalisation
+ .simplebar-track
+ &.simplebar-vertical
+ height: 93%
+ width: 5px !important
+ right: 10px
+ top: 50% !important
+ transform: translateY(-50%)
+
.m
.question-text
top: 45px
-<div class="container-screen none" data-screen="q-{{$position}}" data-type="multiple">
+<div class="container-screen none" data-screen="q-{{$position}}" data-type="country">
<div class="fill-area"></div>
@include('header_question', ['question' =>$question, 'max' => $max, 'position' => $position])
- <div class="screen question-text">
+ <div class="screen question-text question-country">
<form id="form-{{$position}}">
<div class="form-group">
<label for="toggleDropdown">
<input id="toggleDropdown" name="text" placeholder="{{$__('Select an answer')}}" type="text" />
+ <svg class="arrow" xmlns="http://www.w3.org/2000/svg" width="18.828" height="10.414" viewBox="0 0 18.828 10.414">
+ <g id="Groupe_87" data-name="Groupe 87" transform="translate(17.414 -14.086) rotate(90)">
+ <path id="Tracé_50" data-name="Tracé 50" d="M11.5,5l8,8-8,8" transform="translate(4 -5)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+ </g>
+ </svg>
</label>
<div class="dropdown">
<ul class="countrylist">