forked from Shinonome/dots-hyprland
add new date style and bunch of new animations
This commit is contained in:
@@ -8,6 +8,7 @@ Item {
|
||||
id: root
|
||||
|
||||
property int sides: 12
|
||||
property real animatedSides: 12
|
||||
property int implicitSize: 100
|
||||
property real amplitude: implicitSize / 50
|
||||
property int renderPoints: 360
|
||||
@@ -32,6 +33,13 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
onSidesChanged: NumberAnimation {
|
||||
target: root
|
||||
property: "animatedSides"
|
||||
to: root.sides
|
||||
duration: 100
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
|
||||
Shape {
|
||||
id: shape
|
||||
@@ -53,7 +61,7 @@ Item {
|
||||
var radius = root.implicitSize / 2 - root.amplitude
|
||||
for (var i = 0; i <= steps; i++) {
|
||||
var angle = (i / steps) * 2 * Math.PI
|
||||
var wave = waveAnimation ? Math.sin(angle * root.sides + Math.PI/2 - root.waveTime) * root.amplitude : Math.sin(angle * root.sides + Math.PI/2) * root.amplitude
|
||||
var wave = waveAnimation ? Math.sin(angle * root.animatedSides + Math.PI/2 - root.waveTime) * root.amplitude : Math.sin(angle * root.animatedSides + Math.PI/2) * root.amplitude
|
||||
var x = Math.cos(angle) * (radius + wave) + cx
|
||||
var y = Math.sin(angle) * (radius + wave) + cy
|
||||
points.push(Qt.point(x, y))
|
||||
|
||||
Reference in New Issue
Block a user