Warning, /education/gcompris/src/core/SwingAnimation.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - SwingAnimation.qml
0002  *
0003  * Copyright (C) 2023 Bruno ANSELME <be.root@free.fr>
0004  *
0005  * Authors:
0006  *   Bruno ANSELME <be.root@free.fr> (Qt Quick native)
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 import QtQuick 2.12
0011 
0012 SequentialAnimation {
0013     id: swing
0014     property int amplitude: 10
0015     property int duration: 800
0016     property var target: undefined
0017     running: false
0018     loops: Animation.Infinite
0019     alwaysRunToEnd: true
0020     NumberAnimation {
0021         target: swing.target
0022         property: "rotation"
0023         from: 0; to: amplitude
0024         duration: swing.duration / 4
0025         easing.type: Easing.OutQuad
0026     }
0027     NumberAnimation {
0028         target: swing.target
0029         property: "rotation"
0030         from: amplitude; to: -amplitude
0031         duration: swing.duration / 2
0032         easing.type: Easing.InOutQuad
0033     }
0034     NumberAnimation {
0035         target: swing.target
0036         property: "rotation"
0037         from: -amplitude; to: 0
0038         duration: swing.duration / 4
0039         easing.type: Easing.InQuad
0040     }
0041 }