43 lines
1022 B
QML
Executable File
43 lines
1022 B
QML
Executable File
import QtQuick
|
|
import Quickshell
|
|
|
|
ShaderEffect {
|
|
id: root
|
|
|
|
property Item target: parent
|
|
|
|
property real glowSize: 40
|
|
property real innerGlow: 0
|
|
property real lineWidth: 2
|
|
property real intensity: 1.0
|
|
property real speed: 1.0
|
|
property int period: 6000
|
|
property bool running: true
|
|
|
|
property color color1: "#4285F4"
|
|
property color color2: "#9B72CB"
|
|
property color color3: "#D96570"
|
|
property color color4: "#F2A54A"
|
|
|
|
readonly property size itemSize: Qt.size(width, height)
|
|
readonly property size rectSize: target ? Qt.size(target.width, target.height) : Qt.size(0, 0)
|
|
readonly property real radius: (target as Rectangle).radius ?? 0
|
|
property real phase: 0
|
|
|
|
anchors.fill: target
|
|
anchors.margins: -glowSize
|
|
z: -1
|
|
|
|
enabled: false
|
|
|
|
fragmentShader: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/shaders/geminiglow.frag.qsb`)
|
|
|
|
FrameAnimation {
|
|
running: root.running && root.visible
|
|
onTriggered: {
|
|
const dt = frameTime * 1000;
|
|
root.phase = (root.phase + dt * root.speed / root.period) % 1.0;
|
|
}
|
|
}
|
|
}
|