From 5ac925bf52966a75dee3f0e6b621e92b63872cf7 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Fri, 2 Sep 2022 20:31:46 +0200 Subject: [PATCH] :tada: Port new effects to KWin --- kwin/build.sh | 20 +++--- kwin/pixel-wheel/config.ui | 90 +++++++++++++++++++++++++++ kwin/pixel-wheel/main.xml | 16 +++++ kwin/pixel-wheel/onSettingsChanged.js | 6 ++ kwin/pixel-wipe/config.ui | 67 ++++++++++++++++++++ kwin/pixel-wipe/main.xml | 13 ++++ kwin/pixel-wipe/onAnimationBegin.js | 9 +++ kwin/pixel-wipe/onSettingsChanged.js | 5 ++ 8 files changed, 217 insertions(+), 9 deletions(-) create mode 100755 kwin/pixel-wheel/config.ui create mode 100755 kwin/pixel-wheel/main.xml create mode 100644 kwin/pixel-wheel/onSettingsChanged.js create mode 100755 kwin/pixel-wipe/config.ui create mode 100755 kwin/pixel-wipe/main.xml create mode 100644 kwin/pixel-wipe/onAnimationBegin.js create mode 100644 kwin/pixel-wipe/onSettingsChanged.js diff --git a/kwin/build.sh b/kwin/build.sh index e7678f7..e12c9ab 100755 --- a/kwin/build.sh +++ b/kwin/build.sh @@ -128,15 +128,17 @@ generate() { # window canvas during the animation. #generate "apparition" "[BMW] Apparition" "This effect hides your windows by violently sucking them into the void of magic" -generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away" -generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect" -generate "doom" "Doom [Burn-My-Windows]" "Melt your windows" -generate "fire" "Fire [Burn-My-Windows]" "The classic effect inspired by Compiz" -generate "hexagon" "Hexagon [Burn-My-Windows]" "With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi" -generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but definitely more fancy take on the fire effect" -generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels" -generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV" -generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies" +generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away" +generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect" +generate "doom" "Doom [Burn-My-Windows]" "Melt your windows" +generate "fire" "Fire [Burn-My-Windows]" "The classic effect inspired by Compiz" +generate "hexagon" "Hexagon [Burn-My-Windows]" "With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi" +generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but definitely more fancy take on the fire effect" +generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels" +generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and hide the pixels in a wheel-like fashion" +generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position" +generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV" +generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies" # Finally, create an archive for the effects. # shellcheck disable=SC2046 diff --git a/kwin/pixel-wheel/config.ui b/kwin/pixel-wheel/config.ui new file mode 100755 index 0000000..5daa327 --- /dev/null +++ b/kwin/pixel-wheel/config.ui @@ -0,0 +1,90 @@ + + + BMWConfigForm + + + + 0 + 0 + 562 + 365 + + + + + + + Duration: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Pixel Size + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + milliseconds + + + 100 + + + 9999 + + + 100 + + + + + + + Spoke Count + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0 + + + 1.000000000000000 + + + 50.000000000000000 + + + + + + + 0 + + + 1.000000000000000 + + + 50.000000000000000 + + + + + + + + \ No newline at end of file diff --git a/kwin/pixel-wheel/main.xml b/kwin/pixel-wheel/main.xml new file mode 100755 index 0000000..d048ffc --- /dev/null +++ b/kwin/pixel-wheel/main.xml @@ -0,0 +1,16 @@ + + + + + + 300 + + + 12 + + + 10 + + + \ No newline at end of file diff --git a/kwin/pixel-wheel/onSettingsChanged.js b/kwin/pixel-wheel/onSettingsChanged.js new file mode 100644 index 0000000..0d66dc2 --- /dev/null +++ b/kwin/pixel-wheel/onSettingsChanged.js @@ -0,0 +1,6 @@ +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever the user changes something in the configuration of +// the effect. + +effect.setUniform(this.shader, 'uSpokeCount', effect.readConfig('SpokeCount', 1.0)); +effect.setUniform(this.shader, 'uPixelSize', effect.readConfig('PixelSize', 1.0)); diff --git a/kwin/pixel-wipe/config.ui b/kwin/pixel-wipe/config.ui new file mode 100755 index 0000000..0833c60 --- /dev/null +++ b/kwin/pixel-wipe/config.ui @@ -0,0 +1,67 @@ + + + BMWConfigForm + + + + 0 + 0 + 562 + 365 + + + + + + + Duration: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Pixel Size + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + milliseconds + + + 100 + + + 9999 + + + 100 + + + + + + + 0 + + + 1.000000000000000 + + + 50.000000000000000 + + + + + + + + \ No newline at end of file diff --git a/kwin/pixel-wipe/main.xml b/kwin/pixel-wipe/main.xml new file mode 100755 index 0000000..4f31d34 --- /dev/null +++ b/kwin/pixel-wipe/main.xml @@ -0,0 +1,13 @@ + + + + + + 1000 + + + 10 + + + \ No newline at end of file diff --git a/kwin/pixel-wipe/onAnimationBegin.js b/kwin/pixel-wipe/onAnimationBegin.js new file mode 100644 index 0000000..51f3f81 --- /dev/null +++ b/kwin/pixel-wipe/onAnimationBegin.js @@ -0,0 +1,9 @@ +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever a window is closed or opened. + +let startPos = [ + (effects.cursorPos.x - window.x) / window.width, + (effects.cursorPos.y - window.y) / window.height +]; + +effect.setUniform(this.shader, 'uStartPos', startPos); \ No newline at end of file diff --git a/kwin/pixel-wipe/onSettingsChanged.js b/kwin/pixel-wipe/onSettingsChanged.js new file mode 100644 index 0000000..03c5f03 --- /dev/null +++ b/kwin/pixel-wipe/onSettingsChanged.js @@ -0,0 +1,5 @@ +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever the user changes something in the configuration of +// the effect. + +effect.setUniform(this.shader, 'uPixelSize', effect.readConfig('PixelSize', 1.0));