nheko/resources/qml/ui/animations/BlinkAnimation.qml

34 lines
693 B
QML
Raw Normal View History

2021-07-09 04:39:27 +02:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
2021-07-09 04:39:27 +02:00
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtGraphicalEffects 1.12
2021-07-10 17:21:15 +02:00
import QtQuick 2.12
2021-07-09 04:39:27 +02:00
SequentialAnimation {
property alias target: numberAnimation.target
property alias glowDuration: numberAnimation.duration
2021-07-10 17:21:15 +02:00
property int pauseDuration: 150
property double offset: 0
2021-07-09 04:39:27 +02:00
loops: Animation.Infinite
2021-07-10 17:21:15 +02:00
PauseAnimation {
duration: pauseDuration * offset
}
2021-07-09 04:39:27 +02:00
NumberAnimation {
id: numberAnimation
2021-07-10 17:21:15 +02:00
2021-07-09 04:39:27 +02:00
property: "opacity"
from: 0
to: 1
}
PauseAnimation {
2021-07-10 17:21:15 +02:00
duration: pauseDuration * (1 - offset)
2021-07-09 04:39:27 +02:00
}
2021-07-10 17:21:15 +02:00
}