diff options
| -rw-r--r-- | desktop/companion/Companion.qml | 1 | ||||
| -rw-r--r-- | desktop/companion/Figure.qml | 18 |
2 files changed, 16 insertions, 3 deletions
diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml index 51dfea9..b9ae9fb 100644 --- a/desktop/companion/Companion.qml +++ b/desktop/companion/Companion.qml @@ -391,6 +391,7 @@ PanelWindow { source: `file://${root.art}/${root.outfit}/${root.mood.frame}.png` fallback: `file://${root.art}/${root.outfit}/base.png` out: root.away + trembling: root.mood.state === "admire" && root.mood.frame === "blush3" onSettled: out => root.settled(out) } diff --git a/desktop/companion/Figure.qml b/desktop/companion/Figure.qml index 0b3b671..3401168 100644 --- a/desktop/companion/Figure.qml +++ b/desktop/companion/Figure.qml @@ -13,8 +13,8 @@ import QtQuick import ".." // One frame of the companion, drawn at half its pixel size and standing on -// its bottom edge: a crossfade between frames, a slow bob, the drop out of -// view and back, and the self-destruct flash. Which frame is Mood.js's +// its bottom edge: a crossfade between frames, a slow bob, a tremble, the +// drop out of view and back, and the self-destruct flash. Which frame is Mood.js's // business; this only draws it. Item { id: s @@ -65,6 +65,18 @@ Item { dropAnim.easing.type = s.out ? Easing.InCubic : Easing.OutBack; dropAnim.start(); } + // A quick side to side shiver, for the wallpaper blush. Stopping can + // leave it mid-swing, so it is put back to rest. + property bool trembling: false + property real shake: 0 + onTremblingChanged: if (!s.trembling) s.shake = 0 + SequentialAnimation on shake { + running: s.trembling && !s.out + loops: Animation.Infinite + NumberAnimation { to: 1.5; duration: 40 } + NumberAnimation { to: -1.5; duration: 80 } + NumberAnimation { to: 0; duration: 40 } + } SequentialAnimation on bob { running: !s.out loops: Animation.Infinite @@ -75,7 +87,7 @@ Item { Item { anchors.fill: parent opacity: 1 - s.drop / (s.height + 24) - transform: Translate { y: s.drop - s.bob } + transform: Translate { x: s.shake; y: s.drop - s.bob } Image { id: a |
