]> _ Git - Animations.git/commitdiff
wait #5189 @7
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Apr 2022 12:34:56 +0000 (14:34 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Apr 2022 12:34:56 +0000 (14:34 +0200)
22 files changed:
RedbullShopper101/HaveAGuess/HaveAGuess.zip
RedbullShopper101/HaveAGuess/haveaguess.js
RedbullShopper101/HaveAGuess/index.html
RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164036.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164805.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 165159.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/VisualTriggers.pdf [new file with mode: 0644]
RedbullShopper101/VisualTriggers/VisualTriggers.zip [new file with mode: 0644]
RedbullShopper101/VisualTriggers/bt-contrast.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/bt-movement.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/bt-pattern.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/bt-recognition.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/bt-repetition.png [new file with mode: 0644]
RedbullShopper101/VisualTriggers/fc.woff [new file with mode: 0644]
RedbullShopper101/VisualTriggers/index.html [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-1.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-2.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-3.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-4.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-5.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers-6.jpg [new file with mode: 0644]
RedbullShopper101/VisualTriggers/visualtriggers.js [new file with mode: 0644]

index 3df7058b44e4446f826f53417935a64ebef81ac1..652025c9a7891e039d86a75b4132a5e1c1c54ac4 100644 (file)
Binary files a/RedbullShopper101/HaveAGuess/HaveAGuess.zip and b/RedbullShopper101/HaveAGuess/HaveAGuess.zip differ
index d4720ec27d0fbd57b4da70917a5aa24d8ded870a..03c05fbbf915f69f464771641f15dc4e5b7bdd3e 100644 (file)
@@ -88,12 +88,19 @@ $(function () {
 
     $(document).on('click', '#prev', function () {
         showScreen(window.currentQuestion - 1, true);
+        return false;
     });
 
     $(document).on('click', '#next', function () {
         showScreen(window.currentQuestion + 1, true);
+        return false;
+
     });
 
+    $(document).on('click', '#nextpage', function () {
+        parent.fluidbook.goNextPage();
+        return false;
+    });
 });
 
 function showScreen(n, isQ) {
@@ -107,13 +114,16 @@ function showScreen(n, isQ) {
 
     if (isQ) {
         $("#submit").show();
+        $("#nextpage").hide();
         setChoices(n);
     } else {
         $("#submit").hide();
         if (n === 5) {
             $("#next").hide();
+            $("#nextpage").show();
         } else {
             $("#next").show();
+            $("#nextpage").hide();
         }
         revealAnswers(n);
     }
index 765c17d35f3b45c5bd96b2d9718737e2c6748647..1a6298bdd7dcacab97fd6b807078a0428513b842 100644 (file)
@@ -28,7 +28,7 @@
             font-style: normal;
         }
 
-        body{
+        body {
             opacity: 0;
         }
 
     <div id="buttons">
         <div id="prev">Previous question</div>
         <div id="next">Next question</div>
+        <div id="nextpage">Next</div>
         <div id="submit">Submit</div>
     </div>
 </main>
diff --git a/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164036.png b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164036.png
new file mode 100644 (file)
index 0000000..9180184
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164036.png differ
diff --git a/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164805.png b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164805.png
new file mode 100644 (file)
index 0000000..5037176
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 164805.png differ
diff --git a/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 165159.png b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 165159.png
new file mode 100644 (file)
index 0000000..2b5c405
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/Screenshot 2022-03-30 165159.png differ
diff --git a/RedbullShopper101/VisualTriggers/VisualTriggers.pdf b/RedbullShopper101/VisualTriggers/VisualTriggers.pdf
new file mode 100644 (file)
index 0000000..e988542
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/VisualTriggers.pdf differ
diff --git a/RedbullShopper101/VisualTriggers/VisualTriggers.zip b/RedbullShopper101/VisualTriggers/VisualTriggers.zip
new file mode 100644 (file)
index 0000000..5774d7a
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/VisualTriggers.zip differ
diff --git a/RedbullShopper101/VisualTriggers/bt-contrast.png b/RedbullShopper101/VisualTriggers/bt-contrast.png
new file mode 100644 (file)
index 0000000..026fda6
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/bt-contrast.png differ
diff --git a/RedbullShopper101/VisualTriggers/bt-movement.png b/RedbullShopper101/VisualTriggers/bt-movement.png
new file mode 100644 (file)
index 0000000..6d12f27
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/bt-movement.png differ
diff --git a/RedbullShopper101/VisualTriggers/bt-pattern.png b/RedbullShopper101/VisualTriggers/bt-pattern.png
new file mode 100644 (file)
index 0000000..799485f
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/bt-pattern.png differ
diff --git a/RedbullShopper101/VisualTriggers/bt-recognition.png b/RedbullShopper101/VisualTriggers/bt-recognition.png
new file mode 100644 (file)
index 0000000..4a3a2a8
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/bt-recognition.png differ
diff --git a/RedbullShopper101/VisualTriggers/bt-repetition.png b/RedbullShopper101/VisualTriggers/bt-repetition.png
new file mode 100644 (file)
index 0000000..f78ea63
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/bt-repetition.png differ
diff --git a/RedbullShopper101/VisualTriggers/fc.woff b/RedbullShopper101/VisualTriggers/fc.woff
new file mode 100644 (file)
index 0000000..3521d4c
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/fc.woff differ
diff --git a/RedbullShopper101/VisualTriggers/index.html b/RedbullShopper101/VisualTriggers/index.html
new file mode 100644 (file)
index 0000000..a92c127
--- /dev/null
@@ -0,0 +1,229 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="width" content="1057.32">
+    <meta name="height" content="595.276">
+    <style>
+
+
+        @font-face {
+            font-family: 'f';
+            src: url('fc.woff') format('woff');
+            font-weight: bold;
+            font-style: normal;
+        }
+
+        * {
+            padding: 0;
+            margin: 0;
+        }
+
+        body {
+            width: 1057.32px;
+            height: 595.276px;
+        }
+
+        #next {
+            position: absolute;
+            top: 476px;
+            left: 36px;
+            height: 33px;
+            width: 131px;
+            cursor: pointer;
+        }
+
+        #screens > div {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 1057.32px;
+            height: 595.276px;
+            background-size: 100% 100%;
+            background-repeat: no-repeat;
+            opacity: 0;
+            pointer-events: none;
+            transition: opacity 500ms;
+        }
+
+        #screens > div.show {
+            transition: opacity 500ms;
+            opacity: 1;
+            pointer-events: auto;
+        }
+
+        #screens > div img {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 1057.32px;
+            height: 595.276px;
+            display: block;
+        }
+
+        #start {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            cursor: pointer;
+        }
+
+        #buttons {
+            position: absolute;
+            top: 469px;
+            left: 359px;
+        }
+
+        [data-a] {
+            position: absolute;
+            top: 0px;
+            left: 0px;
+            width: 110px;
+            height: 32px;
+        }
+
+        [data-a].active {
+            background-color: #ccc;
+            mix-blend-mode: multiply;
+            cursor: auto;
+        }
+
+        [data-a].done {
+            background-color: #ccc;
+            mix-blend-mode: hard-light;
+            cursor: auto;
+        }
+
+        [data-t] {
+            position: absolute;
+            cursor: auto;
+        }
+
+        #buttons > div {
+            cursor: pointer;
+            position: absolute;
+        }
+
+        #buttons [data-a="contrast"] {
+            left: 120px;
+        }
+
+        #buttons [data-a="pattern"] {
+            left: 241px;
+        }
+
+        #buttons [data-a="recognition"] {
+            left: 362px;
+        }
+
+        #buttons [data-a="movement"] {
+            left: 483px;
+        }
+
+        #buttons #submit {
+            width: 592px;
+            height: 33px;
+            top: 43px;
+        }
+
+        #score {
+            font-family: f;
+            font-weight: bold;
+            position: absolute;
+            top: 400px;
+            left: 29px;
+            font-size: 44px;
+            color: #000;
+            text-align: center;
+            width: 24px;
+            white-space: nowrap;
+        }
+
+        .m {
+            position: absolute;
+            pointer-events: none;
+        }
+
+        .m img {
+            display: block;
+            width: 114.5px;
+            height: 33px;
+            position: absolute;
+            left: -57px;
+            top: -16.5px;
+        }
+
+        #image.active {
+            cursor: pointer;
+        }
+
+    </style>
+</head>
+<body>
+
+<div id="screens">
+    <div id="screen_1"></div>
+    <div id="screen_2"></div>
+    <div id="screen_3"></div>
+    <div id="screen_4"></div>
+    <div id="screen_5"></div>
+    <div id="screen_6"></div>
+</div>
+<div id="score" data-screens="2,4,6"></div>
+<div id="next" data-screens="2,4,6"></div>
+<div id="buttons">
+    <div data-a="repetition" data-screens="1,3,5"></div>
+    <div data-a="contrast" data-screens="1,3"></div>
+    <div data-a="pattern" data-screens="3,5"></div>
+    <div data-a="recognition" data-screens="1,3,5"></div>
+    <div data-a="movement" data-screens="1,3"></div>
+    <div id="submit" data-screens="1,3,5"></div>
+</div>
+
+<map name="map_1" data-coef="1.008">
+    <area shape="rect" coords="335, 134, 967, 446" href="wrong"/>
+    <area shape="rect" coords="386, 211, 406, 233" href="recognition" />
+    <area shape="rect" coords="510, 223, 528, 244" href="recognition" />
+    <area shape="rect" coords="722, 193, 754, 235" href="recognition" />
+    <area shape="rect" coords="910, 169, 963, 228" href="recognition" />
+    <area shape="rect" coords="770, 222, 872, 252" href="movement" />
+    <area shape="rect" coords="478, 236, 506, 303" href="contrast" />
+    <area shape="rect" coords="414, 234, 449, 310" href="repetition" />
+    <area shape="rect" coords="352, 227, 375, 310" href="repetition" />
+</map>
+
+<map name="map_3" data-coef="1.005">
+
+    <area shape="rect" coords="357, 133, 946, 456" href="wrong"/>
+    <area shape="rect" coords="733, 133, 849, 185" href="movement"/>
+    <area shape="rect" coords="737, 217, 778, 258" href="pattern"/>
+    <area shape="rect" coords="608, 190, 737, 258" href="pattern"/>
+    <area shape="rect" coords="674, 441, 727, 455" href="recognition"/>
+    <area shape="rect" coords="398, 390, 452, 439" href="recognition"/>
+    <area shape="rect" coords="778, 197, 831, 355" href="repetition"/>
+    <area shape="rect" coords="692, 343, 714, 433" href="repetition"/>
+    <area shape="rect" coords="716, 314, 735, 431" href="repetition"/>
+    <area shape="rect" coords="662, 316, 692, 433" href="repetition"/>
+    <area shape="rect" coords="663, 287, 731, 312" href="repetition"/>
+    <area shape="rect" coords="471, 192, 607, 327" href="repetition"/>
+    <area shape="rect" coords="471, 327, 650, 373" href="repetition"/>
+    <area shape="rect" coords="475, 191, 607, 218" href="contrast"/>
+</map>
+<map name="map_5" data-coef="1.005">
+    <area shape="rect" coords="357, 133, 946, 456" href="wrong"/>
+    <area shape="rect" coords="440, 230, 600, 268" href="repetition"/>
+    <area shape="rect" coords="438, 172, 645, 229" href="repetition"/>
+    <area shape="rect" coords="435, 269, 642, 327" href="pattern"/>
+    <area shape="rect" coords="502, 330, 645, 364" href="pattern"/>
+    <area shape="rect" coords="430, 330, 501, 361" href="recognition"/>
+    <area shape="rect" coords="441, 176, 645, 265" href="recognition"/>
+</map>
+
+<div id="start" data-screens="0"></div>
+<!--<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>-->
+<script src="../../../data/jquery.js"></script>
+<script src="visualtriggers.js"></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-1.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-1.jpg
new file mode 100644 (file)
index 0000000..ad83df3
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-1.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-2.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-2.jpg
new file mode 100644 (file)
index 0000000..b0c8a3c
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-2.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-3.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-3.jpg
new file mode 100644 (file)
index 0000000..ce3f0e8
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-3.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-4.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-4.jpg
new file mode 100644 (file)
index 0000000..022f64a
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-4.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-5.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-5.jpg
new file mode 100644 (file)
index 0000000..1808434
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-5.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers-6.jpg b/RedbullShopper101/VisualTriggers/visualtriggers-6.jpg
new file mode 100644 (file)
index 0000000..9901630
Binary files /dev/null and b/RedbullShopper101/VisualTriggers/visualtriggers-6.jpg differ
diff --git a/RedbullShopper101/VisualTriggers/visualtriggers.js b/RedbullShopper101/VisualTriggers/visualtriggers.js
new file mode 100644 (file)
index 0000000..b8cebce
--- /dev/null
@@ -0,0 +1,109 @@
+$(function () {
+    window.activeScreen = 0;
+    window.answers = {};
+
+    $(document).on('click', "#submit,#next,#start", function () {
+        if (window.activeScreen == 6) {
+            parent.fluidbook.goNextPage();
+        } else {
+            setActiveScreen(window.activeScreen + 1);
+        }
+        return false
+    });
+
+    $(document).on('click', "[data-a]:not(.active,.done)", function () {
+        $('[data-a].active').removeClass('active');
+        $(this).addClass('active');
+        var a = $(this).data('a');
+        $('[data-t]').hide();
+        $('[data-t="' + a + '"],[data-t="wrong"]').show();
+        return false;
+    });
+
+    $(document).on('click', '[data-t]', function (e) {
+        var aa = $('[data-a].active');
+        if (aa.length === 0) {
+            return false;
+        }
+        if (window.answers[window.activeScreen] === undefined || window.answers[window.activeScreen] === null) {
+            window.answers[window.activeScreen] = {};
+        }
+        var a = aa.data('a');
+        var t = $(this).data('t');
+        window.answers[window.activeScreen][a] = t;
+
+        $('body').append('<div class="m" style="top:' + e.originalEvent.clientY + 'px;left:' + e.originalEvent.clientX + 'px"><img src="bt-' + a + '.png" /></div>');
+
+        aa.addClass('done').removeClass('active');
+    });
+
+
+    for (var i = 1; i <= 6; i++) {
+        $('#screen_' + i).html('<img src="visualtriggers-' + i + '.jpg" />');
+        var map = $('map[name="map_' + i + '"]');
+        if (map.length === 0) {
+            continue;
+        }
+        var coef = $(map).data('coef');
+        if (coef === null) {
+            coef = 1;
+        }
+        $(map).find('area').each(function () {
+            var a = $('<a data-t="' + $(this).attr('href') + '"></a>');
+            var coords = splitCoords($(this).attr('coords'), coef);
+            $(a).css({top: coords[1], left: coords[0], width: coords[2] - coords[0], height: coords[3] - coords[1]});
+            $("#screen_" + i).append($(a));
+        });
+    }
+
+    setActiveScreen(0)
+});
+
+function splitCoords(c, coef) {
+    if (coef === undefined) {
+        coef = 1;
+    }
+    c = c.replace(/\s,/g, ',');
+    var r = c.split(',');
+    var res = [];
+    for (var i = 0; i < r.length; i++) {
+        res[i] = parseFloat(r[i]) * coef;
+    }
+    return res;
+}
+
+function setActiveScreen(i) {
+    window.activeScreen = i;
+    $('body').attr('data-screen', i);
+    $('[data-screens]').each(function () {
+        if ($(this).data('screens').toString().split(',').indexOf(i.toString()) >= 0) {
+            $(this).show();
+        } else {
+            $(this).hide();
+        }
+    });
+    setTimeout(function () {
+        $('#screens > div:not(#screen_' + i + ')').removeClass('show');
+    }, 300)
+    $("#screen_" + i).addClass('show');
+    $(".m").remove();
+    $(".done,.active").removeClass('active').removeClass('done');
+    updateScore();
+}
+
+function updateScore() {
+    var s = 0;
+    $.each(window.answers, function (k, v) {
+        var ok = true;
+        $.each(v, function (kk, vv) {
+            if (vv === 'wrong') {
+                ok = false;
+            }
+        });
+        if (ok) {
+            s++;
+        }
+    });
+
+    $("#score").text(s + "/3");
+}
\ No newline at end of file