diff --git a/src/activities/activities.txt b/src/activities/activities.txt --- a/src/activities/activities.txt +++ b/src/activities/activities.txt @@ -8,7 +8,9 @@ algorithm align4 align4-2players +alphabetical_order alphabet-sequence +ascending_order babymatch babyshapes baby_wordprocessor @@ -18,7 +20,6 @@ bargame_2players braille_alphabets braille_fun -calendar canal_lock categorization checkers diff --git a/src/activities/alphabetical_order/ActivityInfo.qml b/src/activities/alphabetical_order/ActivityInfo.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabetical_order/ActivityInfo.qml @@ -0,0 +1,34 @@ +/* GCompris - ActivityInfo.qml + * + * Copyright (C) 2016 Rudra Nil Basu + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import GCompris 1.0 + +ActivityInfo { + name: "alphabetical_order/Alphabetical_order.qml" + difficulty: 2 + icon: "alphabetical_order/alphabetical_order.svg" + author: "Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>" + demo: true + title: "Alphabetical Order" + description: qsTr("Arrange the given alphabets in ascending or descending order as instructed") + //intro: "arrange the alphabets in the correct order by placing an alphabet in it's correct position" + goal: qsTr("arranging alphabets in ascending or descending order as instructed") + prerequisite: qsTr("Move, drag and drop using mouse") + manual: qsTr("You are provided with few alphabets. Drag and Drop the alphabets in its correct position to reorder the numbers in ascending or descending order as instructed") + section: "math" + createdInVersion: 8000 +} diff --git a/src/activities/alphabetical_order/Alphabetical_order.qml b/src/activities/alphabetical_order/Alphabetical_order.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabetical_order/Alphabetical_order.qml @@ -0,0 +1,30 @@ +/* GCompris - alphabetical_order.qml + * + * Copyright (C) 2016 Rudra Nil Basu + * + * Authors: + * Rudra Nil Basu (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +import QtQuick 2.1 + +import "../../core" +import "../ascending_order" + +Ascending_order { + id: activity + mode: "alphabets" +} diff --git a/src/activities/alphabetical_order/CMakeLists.txt b/src/activities/alphabetical_order/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/activities/alphabetical_order/CMakeLists.txt @@ -0,0 +1 @@ +GCOMPRIS_ADD_RCC(activities/alphabetical_order *.qml *.svg *.js resource/*) diff --git a/src/activities/alphabetical_order/README b/src/activities/alphabetical_order/README new file mode 100644 --- /dev/null +++ b/src/activities/alphabetical_order/README @@ -0,0 +1 @@ +Alphabetical Order Logo: https://openclipart.org/detail/272750/a-stars by GDJ diff --git a/src/activities/alphabetical_order/alphabetical_order.svg b/src/activities/alphabetical_order/alphabetical_order.svg new file mode 100644 --- /dev/null +++ b/src/activities/alphabetical_order/alphabetical_order.svg @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/ascending_order/ActivityInfo.qml b/src/activities/ascending_order/ActivityInfo.qml new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/ActivityInfo.qml @@ -0,0 +1,39 @@ +/* GCompris - ActivityInfo.qml + * + * Copyright (C) 2016 Rudra Nil Basu + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import GCompris 1.0 + +ActivityInfo { + name: "ascending_order/Ascending_order.qml" + difficulty: 2 + icon: "ascending_order/ascending_order.svg" + author: "Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>" + demo: true + //: Activity title + title: qsTr("Ascending and Descending Order") + //: Help title + description: qsTr("Arrange the given numbers in ascending or descending order as instructed") + //: intro: "arrange the numbers in the correct order by placing a number in it's correct position" + //: Help goal + goal: qsTr("arranging numbers in ascending or descending order as instructed") + //: Help prerequisite + prerequisite: qsTr("Move, drag and drop using mouse") + //: Help manual + manual: qsTr("You are provided with few numbers. Drag and Drop the numbers in its correct position to reorder the numbers in ascending or descending order as instructed") + section: "math" + createdInVersion: 8000 +} diff --git a/src/activities/ascending_order/Ascending_order.qml b/src/activities/ascending_order/Ascending_order.qml new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/Ascending_order.qml @@ -0,0 +1,260 @@ +/* GCompris - ascending_order.qml + * + * Copyright (C) 2017 Rudra Nil Basu + * + * Authors: + * Rudra Nil Basu (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import QtQuick 2.6 +import GCompris 1.0 + +import "../../core" +import "ascending_order.js" as Activity + +ActivityBase { + id: activity + + property string mode: "number" + + onStart: focus = true + onStop: {} + + pageComponent: Image { + id: background + anchors.fill: parent + fillMode: Image.PreserveAspectCrop + source: "resource/background.svg" + signal start + signal stop + + Component.onCompleted: { + activity.start.connect(start) + activity.stop.connect(stop) + } + + // Add here the QML items you need to access in javascript + QtObject { + id: items + property Item main: activity.main + property alias background: background + property alias bar: bar + property alias bonus: bonus + property alias boxes: boxes + property alias flow: flow + property alias hints: hints + property alias container: container + property alias instruction: instruction + property real ratio: ApplicationInfo.ratio + property alias score: score + } + + onStart: { Activity.start(items, mode) } + onStop: { Activity.stop() } + + GCText { + id: instruction + wrapMode: TextEdit.WordWrap + fontSize: tinySize + horizontalAlignment: Text.Center + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width * 0.9 + color: 'white' + Rectangle { + z: -1 + opacity: 0.8 + gradient: Gradient { + GradientStop { position: 0.0; color: "#000" } + GradientStop { position: 0.9; color: "#666" } + GradientStop { position: 1.0; color: "#AAA" } + } + radius: 10 + border.color: 'black' + border.width: 1 + anchors.centerIn: parent + width: parent.width * 1.1 + height: parent.contentHeight + } + } + + GCText { + id: hints + wrapMode: TextEdit.WordWrap + fontSize: tinySize + horizontalAlignment: Text.Center + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: instruction.height * 1.25 + width: parent.width * 0.5 + color: 'white' + visible: false + text: "" + Rectangle { + z: -1 + opacity: 0.8 + gradient: Gradient { + GradientStop { position: 0.0; color: "#000" } + GradientStop { position: 0.9; color: "#666" } + GradientStop { position: 1.0; color: "#AAA" } + } + radius: 10 + border.color: 'black' + border.width: 1 + anchors.centerIn: parent + width: parent.width * 1.1 + height: parent.contentHeight + } + } + + Rectangle { + id: container + color: "transparent" + width: Math.min(parent.width, ((boxes.itemAt(0)).width*boxes.model)+(boxes.model-1)*flow.spacing) + height: parent.height/2 + + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter + } + + Flow { + id: flow + spacing: 10 + + /* + * Count number of active animations in the activity + * at this current time + * (No input will be taken at this time) + */ + property int onGoingAnimationCount: 0 + property bool validMousePress + anchors { + fill: parent + } + Repeater { + id: boxes + model: 6 + Rectangle { + id: box + color: "white" + z: mouseArea.drag.active || mouseArea.pressed ? 2 : 1 + property string boxValue + property point beginDragPosition + + width: 65 * ApplicationInfo.ratio + height: 65 * ApplicationInfo.ratio + radius: 10 + border{ + color: "black" + width: 3 * ApplicationInfo.ratio + } + GCText { + id: numText + anchors.centerIn: parent + text: boxValue + font.pointSize: 20 * ApplicationInfo.ratio + } + MouseArea { + id: mouseArea + anchors.fill: parent + drag.target: parent + enabled: (flow.onGoingAnimationCount == 0 && flow.validMousePress == true) ? true : false + onPressed: { + box.beginDragPosition = Qt.point(box.x, box.y) + } + onReleased: { + Activity.placeBlock(box, box.beginDragPosition); + } + } + Behavior on x { + PropertyAnimation { + id: animationX + duration: 500 + easing.type: Easing.InOutBack + onRunningChanged: { + if(animationX.running) { + flow.onGoingAnimationCount++ + } else { + flow.onGoingAnimationCount-- + } + } + } + } + Behavior on y { + PropertyAnimation { + id: animationY + duration: 500 + easing.type: Easing.InOutBack + onRunningChanged: { + if(animationY.running) { + flow.onGoingAnimationCount++ + } else { + flow.onGoingAnimationCount-- + } + } + } + } + } + } + } + } + + DialogHelp { + id: dialogHelp + onClose: home() + } + + BarButton { + id: ok + source: "qrc:/gcompris/src/core/resource/bar_ok.svg"; + sourceSize.width: 75 * ApplicationInfo.ratio + visible: true + anchors { + right: parent.right + bottom: bar.top + bottomMargin: 10 * ApplicationInfo.ratio + rightMargin: 10 * ApplicationInfo.ratio + } + onClicked: Activity.checkOrder() + } + + Score { + id: score + anchors { + right: parent.right + top: instruction.bottom + bottom: undefined + } + } + + Bar { + id: bar + content: BarEnumContent { value: (mode === 'alphabets') ? help | home | level | hint : help | home | level } + onHelpClicked: { + displayDialog(dialogHelp) + } + onPreviousLevelClicked: Activity.previousLevel() + onNextLevelClicked: Activity.nextLevel() + onHomeClicked: activity.home() + onHintClicked: hints.visible = !hints.visible + } + + Bonus { + id: bonus + Component.onCompleted: win.connect(Activity.nextSubLevel) + } + } + +} diff --git a/src/activities/ascending_order/CMakeLists.txt b/src/activities/ascending_order/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/CMakeLists.txt @@ -0,0 +1 @@ +GCOMPRIS_ADD_RCC(activities/ascending_order *.qml *.svg *.js resource/*) diff --git a/src/activities/ascending_order/README b/src/activities/ascending_order/README new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/README @@ -0,0 +1,6 @@ +Background: + +Landscape Egypt: https://openclipart.org/detail/175287/landscape-egypt by gnokii (openclipart) + +Colorful Numbers: https://openclipart.org/detail/221916/colorful-numbers by GDJ +(openclipart) diff --git a/src/activities/ascending_order/ascending_order.js b/src/activities/ascending_order/ascending_order.js new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/ascending_order.js @@ -0,0 +1,288 @@ +/* GCompris - ascending_order.js + * + * Copyright (C) 2016 Rudra Nil Basu + * + * Authors: + * Rudra Nil Basu (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +.pragma library +.import QtQuick 2.0 as Quick + +var currentLevel = 0 +var numberOfLevel = 4 + +var items +var mode + +// num[] will contain the random numbers +var num = [] +var originalArrangement = [] +var alphabets = [] + +var ascendingOrder +var thresholdDistance +var noOfTilesInPreviousLevel + +function start(items_, mode_) { + items = items_ + mode = mode_ + currentLevel = 0 + items.flow.validMousePress = false + thresholdDistance = 4000 * items.ratio + items.score.currentSubLevel = 0 + items.score.numberOfSubLevels = 4 + + if (mode == "alphabets") { + //: list containing all the characters separated by a "/" + var letters = qsTr("a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z") + items.hints.text = letters + alphabets = letters.split("/") + } + + noOfTilesInPreviousLevel = -1 + initLevel() +} + +function stop() { +} + +function initLevel() { + ascendingOrder = items.score.currentSubLevel % 2 == 0 ? true : false + items.instruction.text = ascendingOrder ? qsTr("Drag and drop the items in correct position in Ascending order") : qsTr("Drag and drop the items in correct position in Descending order") + items.flow.validMousePress = true + items.bar.level = currentLevel + 1 + initGrids() +} + +function initGrids() { + items.boxes.model = 2 * (items.bar.level)+1 + + if(noOfTilesInPreviousLevel != items.boxes.model) { + /* + * When the tiles don't automatically rearrange themself + * manually check the marker off + */ + items.flow.onGoingAnimationCount = 0 + noOfTilesInPreviousLevel = items.boxes.model + } else { + restoreGrids() + } + + generateRandomNumbers() + + for(var i = 0;i < items.boxes.model;i++) { + if (mode == "number") { + items.boxes.itemAt(i).boxValue = num[i].toString() + } else if (mode == "alphabets") { + items.boxes.itemAt(i).boxValue = num[i] + } + } +} + +function generateRandomNumbers() { + var n = items.boxes.model + // generate n random numbers and store it in num[] + num = [] + var upperBound + var lowerBound + if(mode == "number") { + upperBound = (items.bar.level)*100 + lowerBound = 0 + } else if(mode == "alphabets") { + upperBound = alphabets.length -1 + lowerBound = 0 + } + while(num.length < n) { + var randomNumber = Math.ceil(Math.random() * (upperBound - lowerBound) + lowerBound) + if (( mode == "number" && num.indexOf(randomNumber) > -1) || ( mode == "alphabets" && num.indexOf(alphabets[randomNumber]) > -1)) { + continue; + } + if (mode == "number") { + num[num.length] = randomNumber + } else if (mode == "alphabets") { + num[num.length] = alphabets[randomNumber] + } + } + for(var i = 0;i < num.length;i++) { + originalArrangement[i] = num[i] + } +} + +function restoreGrids() { + /* Restore the grid positions */ + /* + * To make sure that the flow is properly indexed + * before moving on to the next sub level. + * This is required since if the previous level and + * current level has the same number of tiles, the + * indices are not automatically rearranged + */ + for(var i = 0;i < items.boxes.model;i++) { + if(num[i] === originalArrangement[i]) { + continue + } + var currentBlock = findBlockWithLabel(originalArrangement[i]) + var finalPosition = findBlockWithLabel(num[i]) + currentBlock.x = finalPosition.x + currentBlock.y = finalPosition.y + } +} + +function nextSubLevel() { + if(items.score.numberOfSubLevels <= ++items.score.currentSubLevel) { + if(numberOfLevel <= ++currentLevel) { + currentLevel = 0 + } + items.score.currentSubLevel = 0 + } + initLevel(); +} + +function nextLevel() { + if(numberOfLevel <= ++currentLevel) { + currentLevel = 0 + } + items.score.currentSubLevel = 0 + initLevel() +} + +function previousLevel() { + if(--currentLevel < 0) { + currentLevel = numberOfLevel - 1 + } + items.score.currentSubLevel = 0 + initLevel() +} + +function checkOrder() { + items.flow.validMousePress = false + for(var i = 0;i < items.boxes.count-1;i++) { + if( ascendingOrder && ( ( mode == "number" && num[i] > num[i+1]) || (mode == "alphabets" && alphabets.indexOf(num[i]) > alphabets.indexOf(num[i+1]))) ) { + items.bonus.bad("lion") + items.flow.validMousePress = true + return + } + if( !ascendingOrder && ( (mode == "number" && num[i] < num[i+1]) || (mode == "alphabets" && alphabets.indexOf(num[i]) < alphabets.indexOf(num[i+1]))) ) { + items.bonus.bad("lion") + items.flow.validMousePress = true + return + } + } + items.bonus.good("lion") +} + +function placeBlock(box, initialPosition) { + /* + * find shortest distance from box to other nodes + * if distance <= threshold distance then put box + * in that block and that block in "initialPosition" + */ + var minDistance = Number.POSITIVE_INFINITY + var closestBlock + for(var i = 0;i < items.boxes.model;i++) { + var currentBlock = items.boxes.itemAt(i) + if(currentBlock.boxValue === box.boxValue) { + continue + } else { + var blockDistance = distance(box, currentBlock) + if( blockDistance < minDistance ) { + minDistance = blockDistance + closestBlock = currentBlock + } + } + } + + if(minDistance < thresholdDistance) { + + var item1Pos = -1 + var item2Pos = num.indexOf(closestBlock.boxValue) + for (var i = 0;i < num.length; i++) { + /* + * var item1Pos = num.indexOf(box.boxValue) + * var item2Pos = num.indexOf(closestBlock.boxValue) + * was NOT used since the boxValue is of string type + * and it will return -1 when strictly compared with + * int + */ + if (box.boxValue == num[i]) { + item1Pos = i + } + if (closestBlock.boxValue == num[i]) { + item2Pos = i + } + } + + var oldPositions = [] + var newPositions = [] + + for(var i = 0;i < num.length;i++) { + oldPositions[i] = num[i] + newPositions[i] = num[i] + } + + if(item1Pos > item2Pos) { + // update new position + var currentBoxValue = newPositions[item1Pos] + for(var i = item1Pos;i > item2Pos;i--) { + newPositions[i] = newPositions[i-1] + } + newPositions[item2Pos] = currentBoxValue + } else { + // update new position + var currentBoxValue = newPositions[item1Pos] + for(var i = item1Pos;i < item2Pos;i++) { + newPositions[i] = newPositions[i+1]; + } + newPositions[item2Pos] = currentBoxValue + } + rearrange(oldPositions, newPositions, box, initialPosition) + for(var i = 0;i < num.length;i++) { + num[i] = newPositions[i] + } + } else { + box.x = initialPosition.x + box.y = initialPosition.y + } +} + +function rearrange(oldPositions, newPositions, movingBlock, initialPosition) { + for(var i = 0;i < newPositions.length;i++) { + if(oldPositions[i] === newPositions[i]) { + continue + } + var currentBlock = findBlockWithLabel(newPositions[i]) + var finalPosition = findBlockWithLabel(oldPositions[i]) + if(finalPosition.boxValue == movingBlock.boxValue) { + currentBlock.x = initialPosition.x + currentBlock.y = initialPosition.y + } else { + currentBlock.x = finalPosition.x + currentBlock.y = finalPosition.y + } + } +} + +function findBlockWithLabel(label) { + for(var i = 0;i < items.boxes.model;i++) { + if(items.boxes.itemAt(i).boxValue == label) { + return items.boxes.itemAt(i) + } + } +} + +function distance(box, currentBlock) { + return Math.pow((box.x-currentBlock.x),2) + Math.pow((box.y-currentBlock.y),2) +} diff --git a/src/activities/ascending_order/ascending_order.svg b/src/activities/ascending_order/ascending_order.svg new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/ascending_order.svg @@ -0,0 +1,1857 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/ascending_order/resource/background.svg b/src/activities/ascending_order/resource/background.svg new file mode 100644 --- /dev/null +++ b/src/activities/ascending_order/resource/background.svg @@ -0,0 +1,1269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Landscape Egypt + 2013-02-23T08:35:01 + + https://openclipart.org/detail/175287/landscape-egypt-by-gnokii-175287 + + + gnokii + + + + + cheops + desert + egypt + gizeh + landmark + landscape + pharao + pyramids + + + + + + + + + + + diff --git a/src/activities/calendar/ActivityInfo.qml b/src/activities/calendar/ActivityInfo.qml deleted file mode 100644 --- a/src/activities/calendar/ActivityInfo.qml +++ /dev/null @@ -1,40 +0,0 @@ -/* GCompris - ActivityInfo.qml - * - * Copyright (C) 2017 Amit Sagtani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ -import GCompris 1.0 - -ActivityInfo { - name: "calendar/Calendar.qml" - difficulty: 4 - icon: "calendar/calendar.svg" - author: "Amit Sagtani <asagtani06@gmail.com>" - demo: true - //: Activity title - title: qsTr("Calendar Activity") - //: Help title - description: qsTr("Read the task and select the correct date on calendar") - //intro: "Select the asked date on the calendar" - //: Help goal - goal: qsTr("Learn to use a calendar efficiently") - //: Help prerequisite - prerequisite: qsTr("Concept of week, month and year") - //: Help manual - manual: qsTr("Review the instructions and select the correct date on calendar.") - credit: "" - section: "discovery" - createdInVersion: 9000 -} diff --git a/src/activities/calendar/CMakeLists.txt b/src/activities/calendar/CMakeLists.txt deleted file mode 100644 --- a/src/activities/calendar/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -GCOMPRIS_ADD_RCC(activities/calendar *.qml *.svg *.js resource/*) diff --git a/src/activities/calendar/Calendar.qml b/src/activities/calendar/Calendar.qml deleted file mode 100644 --- a/src/activities/calendar/Calendar.qml +++ /dev/null @@ -1,422 +0,0 @@ -/* GCompris - Calendar.qml - * - * Copyright (C) 2017 Amit Sagtani - * - * Authors: - * Amit Sagtani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -import QtQuick 2.6 -import GCompris 1.0 -import QtQuick.Controls 1.5 -import QtQuick.Controls.Private 1.0 -import QtQuick.Controls.Styles 1.4 -import "../../core" -import "calendar.js" as Activity -import "calendar_dataset.js" as Dataset - -ActivityBase { - id: activity - property var dataset: Dataset - onStart: focus = true - onStop: {} - - pageComponent: Image { - id: background - signal start - signal stop - fillMode: Image.PreserveAspectCrop - source: "qrc:/gcompris/src/activities/fifteen/resource/background.svg" - sourceSize.width: Math.max(parent.width, parent.height) - - Component.onCompleted: { - activity.start.connect(start) - activity.stop.connect(stop) - } - - // Add here the QML items you need to access in javascript - QtObject { - id: items - property Item main: activity.main - property alias background: background - property alias bar: bar - property alias bonus: bonus - property alias calendar: calendar - property alias okButton: okButton - property alias questionItem: questionItem - property alias score: score - property alias answerChoices: answerChoices - property alias questionDelay: questionDelay - property alias okButtonParticles: okButtonParticles - property bool horizontalLayout: background.width > background.height * 1.5 - } - - onStart: { Activity.start(items, dataset) } - onStop: { Activity.stop() } - Keys.onPressed: (answerChoices.visible) ? answerChoices.handleKeys(event) : handleKeys(event); - - // Question time delay - Timer { - id: questionDelay - repeat: false - interval: 1600 - onTriggered: { - Activity.initQuestion() - } - onRunningChanged: okButtonMouseArea.enabled = !okButtonMouseArea.enabled - } - - Rectangle { - id: calendarBox - width: items.horizontalLayout ? parent.width * 0.45 : (answerChoices.visible ? parent.width * 0.50 : parent.width * 0.70) - height: items.horizontalLayout ? parent.height * 0.70 : (answerChoices.visible ? parent.width * 0.50: parent.height * 0.40) - anchors.top: parent.top - anchors.topMargin: 100 - anchors.bottom: bar.top - anchors.bottomMargin: 50 - anchors.horizontalCenter: parent.horizontalCenter - color: "black" - opacity: 0.3 - } - - Calendar { - id: calendar - weekNumbersVisible: false - width: calendarBox.width * 0.85 - height: calendarBox.height * 0.85 - anchors.centerIn: calendarBox - frameVisible: true - focus: !answerChoices.visible - __locale: Qt.locale(ApplicationSettings.locale) - style: CalendarStyle { - navigationBar: Rectangle { - height: Math.round(TextSingleton.implicitHeight * 2.73) - color: "lightBlue" - Rectangle { - color: Qt.rgba(1, 1, 1, 0.6) - height: 1 - width: parent.width - } - Rectangle { - anchors.bottom: parent.bottom - height: 1 - width: parent.width - color: "#ddd" - } - BarButton { - id: previousMonth - height: parent.height - width: height * 0.75 - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - source: "qrc:/gcompris/src/core/resource/bar_previous.svg" - visible: ((calendar.visibleYear + calendar.visibleMonth) > Activity.minRange) ? true : false - onClicked: control.showPreviousMonth() - } - GCText { - id: dateText - text: styleData.title - horizontalAlignment: Text.AlignHCenter - fontSizeMode: Text.Fit - anchors.verticalCenter: parent.verticalCenter - anchors.left: previousMonth.right - anchors.leftMargin: 2 - anchors.right: nextMonth.left - anchors.rightMargin: 2 - } - BarButton { - id: nextMonth - height: parent.height - width: height * 0.75 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - source: "qrc:/gcompris/src/core/resource/bar_next.svg" - visible: ((calendar.visibleYear + calendar.visibleMonth) < Activity.maxRange) ? true : false - onClicked: control.showNextMonth() - } - } - dayDelegate: Rectangle { - anchors.fill: parent - anchors.leftMargin: (!addExtraMargin || control.weekNumbersVisible) && styleData.index % CalendarUtils.daysInAWeek === 0 ? 0 : -1 - anchors.rightMargin: !addExtraMargin && styleData.index % CalendarUtils.daysInAWeek === CalendarUtils.daysInAWeek - 1 ? 0 : -1 - anchors.bottomMargin: !addExtraMargin && styleData.index >= CalendarUtils.daysInAWeek * (CalendarUtils.weeksOnACalendarMonth - 1) ? 0 : -1 - anchors.topMargin: styleData.selected ? -1 : 0 - color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "#F2F2F2" - border.color: "#cec4c4" - radius: 5 - property bool addExtraMargin: control.frameVisible && styleData.selected - readonly property color sameMonthDateTextColor: "#373737" - readonly property color selectedDateColor: "#3778d0" - readonly property color selectedDateTextColor: "white" - readonly property color differentMonthDateTextColor: "#bbb" - readonly property color invalidDateColor: "#dddddd" - Label { - id: dayDelegateText - text: styleData.date.getDate() - anchors.centerIn: parent - horizontalAlignment: Text.AlignRight - font.family: GCSingletonFontLoader.fontLoader.name - font.pixelSize: Math.min(parent.height/3, parent.width/3) - color: { - var theColor = invalidDateColor; - if (styleData.valid) { - // Date is within the valid range. - theColor = styleData.visibleMonth ? sameMonthDateTextColor : differentMonthDateTextColor; - if (styleData.selected) - theColor = selectedDateTextColor; - } - theColor; - } - } - } - dayOfWeekDelegate: Rectangle { - color: "lightgray" - implicitHeight: Math.round(TextSingleton.implicitHeight * 2.25) - Label { - text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) - font.family: GCSingletonFontLoader.fontLoader.name - color: "#373737" - anchors.centerIn: parent - } - } - } - onVisibleMonthChanged: { - Activity.monthSelected = visibleMonth - Activity.daySelected = selectedDate.getDate() - } - onVisibleYearChanged: { - Activity.yearSelected = visibleYear - Activity.daySelected = selectedDate.getDate() - } - onClicked: { - Activity.daySelected = selectedDate.getDate() - } - onSelectedDateChanged: { - Activity.daySelected = selectedDate.getDate() - } - - } - - function handleKeys(event) { - if(event.key === Qt.Key_Space) { - Activity.checkAnswer() - event.accepted = true - } - if(event.key === Qt.Key_Enter) { - Activity.checkAnswer() - event.accepted = true - } - if(event.key === Qt.Key_Return) { - Activity.checkAnswer() - event.accepted = true - } - if(event.key === Qt.Key_Home) { - calendar.__selectFirstDayOfMonth(); - event.accepted = true; - } - if(event.key === Qt.Key_End) { - calendar.__selectLastDayOfMonth(); - event.accepted = true; - } - if(event.key === Qt.Key_PageUp) { - calendar.__selectPreviousMonth(); - event.accepted = true; - } - if(event.key === Qt.Key_PageDown) { - calendar.__selectNextMonth(); - event.accepted = true; - } - if(event.key === Qt.Key_Left) { - calendar.__selectPreviousDay(); - event.accepted = true; - } - if(event.key === Qt.Key_Up) { - calendar.__selectPreviousWeek(); - event.accepted = true; - } - if(event.key === Qt.Key_Down) { - calendar.__selectNextWeek(); - event.accepted = true; - } - if(event.key === Qt.Key_Right) { - calendar.__selectNextDay(); - event.accepted = true; - } - } - - // Creates a table consisting of days of weeks. - GridView { - id: answerChoices - model: [qsTr("Sunday"), qsTr("Monday"), qsTr("Tuesday"), qsTr("Wednesday"), qsTr("Thursday"), qsTr("Friday"), qsTr("Saturday")] - anchors.top: calendarBox.top - anchors.left: questionItem.left - anchors.right: calendarBox.left - interactive: false - - property bool keyNavigation: false - - width: calendar.width * 0.5 - height: (calendar.height / 6.5) * 7 - cellWidth: calendar.width * 0.5 - cellHeight: calendar.height / 6.5 - keyNavigationWraps: true - anchors.rightMargin: 10 * ApplicationInfo.ratio - delegate: ChoiceTable { - width: calendar.width * 0.5 - height: calendar.height / 6.5 - choices.text: modelData - anchors.rightMargin: 2 - } - Keys.enabled: answerChoices.visible - function handleKeys(event) { - if(event.key === Qt.Key_Down) { - keyNavigation = true - answerChoices.moveCurrentIndexDown() - } - if(event.key === Qt.Key_Up) { - keyNavigation = true - answerChoices.moveCurrentIndexUp() - } - if(event.key === Qt.Key_Enter) { - keyNavigation = true - Activity.dayOfWeekSelected = currentIndex - answerChoices.currentItem.select() - } - if(event.key === Qt.Key_Space) { - keyNavigation = true - Activity.dayOfWeekSelected = currentIndex - answerChoices.currentItem.select() - } - if(event.key === Qt.Key_Return) { - keyNavigation = true - Activity.dayOfWeekSelected = currentIndex - answerChoices.currentItem.select() - } - } - - highlight: Rectangle { - width: calendar.width * 0.5 - height: calendar.height / 6.5 - color: "black" - opacity: 0.8 - radius: 5 - visible: answerChoices.keyNavigation - y: answerChoices.currentItem.y - Behavior on y { - SpringAnimation { - spring: 3 - damping: 0.2 - } - } - } - highlightFollowsCurrentItem: false - focus: answerChoices.visible - } - - Rectangle { - id: questionItemBackground - color: "black" - border.width: 2 - radius: 10 - opacity: 0.85 - z: 10 - anchors { - horizontalCenter: parent.horizontalCenter - bottomMargin: 10 - } - width: items.horizontalLayout ? calendarBox.width * 2 : parent.width - 20 - height: calendarBox.height * 0.125 - gradient: Gradient { - GradientStop { position: 0.0; color: "#000" } - GradientStop { position: 0.9; color: "#666" } - GradientStop { position: 1.0; color: "#AAA" } - } - } - - // Displays the question. - GCText { - id: questionItem - anchors.fill: questionItemBackground - anchors.bottom: questionItemBackground.bottom - fontSizeMode: Text.Fit - wrapMode: Text.Wrap - z: 10 - color: "white" - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - - // Answer Submission button. - BarButton { - id: okButton - source: "qrc:/gcompris/src/core/resource/bar_ok.svg" - width: 50 * ApplicationInfo.ratio - height: width - sourceSize.width: width - sourceSize.height: height - y: parent.height * 0.8 - z: 10 - anchors { - horizontalCenter: score.horizontalCenter - bottom: calendarBox.bottom - } - ParticleSystemStarLoader { - id: okButtonParticles - clip: false - } - MouseArea { - id: okButtonMouseArea - anchors.fill: parent - onClicked: { - Activity.checkAnswer() - } - } - } - - DialogHelp { - id: dialogHelp - onClose: home() - } - - Bar { - id: bar - content: BarEnumContent { value: help | home | level } - onHelpClicked: { - displayDialog(dialogHelp) - } - onPreviousLevelClicked: Activity.previousLevel() - onNextLevelClicked: Activity.nextLevel() - onHomeClicked: activity.home() - } - - Bonus { - id: bonus - Component.onCompleted: win.connect(Activity.nextLevel) - } - - Score { - id: score - fontSize: items.horizontalLayout ? 16 : (answerChoices.visible ? 12 : 8) - anchors.top: calendarBox.top - anchors.bottom: undefined - anchors.left: calendarBox.right - anchors.right: undefined - anchors.margins: items.horizontalLayout ? 30 : 10 - } - } -} - - diff --git a/src/activities/calendar/ChoiceTable.qml b/src/activities/calendar/ChoiceTable.qml deleted file mode 100644 --- a/src/activities/calendar/ChoiceTable.qml +++ /dev/null @@ -1,151 +0,0 @@ -/* GCompris - ChoiceTable.qml - * - * Copyright (C) 2017 Amit Sagtani - * - * Authors: - * Amit Sagtani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -// Creates a active button for making a table of days of weeks. -// Set different behaviours and animations on selecting a day from day table here. - -import QtQuick 2.6 -import GCompris 1.0 -import QtQuick.Controls 1.5 -import "../../core" -import "calendar.js" as Activity - -Rectangle { - id: choiceBox - property alias choices: choices - color: "#AAFFFFFF" - radius: 10 - anchors.margins: 30 - border.color: "black" - border.width: 2 - QtObject { - property alias animWin: animWin - property alias crossAnim: crossAnim - property alias choiceBox: choiceBox - } - - function select() { - if(Activity.dayOfWeekSelected === Activity.correctAnswer["dayOfWeek"]) { - particles.burst(40) - animWin.start() - Activity.checkAnswer() - } - else { - crossAnim.start() - } - } - - Image { - id: cross - source: "qrc:/gcompris/src/activities/colors/resource/checkError.svg" - sourceSize.width: 128 * ApplicationInfo.ratio - anchors.centerIn: parent - width: 0 - height: width - opacity: 1 - property int size: Math.min(parent.width, parent.height) - } - - SequentialAnimation { - id: crossAnim - ParallelAnimation { - PropertyAnimation { - target: cross - property: "width" - duration: 300 - from: 0 - to: choiceBox.width - easing.type: Easing.InOutQuad - } - PropertyAnimation { - target: cross - property: "height" - duration: 300 - from: 0 - to: choiceBox.height - easing.type: Easing.InOutQuad - } - } - PauseAnimation { duration: 800 } - ParallelAnimation { - PropertyAnimation { - target: cross - property: "width" - duration: 300 - from: choiceBox.width - to: 0 - easing.type: Easing.InOutQuad - } - PropertyAnimation { - target: cross - property: "height" - duration: 300 - from: choiceBox.height - to: 0 - easing.type: Easing.InOutQuad - } - } - } - - ParticleSystemStarLoader { - id: particles - clip: false - } - - GCText { - id: choices - anchors.fill: parent - anchors.leftMargin: choiceBox.border.width - anchors.rightMargin: choiceBox.border.width - fontSizeMode: Text.Fit - font.bold: true - color: "#373737" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - Activity.dayOfWeekSelected = index - select() - choiceBox.scale = 1 - } - hoverEnabled: true - enabled: !crossAnim.running && !animWin.running - onEntered: choiceBox.scale = 1.1 - onExited: choiceBox.scale = 1 - } - - SequentialAnimation { - id: animWin - running: false - loops: 1 - NumberAnimation { - target: choiceBox - property: "rotation" - from: 0; to: 360 - duration: 600 - easing.type: Easing.InOutQuad - } - } -} diff --git a/src/activities/calendar/README b/src/activities/calendar/README deleted file mode 100644 --- a/src/activities/calendar/README +++ /dev/null @@ -1,2 +0,0 @@ -Activity Icon: https://openclipart.org/detail/95215/calendar-month by baditaflorin (openclipart) - diff --git a/src/activities/calendar/calendar.js b/src/activities/calendar/calendar.js deleted file mode 100644 --- a/src/activities/calendar/calendar.js +++ /dev/null @@ -1,140 +0,0 @@ -/* GCompris - calendar.js - * - * Copyright (C) 2017 Amit Sagtani - * - * Authors: - * Amit Sagtani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -.pragma library -.import QtQuick 2.6 as Quick -.import GCompris 1.0 as GCompris //for ApplicationInfo -.import "qrc:/gcompris/src/core/core.js" as Core - -var currentLevel = 0 -var numberOfLevel -var currentSubLevel = 1 -var currentDataSet -var currentLevelConfig -var dataset -var items -var daySelected = 1 -var monthSelected = 2 -var yearSelected = 2018 -var dayOfWeekSelected -var minRange //sum of min. visible month and year on calendar for navigation bar next/prev button visibility. -var maxRange //sum of max. visible month and year on calendar for navigation bar next/prev button visibility. -var correctAnswer -var mode - -function start(items_, dataset_) { - items = items_ - dataset = dataset_.get() - numberOfLevel = dataset.length - currentLevel = 0 - initLevel(); -} - -function stop() { -} - -function initLevel() { - currentSubLevel = 1; - items.bar.level = currentLevel + 1 - currentLevelConfig = dataset[currentLevel][0][0] - setCalendarConfigurations() - initQuestion(); -} - -function nextLevel() { - if(numberOfLevel <= ++currentLevel) { - currentLevel = 0 - } - initLevel(); -} - -function previousLevel() { - if(--currentLevel < 0) { - currentLevel = numberOfLevel - 1 - } - initLevel(); -} - -// Configure calendar properties for every level. -function setCalendarConfigurations() { - minRange = Number(currentLevelConfig["minimumDate"].slice(5,7)) + Number(currentLevelConfig["minimumDate"].slice(0,4)) - 1; - maxRange = Number(currentLevelConfig["maximumDate"].slice(5,7)) + Number(currentLevelConfig["maximumDate"].slice(0,4)) - 1; - mode = currentLevelConfig["mode"] - items.calendar.navigationBarVisible = currentLevelConfig["navigationBarVisible"] - items.calendar.minimumDate = currentLevelConfig["minimumDate"] - items.calendar.maximumDate = currentLevelConfig["maximumDate"] - items.calendar.visibleYear = currentLevelConfig["visibleYear"] - yearSelected = currentLevelConfig["visibleYear"] - items.calendar.visibleMonth = currentLevelConfig["visibleMonth"] - monthSelected = currentLevelConfig["visibleMonth"] - items.answerChoices.visible = (mode === "findDayOfWeek") ? true : false - items.okButton.visible = !items.answerChoices.visible - currentDataSet = dataset[currentLevel][1] - currentDataSet = Core.shuffle(currentDataSet) - items.score.numberOfSubLevels = currentDataSet.length - items.score.currentSubLevel = currentSubLevel -} - -function initQuestion() { - if(currentDataSet.length < currentSubLevel) { - items.bonus.good("lion") - } - else { - items.score.currentSubLevel = currentSubLevel - items.questionItem.text = currentDataSet[currentSubLevel-1]["question"] - correctAnswer = currentDataSet[currentSubLevel-1]["answer"] - } -} - -function updateScore(isCorrectAnswer) { - if(isCorrectAnswer) { - items.questionDelay.start() - items.okButtonParticles.burst(20) - items.score.playWinAnimation() - currentSubLevel++; - } - else - items.bonus.bad("lion") -} - -function checkAnswer() { - var isCorrectAnswer = false - // For levels having questions based on day of week only. - if(mode === "findDayOfWeek") { - if(dayOfWeekSelected === correctAnswer["dayOfWeek"]) { - isCorrectAnswer = true - } - } - // For levels having question based on month only. - else if(mode === "findMonthOnly") { - if(correctAnswer["month"].indexOf(monthSelected) >= 0) { - isCorrectAnswer = true - } - } - // For levels having questions based on dayOfWeek, month and year. - else if(mode !== "findDayOfWeek") { - if(monthSelected === correctAnswer["month"] && daySelected === correctAnswer["day"] && yearSelected === correctAnswer["year"]) { - isCorrectAnswer = true - } - } - updateScore(isCorrectAnswer) -} - diff --git a/src/activities/calendar/calendar.svg b/src/activities/calendar/calendar.svg deleted file mode 100644 --- a/src/activities/calendar/calendar.svg +++ /dev/null @@ -1,1163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Openclipart - - - Calendar Month - 2010-11-12T11:27:48 - - https://openclipart.org/detail/95215/calendar-month-by-baditaflorin - - - baditaflorin - - - - - calendar - january - month - - - - - - - - - - - diff --git a/src/activities/calendar/calendar_dataset.js b/src/activities/calendar/calendar_dataset.js deleted file mode 100644 --- a/src/activities/calendar/calendar_dataset.js +++ /dev/null @@ -1,317 +0,0 @@ -/* GCompris - calendar_dataset.js - * - * Copyright (C) 2017 Amit Sagtani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -// Contains the questions, answers and calendar configurations of every level. -// Add more levels by inserting questions and answers below. -// Days of weeks are indexed from 0 i.e (Sunday = 0, Monday = 1, Tuesday = 2, .... ..... .... , Saturday = 6) -// Months of year are indexed from 0 i.e (January = 0, February = 1, March = 2, .... ..... ...., December = 11) -//[ - //MODES - // findMonthOnly --> For questions based on finding month only. - // findYearMonthDay --> For questions based on finding year, month and day. - // findDayOfWeek --> For questions based on finding day of week only. - // findDay --> For questions based on finding day of a given month and year. -// ] - -function get() { - return [ - [ // Level 1 - [ // Level 1 Configurations - { - "navigationBarVisible" : false, - "minimumDate": "2017-01-01", - "maximumDate": "2019-12-31", - "visibleMonth": 2, - "visibleYear": 2018, - "mode": "findDay" - } - ], - [ // Level 1 Questions - { - "question": qsTr("Select day 23"), - "answer": {"year": 2018, "month": 2, "day": 23} - }, - { - "question": qsTr("Select day 1"), - "answer": {"year": 2018, "month": 2, "day": 1} - }, - { - "question": qsTr("Select day 16"), - "answer": {"year": 2018, "month": 2, "day": 16} - }, - { - "question": qsTr("Select day 28"), - "answer": {"year": 2018, "month": 2, "day": 28} - }, - { - "question": qsTr("Select day 11"), - "answer": {"year": 2018, "month": 2, "day": 11} - }, - { - "question": qsTr("Select day 20"), - "answer": {"year": 2018, "month": 2, "day": 20} - } - ] - - ], - - [ // Level 2 - [ // Level 2 Configurations - { - "navigationBarVisible" : false, - "minimumDate": "2018-03-01", - "maximumDate": "2018-03-31", - "visibleMonth": 2, - "visibleYear": 2018, - "mode": "findDayOfWeek" - } - ], - [ // Level 2 Questions - { - "question": qsTr("What day of week is the 4th of given month?"), - "answer": {"dayOfWeek": 0} - }, - { - "question": qsTr("What day of the week is the 12th of given month?"), - "answer": {"dayOfWeek": 1} - }, - { - "question": qsTr("What day of the week is the 20th of given month?"), - "answer": {"dayOfWeek": 2} - }, - { - "question": qsTr("What day of the week is the 28th of given month?"), - "answer": {"dayOfWeek": 3} - }, - { - "question": qsTr("What day of the week is the 22nd of given month?"), - "answer": {"dayOfWeek": 4} - }, - { - "question": qsTr("What day of the week is the 16th of given month?"), - "answer": {"dayOfWeek": 5} - }, - { - "question": qsTr("What day of the week is the 10th of given month?"), - "answer": {"dayOfWeek": 6} - } - ] - ], - - [ // Level 3 - [ // Level 3 configurations - { - "navigationBarVisible": false, - "minimumDate": "2018-03-01", - "maximumDate": "2018-03-31", - "visibleMonth": 2, - "visibleYear": 2018, - "mode": "findDay" - } - ], - - [ // Level 3 Questions - { - "question": qsTr("Select a Monday between days 1 and 7 of given month"), - "answer": {"year": 2018, "month": 2, "day": 5} - }, - { - "question": qsTr("Select a Tuesday between days 8 and 16 of given month"), - "answer": {"year": 2018, "month": 2, "day": 13} - }, - { - "question": qsTr("Select a Wednesday between days 15 and 22 of given month"), - "answer": {"year": 2018, "month": 2, "day": 21} - }, - { - "question": qsTr("Select a Thursday between days 26 and 31 of given month"), - "answer": {"year": 2018, "month": 2, "day": 29} - }, - { - "question": qsTr("Select a Friday between days 20 and 25 of given month"), - "answer": {"year": 2018, "month": 2, "day": 23} - }, - { - "question": qsTr("Select a Saturday between days 13 and 23 of given month"), - "answer": {"year": 2018, "month": 2, "day": 17} - }, - { - "question": qsTr("Select a Sunday between days 5 and 17 of given month"), - "answer": {"year": 2018, "month": 2, "day": 11} - } - ] - ], - - [ // level 4 - [ // Level 4 Configurations - { - "navigationBarVisible" : false, - "minimumDate": "2017-01-01", - "maximumDate": "2019-12-31", - "visibleMonth": 2, - "visibleYear": 2018, - "mode": "findDay" - } - ], - [ // Level 4 Questions - { - "question": qsTr("Select second day before the 15th of given month"), - "answer": {"year": 2018, "month": 2, "day": 13} - }, - { - "question": qsTr("Select fourth Sunday of given month"), - "answer": {"year": 2018, "month": 2, "day": 25} - }, - { - "question": qsTr("Select day one week after 13th of given month"), - "answer": {"year": 2018, "month": 2, "day": 20} - }, - { - "question": qsTr("Select fifth Thursday of given month"), - "answer": {"year": 2018, "month": 2, "day": 29} - }, - { - "question": qsTr("Select fourth day after 27th of given month"), - "answer": {"year": 2018, "month": 2, "day": 31} - } - ] - ], - - [ // Level 5 - [ // Level 5 Configurations - { - "navigationBarVisible" : true, - "minimumDate": "2018-01-01", - "maximumDate": "2018-12-31", - "visibleMonth": 1, - "visibleYear": 2018, - "mode": "findMonthOnly" - } - ], - [ // Level 5 Questions - { - "question": qsTr("Find the month starting a Thursday and having 28 days"), - "answer": {"month": [1]} - }, - { - "question": qsTr("Find a month starting a Monday and having 31 days"), - "answer": {"month": [0, 9]} - }, - { - "question": qsTr("Find the month between June and August"), - "answer": {"month": [6]} - }, - { - "question": qsTr("Find a month starting a Saturday"), - "answer": {"month": [8, 11]} - }, - { - "question": qsTr("Find a month having 30 days"), - "answer": {"month": [3, 5, 8, 10]} - } - ] - ], - - [ // level 6 - [ // Level 6 Configurations - { - "navigationBarVisible" : true, - "minimumDate": "2017-01-01", - "maximumDate": "2019-12-31", - "visibleMonth": 2, - "visibleYear": 2018, - "mode": "findYearMonthDay" - } - - ], - [ // Level 6 Questions - { - "question": qsTr("Find the first Monday of January month of year 2019"), - "answer": {"year": 2019, "month": 0, "day": 7} - }, - { - "question": qsTr("Find the second Wednesday of February month of year 2019"), - "answer": {"year": 2019, "month": 1, "day": 13} - }, - { - "question": qsTr("Find the third Friday of March month of year 2019"), - "answer": {"year": 2019, "month": 2, "day": 15} - }, - { - "question": qsTr("Find the fifth Sunday of April month of year 2018"), - "answer": {"year": 2018, "month": 3, "day": 29} - }, - { - "question": qsTr("Find the fourth Tuesday of July month of year 2018"), - "answer": {"year": 2018, "month": 6, "day": 24} - }, - { - "question": qsTr("Find the first Monday of August month of year 2018"), - "answer": {"year": 2018, "month": 7, "day": 6} - }, - { - "question": qsTr("Find the third Thursday of September month of year 2017"), - "answer": {"year": 2017, "month": 8, "day": 21} - }, - { - "question": qsTr("Find the fifth Sunday of October month of year 2017"), - "answer": {"year": 2017, "month": 9, "day": 29} - }, - { - "question": qsTr("Find the second Friday of December month of year 2017"), - "answer": {"year": 2017, "month": 11, "day": 8} - } - ] - ], - - [ // Level 7 - [ // Level 7 Configurations - { - "navigationBarVisible" : true, - "minimumDate": "2017-01-01", - "maximumDate": "2019-12-31", - "visibleMonth": 1, - "visibleYear": 2018, - "mode": "findYearMonthDay" - } - ], - [ // Level 7 Questions - { - "question": qsTr("Columbus Day is celebrated on the second monday of October. Find the date of Columbus Day in 2018"), - "answer": {"year": 2018, "month": 9, "day": 8} - }, - { - "question": qsTr("Braille Day is celebrated one day before January 5. Find the date of Braille Day in 2018"), - "answer": {"year": 2018, "month": 0, "day": 4} - }, - { - "question": qsTr("Mark's birthday is on March 4. His party is exactly two weeks later. Find the date of his party in 2018"), - "answer": {"year": 2018, "month": 2, "day": 18} - }, - { - "question": qsTr("Mother's Day falls on the second Sunday in May. Find the date of Mother's Day in 2018"), - "answer": {"year": 2018, "month": 4, "day": 13} - }, - { - "question": qsTr("Sports competition will be held on last Friday of September 2018. Select the date of sports competition on the calendar"), - "answer": {"year": 2018, "month": 8, "day": 28} - } - ] - ] - ] -} diff --git a/src/activities/family/ActivityInfo.qml b/src/activities/family/ActivityInfo.qml --- a/src/activities/family/ActivityInfo.qml +++ b/src/activities/family/ActivityInfo.qml @@ -23,16 +23,11 @@ icon: "family/family.svg" author: "Rajdeep Kaur <rajdeep.kaur@kde.org>" demo: true - //: Activity title title: qsTr("Family") - //: Help title description: qsTr("This activity will give teach about who we are related to our relatives") //intro: "Let us understand what to call our relatives" - //: Help goal goal: qsTr("To get an idea about relationships in the family") - //: Help prerequisite prerequisite: qsTr("Reading skills") - //: Help manual manual: qsTr("To find the relation between two family members.\n" + "For the married couple we have highlighted with the rings that is between two circles. For the rest of relations we have only solid lines.\n" + "Red circle will point to you and blue one to your relative. Now you have to find what you should call this person.\n") diff --git a/src/activities/family_find_relative/ActivityInfo.qml b/src/activities/family_find_relative/ActivityInfo.qml --- a/src/activities/family_find_relative/ActivityInfo.qml +++ b/src/activities/family_find_relative/ActivityInfo.qml @@ -23,16 +23,11 @@ icon: "family_find_relative/family_find_relative.svg" author: "Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>" demo: true - //: Activity title title: qsTr("Family find relatives") - //: Help title description: "" //intro: "Click on a pair that defines the given relation" - //: Help goal goal: qsTr("To get an idea of family relations") - //: Help prerequisite prerequisite: qsTr("Reading, moving and clicking with the mouse") - //: Help manual manual: qsTr("You are provided with a relation and a family hierarchy. Click on a pair of family members which correctly identifies the given relation.") credit: "" section: "discovery" diff --git a/src/activities/missing-letter/missing-letter.js b/src/activities/missing-letter/missing-letter.js --- a/src/activities/missing-letter/missing-letter.js +++ b/src/activities/missing-letter/missing-letter.js @@ -211,11 +211,11 @@ function nextSubLevel() { var question = getCurrentQuestion() - if(items.score.currentSubLevel >= questions[currentLevel].length) { + if(++items.score.currentSubLevel > questions[currentLevel].length) { items.bonus.good('flower') + nextLevel() return } - items.score.currentSubLevel ++; showQuestion() } diff --git a/src/activities/penalty/GoalZone.qml b/src/activities/penalty/GoalZone.qml deleted file mode 100644 --- a/src/activities/penalty/GoalZone.qml +++ /dev/null @@ -1,76 +0,0 @@ -/* GCompris - GoalZone.qml -* -* Copyright (C) 2017 Rohit Das -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, see . -*/ -import QtQuick 2.6 -import './penalty.js' as Activity - -Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.top: parent.top - anchors.topMargin: parent.height * 0.07 - property var progress: undefined - state: "INITIAL" - color: "transparent" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton - /* enabled if the current zone has been clicked on or if the ball is at the initial position */ - enabled: items.saveBallState === parent.state || (items.saveBallState === "INITIAL" && ball.x === items.ballX && ball.y === items.ballY) - onClicked: changeBallState() - } - - function changeBallState() { - instruction.text = "" - - if(ball.state === "FAIL") { - Activity.resetLevel() - return - } - - /* This is a shoot */ - if (items.saveBallState === "INITIAL") { - items.saveBallState = state - } - - if(progress.ratio > 0) { - /* Second click, stop animation */ - progress.anim.running = false; - - /* Play sound */ - activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/brick.wav") - - /* Success or not */ - if(progress.ratio < 100) { - /* Success */ - ball.state = state - } else { - /* failure */ - ball.state = "FAIL" - } - timerBonus.start() - } else { - /* First click, start animation*/ - progress.anim.running = true; - - /* Play sound */ - activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/flip.wav") - } - } -} diff --git a/src/activities/penalty/Penalty.qml b/src/activities/penalty/Penalty.qml --- a/src/activities/penalty/Penalty.qml +++ b/src/activities/penalty/Penalty.qml @@ -45,34 +45,113 @@ activity.stop.connect(stop) } + function changeBallState(saveBallState) { + instruction.text = "" + + if(ball.state === "FAIL") { + Activity.resetLevel() + return + } + + /* This is a shoot */ + var progress = progressTop + if (saveBallState == "LEFT") { + progress = progressLeft + } + else if(saveBallState == "RIGHT") { + progress = progressRight + } + + if(progress.ratio > 0) { + /* Second click, stop animation */ + progress.anim.running = false; + + /* Play sound */ + activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/brick.wav") + + /* Success or not */ + if(progress.ratio < 100) { + /* Success */ + ball.state = saveBallState + } else { + /* failure */ + ball.state = "FAIL" + } + timerBonus.start() + } else { + /* First click, start animation*/ + progress.anim.running = true; + + /* Play sound */ + activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/flip.wav") + } + } + // To enable tapping/clicking on left side of goal - GoalZone { + Rectangle { id: rectLeft - state: "LEFT" - progress: progressLeft + anchors.left: parent.left + anchors.top: parent.top anchors.right: player.left + anchors.bottom: parent.bottom anchors.leftMargin: parent.width * 0.08 + anchors.topMargin: parent.height * 0.07 anchors.bottomMargin: parent.height * 0.45 + color: "transparent" + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton + onClicked: { + if(mouse.button) { + changeBallState("LEFT") + } + } + } } // To enable tapping/clicking on top of goal - GoalZone { + Rectangle { id: rectTop - state: "CENTER" - progress: progressTop - anchors.left: player.left - anchors.right: player.right + anchors.top: parent.top + anchors.left: rectLeft.right + anchors.right: rectRight.left anchors.bottom: player.top + anchors.topMargin: parent.height * 0.07 + color: "transparent" + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton + onClicked: { + if(mouse.button) { + changeBallState("CENTER") + } + } + } } // To enable tapping/clicking on right side of goal - GoalZone { + Rectangle { id: rectRight - state: "RIGHT" - progress: progressRight anchors.left: player.right + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom anchors.rightMargin: parent.width * 0.06 + anchors.topMargin: parent.height * 0.07 anchors.bottomMargin: parent.height * 0.45 + color: "transparent" + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton + onClicked: { + if(mouse.button) { + changeBallState("RIGHT") + } + } + } } // Add here the QML items you need to access in javascript @@ -88,9 +167,6 @@ property alias bonus: bonus property int duration : 0 property int progressBarOpacity : 40 - property string saveBallState: "INITIAL" - property double ballX: ball.parent.width/2 - ball.width/2 - property double ballY: ball.parent.height*0.77 - ball.height/2 } onStart: { Activity.start(items) } @@ -141,33 +217,124 @@ /* The progress bars */ - Progress { + Rectangle { id: progressLeft + property int ratio: 0 + property ParallelAnimation anim: animationLeft + + opacity: items.progressBarOpacity anchors.left: parent.left anchors.leftMargin: parent.width / parent.implicitWidth * 62 + anchors.top: parent.top + anchors.topMargin: parent.height / parent.implicitHeight * 100 + width: ratio / 100 * parent.width / parent.implicitWidth * 200 + height: parent.height / parent.implicitHeight * 20 + ParallelAnimation { + id: animationLeft + onRunningChanged: { + if (!animationLeft.running) { + timerBonus.start() + } + } + PropertyAnimation + { + target: progressLeft + property: "ratio" + from: 0 + to: 100 + duration: items.duration + } + PropertyAnimation + { + target: progressLeft + property: "color" + from: "#00FF00" + to: "#FF0000" + duration: items.duration + } + } } - Progress { + Rectangle { id: progressRight + property int ratio: 0 + property ParallelAnimation anim: animationRight + + opacity: items.progressBarOpacity anchors.right: parent.right anchors.rightMargin: parent.width/parent.implicitWidth * 50 + anchors.top: parent.top + anchors.topMargin: parent.height/parent.implicitHeight * 100 + width: ratio / 100 * parent.width / parent.implicitWidth * 200 + height: parent.height / parent.implicitHeight * 20 + ParallelAnimation { + id: animationRight + onRunningChanged: { + if (!animationRight.running) { + timerBonus.start() + } + } + PropertyAnimation + { + target: progressRight + property: "ratio" + from: 0 + to: 100 + duration: items.duration + } + PropertyAnimation + { + target: progressRight + property: "color" + from: "#00FF00" + to: "#FF0000" + duration: items.duration + } + } } - Progress { + Rectangle { id: progressTop + property int ratio: 0 + property ParallelAnimation anim: animationTop + + opacity: items.progressBarOpacity + anchors.top: parent.top anchors.topMargin: parent.width / parent.implicitWidth * 40 anchors.horizontalCenter: parent.horizontalCenter width: parent.height / parent.implicitHeight * 20 height: ratio / 100 * parent.width / parent.implicitWidth * 100 + ParallelAnimation { + id: animationTop + onRunningChanged: { + if (!animationTop.running) { + timerBonus.start() + } + } + PropertyAnimation { + target: progressTop + property: "ratio" + from: 0 + to: 100 + duration: items.duration + } + PropertyAnimation { + target: progressTop + property: "color" + from: "#00FF00" + to: "#FF0000" + duration: items.duration + } + } } - /* The player */ Image { id: player source: Activity.url + "penalty_player.svg" fillMode: Image.PreserveAspectFit - anchors.centerIn: parent + anchors.verticalCenter: parent.verticalCenter sourceSize.width: 154 * ApplicationInfo.ratio + x: parent.width/2 - width/2 } /* The 2 click icon */ @@ -264,7 +431,10 @@ anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton onClicked: { - Activity.resetLevel() + ball.state = "INITIAL" + progressRight.ratio = 0 + progressLeft.ratio = 0 + progressTop.ratio = 0 } } } diff --git a/src/activities/penalty/Progress.qml b/src/activities/penalty/Progress.qml deleted file mode 100644 --- a/src/activities/penalty/Progress.qml +++ /dev/null @@ -1,51 +0,0 @@ -/* GCompris - Progress.qml -* -* Copyright (C) 2017 Rohit Das -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, see . -*/ -import QtQuick 2.6 - -Rectangle { - id: progress - property int ratio: 0 - property ParallelAnimation anim: animation - opacity: items.progressBarOpacity - anchors.top: parent.top - anchors.topMargin: parent.height / parent.implicitHeight * 100 - width: ratio / 100 * parent.width / parent.implicitWidth * 200 - height: parent.height / parent.implicitHeight * 20 - ParallelAnimation { - id: animation - onRunningChanged: { - if (!animation.running) { - timerBonus.start() - } - } - PropertyAnimation { - target: progress - property: "ratio" - from: 0 - to: 100 - duration: items.duration - } - PropertyAnimation { - target: progress - property: "color" - from: "#00FF00" - to: "#FF0000" - duration: items.duration - } - } -} diff --git a/src/activities/penalty/penalty.js b/src/activities/penalty/penalty.js --- a/src/activities/penalty/penalty.js +++ b/src/activities/penalty/penalty.js @@ -54,14 +54,13 @@ function resetLevel() { items.ball.state = "INITIAL" - items.saveBallState = "INITIAL" items.progressRight.ratio = 0 items.progressLeft.ratio = 0 items.progressTop.ratio = 0 } function nextLevel() { - if(numberOfLevel <= ++currentLevel) { + if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); diff --git a/src/activities/submarine/Controls.qml b/src/activities/submarine/Controls.qml --- a/src/activities/submarine/Controls.qml +++ b/src/activities/submarine/Controls.qml @@ -53,54 +53,44 @@ property point divingPlanePosition property int divingPlaneWidth property int divingPlaneHeight - - property int buttonSize - property int buttonPlusY - property int buttonMinusY - - property string fillColor : "#0DA5CB" - - Image { + + Rectangle { id: controlBackground - source: url + "board.svg" width: background.width height: background.height * 0.35 - sourceSize.width: width - sourceSize.height: height + + color: "grey" + y: background.height - height } Item { Rectangle { id: engine + x: enginePosition.x y: enginePosition.y + radius: 10 - color: "#323232" - border.width: 4 - border.color: "#AEC6DD" + + color: "black" + GCText { id: engineValues anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter } - color: "#D3E1EB" + + color: "green" } } Image { id: incSpeed - source: url + "up.svg" - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height + source: url + "up.png" - anchors { - right: engine.left - leftMargin: width / 2 - } - y: buttonPlusY + x: engine.x - width * 1.5 + y: engine.y - engine.height * 0.1 MouseArea { anchors.fill: parent @@ -112,18 +102,11 @@ Image { id: downSpeed - source: url + "down.svg" - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height - - anchors { - right: engine.left - leftMargin: width / 2 - } - y: buttonMinusY - + source: url + "down.png" + + x: engine.x - width * 1.5 + y: engine.y + engine.height * 0.9 + MouseArea { anchors.fill: parent enabled: !tutorial.visible @@ -142,22 +125,19 @@ x: leftBallastTankPosition.x y: leftBallastTankPosition.y - radius: 2 + radius: 10 - color: "#323232" - border.width: 4 - border.color: "#AEC6DD" + color: "black" Rectangle { - width: leftBallastTankWidth * 0.85 - height: (leftBallastTank.waterLevel / leftBallastTank.maxWaterLevel) * (leftBallastTankHeight - 8) + width: leftBallastTankWidth * 0.9 + height: (leftBallastTank.waterLevel / leftBallastTank.maxWaterLevel) * leftBallastTankHeight anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter - margins: 4 } - color: fillColor + color: "green" Behavior on height { NumberAnimation { @@ -170,13 +150,13 @@ id: leftBallastTankLabel text: qsTr("Left Ballast Tank") - width: parent.width - 8 + width: parent.width wrapMode: Text.WordWrap anchors.centerIn: parent horizontalAlignment: Text.AlignHCenter fontSize: 8 - color: "#B8D3E1EB" + color: "white" } } @@ -184,56 +164,21 @@ id: leftBallastFill source: url + "vanne.svg" - x: leftBallastTankDisplay.x - width * 1.1 - y: buttonPlusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height + x: leftBallastTankDisplay.x - width * 1.5 + y: leftBallastTankDisplay.y - leftBallastTankDisplay.height * 0.1 transform: Rotation { - id: rotateLeftFill; + id: rotateLeftTank; origin.x: leftBallastFill.width / 2; origin.y: leftBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 + axis { x: 0; y: 0; z: 1 } angle: leftBallastTank.waterFilling ? 90 : 0 } - SequentialAnimation { - id: leftFillAnim1 - loops: 1 - PropertyAnimation { - target: rotateLeftFill - properties: "angle" - from: 0 - to: 90 - duration: 200 - } - } - - SequentialAnimation { - id: leftFillAnim2 - loops: 1 - PropertyAnimation { - target: rotateLeftFill - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - leftBallastTank.fillBallastTanks() - if (leftBallastTank.waterFilling) { - leftFillAnim1.start() - } else { - leftFillAnim2.start() - } - } + onClicked: leftBallastTank.fillBallastTanks() } } @@ -241,56 +186,21 @@ id: leftBallastFlush source: url + "vanne.svg" - x: leftBallastTankDisplay.x - width * 1.1 - y: buttonMinusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height + x: leftBallastTankDisplay.x - width * 1.5 + y: leftBallastTankDisplay.y + leftBallastTankDisplay.height * 0.9 transform: Rotation { - id: rotateLeftFlush; + id: rotateLeftTankFlush; origin.x: leftBallastFill.width / 2; origin.y: leftBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 - } - - SequentialAnimation { - id: leftFlushAnim1 - loops: 1 - PropertyAnimation { - target: rotateLeftFlush - properties: "angle" - from: 0 - to: 90 - duration: 200 - } + axis { x: 0; y: 0; z: 1 } angle: leftBallastTank.waterFlushing ? 90 : 0 } - SequentialAnimation { - id: leftFlushAnim2 - loops: 1 - PropertyAnimation { - target: rotateLeftFlush - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - leftBallastTank.flushBallastTanks() - if (leftBallastTank.waterFlushing) { - leftFlushAnim1.start() - } else { - leftFlushAnim2.start() - } - } + onClicked: leftBallastTank.flushBallastTanks() } } } @@ -304,22 +214,19 @@ x: centralBallastTankPosition.x y: centralBallastTankPosition.y - radius: 2 + radius: 10 - color: "#323232" - border.width: 4 - border.color: "#AEC6DD" + color: "black" Rectangle { - width: centralBallastTankWidth * 0.85 - height: (centralBallastTank.waterLevel / centralBallastTank.maxWaterLevel) * (centralBallastTankHeight - 8) + width: centralBallastTankWidth * 0.9 + height: (centralBallastTank.waterLevel / centralBallastTank.maxWaterLevel) * centralBallastTankHeight anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter - margins: 4 } - color: fillColor + color: "green" Behavior on height { NumberAnimation { @@ -332,13 +239,13 @@ id: centralBallastTankLabel text: qsTr("Central Ballast Tank") - width: parent.width - 10 + width: parent.width wrapMode: Text.WordWrap anchors.centerIn: parent horizontalAlignment: Text.AlignHCenter fontSize: 8 - color: "#B8D3E1EB" + color: "white" } } @@ -346,57 +253,21 @@ id: centralBallastFill source: url + "vanne.svg" - x: centralBallastTankDisplay.x - width * 1.1 - y: buttonPlusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height - + x: centralBallastTankDisplay.x - width * 1.5 + y: centralBallastTankDisplay.y - centralBallastTankDisplay.height * 0.1 transform: Rotation { - id: rotateCentralFill; + id: rotateCentralTank; origin.x: centralBallastFill.width / 2; origin.y: centralBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 + axis { x: 0; y: 0; z: 1 } angle: centralBallastTank.waterFilling ? 90 : 0 } - SequentialAnimation { - id: centralFillAnim1 - loops: 1 - PropertyAnimation { - target: rotateCentralFill - properties: "angle" - from: 0 - to: 90 - duration: 200 - } - } - - SequentialAnimation { - id: centralFillAnim2 - loops: 1 - PropertyAnimation { - target: rotateCentralFill - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - centralBallastTank.fillBallastTanks() - if (centralBallastTank.waterFilling) { - centralFillAnim1.start() - } else { - centralFillAnim2.start() - } - } + onClicked: centralBallastTank.fillBallastTanks() } } @@ -404,57 +275,21 @@ id: centralBallastFlush source: url + "vanne.svg" - x: centralBallastTankDisplay.x - width * 1.1 - y: buttonMinusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height - + x: centralBallastTankDisplay.x - width * 1.5 + y: centralBallastTankDisplay.y + centralBallastTankDisplay.height * 0.9 transform: Rotation { - id: rotateCentralFlush; + id: rotateCentralTankFlush; origin.x: centralBallastFill.width / 2; origin.y: centralBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 - } - - SequentialAnimation { - id: centralFlushAnim1 - loops: 1 - PropertyAnimation { - target: rotateCentralFlush - properties: "angle" - from: 0 - to: 90 - duration: 200 - } + axis { x: 0; y: 0; z: 1 } angle:centralBallastTank.waterFlushing ? 90 : 0 } - SequentialAnimation { - id: centralFlushAnim2 - loops: 1 - PropertyAnimation { - target: rotateCentralFlush - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - centralBallastTank.flushBallastTanks() - if (centralBallastTank.waterFlushing) { - centralFlushAnim1.start() - } else { - centralFlushAnim2.start() - } - } + onClicked: centralBallastTank.flushBallastTanks() } } } @@ -467,22 +302,19 @@ x: rightBallastTankPosition.x y: rightBallastTankPosition.y - radius: 2 + radius: 10 - color: "#323232" - border.width: 4 - border.color: "#AEC6DD" + color: "black" Rectangle { - width: rightBallastTankWidth * 0.85 - height: (rightBallastTank.waterLevel / rightBallastTank.maxWaterLevel) * (rightBallastTankHeight - 8) + width: rightBallastTankWidth * 0.9 + height: (rightBallastTank.waterLevel / rightBallastTank.maxWaterLevel) * rightBallastTankHeight anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter - margins: 4 } - color: fillColor + color: "green" Behavior on height { NumberAnimation { @@ -495,13 +327,13 @@ id: rightBallastTankLabel text: qsTr("Right Ballast Tank") - width: parent.width - 8 + width: parent.width wrapMode: Text.WordWrap anchors.centerIn: parent horizontalAlignment: Text.AlignHCenter fontSize: 8 - color: "#B8D3E1EB" + color: "white" } } @@ -509,57 +341,21 @@ id: rightBallastFill source: url + "vanne.svg" - x: rightBallastTankDisplay.x - width * 1.1 - y: buttonPlusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height - + x: rightBallastTankDisplay.x - width * 1.5 + y: rightBallastTankDisplay.y - rightBallastTankDisplay.height * 0.1 transform: Rotation { - id: rotateRightFill; + id: rotateRightTank; origin.x: rightBallastFill.width / 2; origin.y: rightBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 - } - - SequentialAnimation { - id: rightFillAnim1 - loops: 1 - PropertyAnimation { - target: rotateRightFill - properties: "angle" - from: 0 - to: 90 - duration: 200 - } + axis { x: 0; y: 0; z: 1 } angle: rightBallastTank.waterFilling ? 90 : 0 } - SequentialAnimation { - id: rightFillAnim2 - loops: 1 - PropertyAnimation { - target: rotateRightFill - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - rightBallastTank.fillBallastTanks() - if (rightBallastTank.waterFilling) { - rightFillAnim1.start() - } else { - rightFillAnim2.start() - } - } + onClicked: rightBallastTank.fillBallastTanks() } } @@ -567,57 +363,21 @@ id: rightBallastFlush source: url + "vanne.svg" - x: rightBallastTankDisplay.x - width * 1.1 - y: buttonMinusY - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height - + x: rightBallastTankDisplay.x - width * 1.5 + y: rightBallastTankDisplay.y + rightBallastTankDisplay.height * 0.9 transform: Rotation { - id: rotateRightFlush; + id: rotateRightTankFlush; origin.x: rightBallastFill.width / 2; origin.y: rightBallastFill.height / 2 - axis { x: 0; y: 0; z: 1 } angle: 0 - } - - SequentialAnimation { - id: rightFlushAnim1 - loops: 1 - PropertyAnimation { - target: rotateRightFlush - properties: "angle" - from: 0 - to: 90 - duration: 200 - } + axis { x: 0; y: 0; z: 1 } angle: rightBallastTank.waterFlushing ? 90 : 0 } - SequentialAnimation { - id: rightFlushAnim2 - loops: 1 - PropertyAnimation { - target: rotateRightFlush - properties: "angle" - from: 90 - to: 0 - duration: 200 - } - } - MouseArea { anchors.fill: parent enabled: !tutorial.visible - onClicked: { - rightBallastTank.flushBallastTanks() - if (rightBallastTank.waterFlushing) { - rightFlushAnim1.start() - } else { - rightFlushAnim2.start() - } - } + onClicked: rightBallastTank.flushBallastTanks() } } } @@ -630,12 +390,11 @@ Image { id: divingPlanesImage - source: url + "rudder.svg" + source: url + "rudder.png" + width: divingPlaneWidth height: divingPlaneHeight - sourceSize.width: width - sourceSize.height: height - + x: divingPlanePosition.x y: divingPlanePosition.y @@ -649,17 +408,12 @@ Image { id: divingPlanesRotateUp - source: url + "up.svg" - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height + source: url + "up.png" anchors { left: divingPlanesImage.right -// bottom: divingPlanesImage.top + bottom: divingPlanesImage.top } - y: buttonPlusY MouseArea { anchors.fill: parent @@ -671,17 +425,12 @@ Image { id: divingPlanesRotateDown - source: url + "down.svg" - width: buttonSize - height: buttonSize - sourceSize.width: width - sourceSize.height: height + source: url + "down.png" anchors { left: divingPlanesImage.right -// top: divingPlanesImage.bottom + top: divingPlanesImage.bottom } - y: buttonMinusY MouseArea { anchors.fill: parent diff --git a/src/activities/submarine/Submarine.qml b/src/activities/submarine/Submarine.qml --- a/src/activities/submarine/Submarine.qml +++ b/src/activities/submarine/Submarine.qml @@ -119,7 +119,7 @@ id: tutorial anchors { top: parent.top - topMargin: background.height / 6 + topMargin: 10 right: parent.right rightMargin: 5 left: parent.left @@ -541,14 +541,13 @@ id: upperGate visible: (bar.level > 1) ? true : false width: background.width / 18 - height: isGateOpen ? background.height * (5 / 36) : background.height * (5 / 12) + 4 + height: isGateOpen ? background.height * (5 / 36) : background.height * (5 / 12) y: -2 - z: 2 - color: "#9E948A" - border.color: "#766C62" - border.width: 2 + z: 1 + color: "#848484" + border.color: "black" + border.width: 3 anchors.right: background.right - anchors.rightMargin: -2 property bool isGateOpen: false @@ -586,11 +585,10 @@ width: background.width / 18 height: background.height * (5 / 12) - subSchemaImage.height / 1.4 y: background.height * (5 / 12) - color: "#9E948A" - border.color: "#766C62" - border.width: 2 + color: "#848484" + border.color: "black" + border.width: 3 anchors.right:background.right - anchors.rightMargin: -2 Body { id: lowerGateBody @@ -613,24 +611,27 @@ } } - Rectangle { - id: subSchemaImage - width: background.width/1.3 - height: background.height/4 - x: background.width/9 - y: background.height/1.5 - visible: false + Item { + id: subSchemaItems + + Image { + id: subSchemaImage + source: url + "sub_schema.svg" + width: background.width/1.3 + height: background.height/4 + x: background.width/9 + y: background.height/1.5 + } } Image { id: crown width: submarineImage.width * 0.85 - height: width * 0.5 - sourceSize.width: width - sourceSize.height: height + height: width * 0.55 + visible: ((bar.level > 2) && !isCaptured) ? true : false - source: url + "crown.svg" + source: url + "crown.png" property bool isCaptured: false @@ -690,7 +691,7 @@ fillMode: Image.PreserveAspectFit visible: (bar.level > 3) ? true : false - source: collided ? url + "boat-hit.svg" : url + "boat.svg" + source: url + "boat.svg" x: initialXPosition z: 1 @@ -780,7 +781,6 @@ id: rock2 width: background.width / 6 height: width * 0.48 - z: 5 visible: (bar.level > 4) ? true : false anchors.bottom: crown.bottom @@ -832,7 +832,6 @@ id: rock1 width: rock2.width height: width * 0.46 - z: 5 visible: (bar.level > 6) ? true : false anchors.bottom: crown.bottom anchors.right: space.left @@ -870,20 +869,6 @@ } } - Image { - id: rock3 - width: background.width - height: background.height * 0.25 - sourceSize.width: width - sourceSize.height: height - - visible: (bar.level > 2) ? true : false - anchors.top: crown.top - anchors.horizontalCenter: crown.left -// anchors.topMargin: height * 0.5 - source: url + "rocks.svg" - } - Timer { /* * A delay is used since on setting fullscreen on/off @@ -902,39 +887,35 @@ Controls { id: controls - z: 10 enginePosition.x: background.width * 0.2 - enginePosition.y: background.height - bar.height - (engineHeight * 1.6) + enginePosition.y: background.height - bar.height - (engineHeight * 1.25) engineWidth: background.width / 8 engineHeight: 100 submarineHorizontalSpeed: submarine.currentFinalVelocity * 1000 leftTankVisible: bar.level >= 7 ? true : false leftBallastTankPosition.x: background.width * 0.4 - leftBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) + leftBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) leftBallastTankWidth: background.width / 8 - leftBallastTankHeight: 120 + leftBallastTankHeight: 100 centralTankVisible: bar.level < 7 ? true : false centralBallastTankPosition.x: background.width * 0.5 - centralBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) + centralBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) centralBallastTankWidth: background.width / 8 - centralBallastTankHeight: 120 + centralBallastTankHeight: 100 rightTankVisible: bar.level >= 7 ? true : false rightBallastTankPosition.x: background.width * 0.6 - rightBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) + rightBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) rightBallastTankWidth: background.width / 8 - rightBallastTankHeight: 120 + rightBallastTankHeight: 100 divingPlaneVisible: true divingPlanePosition.x: background.width * 0.8 - divingPlanePosition.y: enginePosition.y + (engineHeight * 0.5) - (divingPlaneHeight * 0.5) - divingPlaneWidth: background.width * 0.1 - divingPlaneHeight: divingPlaneWidth * 0.33 - buttonSize: subSchemaImage.height * 0.2 - buttonPlusY: enginePosition.y - (buttonSize * 0.5) - buttonMinusY: enginePosition.y + engineHeight - (buttonSize * 0.5) + divingPlanePosition.y: background.height - bar.height - engineHeight + divingPlaneWidth: background.width / 8 + divingPlaneHeight: divingPlaneWidth * 0.2 } DialogHelp { diff --git a/src/activities/submarine/resource/README b/src/activities/submarine/resource/README deleted file mode 100644 --- a/src/activities/submarine/resource/README +++ /dev/null @@ -1,17 +0,0 @@ -Copyright: Timothée Giet, 2017 -License: CC-BY-SA 4.0 -Files: -background.svg -board.svg -boat-hit.svg -boat.svg -crown.svg -down.svg -rocks.svg -rudder.svg -submarine-broken.svg -submarine.svg -up.svg -vanne.svg -whale-hit.svg -whale.svg diff --git a/src/activities/submarine/resource/alert_submarine.png b/src/activities/submarine/resource/alert_submarine.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ + gradientTransform="matrix(3.7795276,0,0,3.0347893,0,-381.33227)" /> + gradientTransform="matrix(-4.3549795,0,0,3.0347893,851.51199,-381.33225)" /> image/svg+xml - + 2017 @@ -233,16 +233,16 @@ x="3.1789145e-07" y="168.71063" /> + transform="matrix(0.26458333,0,0,0.26458333,0,159.41665)" /> + sodipodi:nodetypes="ccscssccccccccccccccscccscccccccccccssssscccsc" + transform="matrix(0.26458333,0,0,0.26458333,0,159.41665)" /> diff --git a/src/activities/submarine/resource/board.svg b/src/activities/submarine/resource/board.svg deleted file mode 100644 --- a/src/activities/submarine/resource/board.svg +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/boat-hit.svg b/src/activities/submarine/resource/boat-hit.svg deleted file mode 100644 --- a/src/activities/submarine/resource/boat-hit.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/boat.svg b/src/activities/submarine/resource/boat.svg --- a/src/activities/submarine/resource/boat.svg +++ b/src/activities/submarine/resource/boat.svg @@ -7,6 +7,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="120" @@ -25,8 +26,8 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="2.8" - inkscape:cx="19.464284" + inkscape:zoom="5.6" + inkscape:cx="59.999998" inkscape:cy="10.878827" inkscape:document-units="mm" inkscape:current-layer="layer2" @@ -50,7 +51,7 @@ image/svg+xml - + 2017 @@ -150,4 +151,21 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="cssscc" /> + diff --git a/src/activities/submarine/resource/bubbling.png b/src/activities/submarine/resource/bubbling.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/down.png b/src/activities/submarine/resource/down.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/rocks.svg b/src/activities/submarine/resource/rocks.svg deleted file mode 100644 --- a/src/activities/submarine/resource/rocks.svg +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/rudder.png b/src/activities/submarine/resource/rudder.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/sub_schema.svg b/src/activities/submarine/resource/sub_schema.svg new file mode 100644 --- /dev/null +++ b/src/activities/submarine/resource/sub_schema.svg @@ -0,0 +1,2224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/submarine/resource/up.png b/src/activities/submarine/resource/up.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - - - - - - - - image/svg+xml - - - 2017 - - - Timothée Giet - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/submarine/resource/vanne.svg b/src/activities/submarine/resource/vanne.svg --- a/src/activities/submarine/resource/vanne.svg +++ b/src/activities/submarine/resource/vanne.svg @@ -9,15 +9,14 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="22" - height="22" - viewBox="0 0 5.8208332 5.8208335" + width="21.70813" + height="23.708111" + id="svg3398" version="1.1" - id="svg1525" - inkscape:version="0.92.1 r15371" - sodipodi:docname="vanne.svg"> + inkscape:version="0.48.0 r9654" + sodipodi:docname="Nouveau document 2"> + id="defs3400" /> - - + inkscape:window-y="24" + inkscape:window-maximized="1" /> + id="metadata3403"> image/svg+xml - - 2017 - - - Timothée Giet - - - + - - - - - - - - + transform="translate(-832.37075,-684.67175)"> + style="color:#000000;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:#070800;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" + d="m 853.57888,695.27328 -20.70813,0 c 0,-5.57892 4.63567,-10.10153 10.35407,-10.10153 5.71839,0 10.35406,4.52261 10.35406,10.10153 z" + id="path3791" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccsc" /> + style="color:#000000;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:#070800;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" + d="m 832.87075,697.77833 20.70813,0 c 0,5.57892 -4.63567,10.10153 -10.35407,10.10153 -5.71839,0 -10.35406,-4.52261 -10.35406,-10.10153 z" + id="path3791-5" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccsc" /> diff --git a/src/activities/submarine/submarine.svg b/src/activities/submarine/submarine.svg --- a/src/activities/submarine/submarine.svg +++ b/src/activities/submarine/submarine.svg @@ -1,46 +1,97 @@ - + id="defs2887"> + + + + + + + + + + + + + inkscape:guide-bbox="true" /> @@ -49,132 +100,112 @@ image/svg+xml - - 2017 - - - Timothée Giet - - - - - - - - - - - + + + + id="g16966" + transform="translate(26.60493,54.978)"> + id="path2929" + d="M -9.2028708,-8.294245 L -13.349929,-8.508266 L -14.386694,-11.290529 L -19.916105,-11.718569 C -19.916105,-11.718569 -21.298456,-3.79982 -20.952868,-2.515699 C -20.60728,-1.231577 -20.261693,7.757273 -20.261693,7.757273 L -20.952868,13.107779 L -15.423457,12.893759 L -14.732282,9.041395 L -9.5484586,7.115212 L -9.2028708,-8.294245 z " + style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - - - - - - - - - + sodipodi:nodetypes="ccccscccccc" + id="path16964" + d="M -12.07497,-6.2499828 L -15.46472,-6.6318988 L -15.937622,-8.8145364 L -18.459765,-9.150326 C -18.459765,-9.150326 -18.020199,-2.7241839 -17.862565,-1.7168131 C -17.704932,-0.70944163 -17.975338,6.5561764 -17.975338,6.5561764 L -18.718646,9.469435 L -17.266604,9.30154 L -16.095256,7.1355075 L -12.018584,4.554349 L -12.07497,-6.2499828 z " + style="fill:#fc0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - - - + + + + + + + + + + + + + + + diff --git a/src/core/Score.qml b/src/core/Score.qml --- a/src/core/Score.qml +++ b/src/core/Score.qml @@ -68,13 +68,6 @@ */ property string message - /** - * Emitted when the win animation should be started. - * - * Triggers scale and rotation animation. - */ - signal playWinAnimation - color: "#AAFFFFFF" width: subLevelText.width * 2 height: subLevelText.height * 1.4 @@ -90,7 +83,6 @@ onCurrentSubLevelChanged: message = currentSubLevel + "/" + numberOfSubLevels onNumberOfSubLevelsChanged: message = currentSubLevel + "/" + numberOfSubLevels - onPlayWinAnimation: winAnimation.start() GCText { id: subLevelText @@ -100,40 +92,4 @@ color: "#373737" text: message } - - SequentialAnimation { - id: winAnimation - ParallelAnimation { - PropertyAnimation { - target: score - properties: "scale" - from: 1.0 - to: 1.4 - duration: 500 - } - NumberAnimation { - target: score - property: "rotation" - from: -10; to: 10 - duration: 750 - easing.type: Easing.InOutQuad - } - } - ParallelAnimation { - PropertyAnimation { - target: score - properties: "scale" - from: 1.4 - to: 1.0 - duration: 500 - } - NumberAnimation { - target: score - property: "rotation" - from: 10; to: 0 - duration: 750 - easing.type: Easing.InOutQuad - } - } - } }