20250105
This commit is contained in:
+2
-2
@@ -49,7 +49,7 @@ import TVGlitch from './src/effects/TVGlitch.js';
|
||||
import Wisps from './src/effects/Wisps.js';
|
||||
import Mushroom from './src/effects/Mushroom.js';
|
||||
|
||||
import SimpleFade from './src/effects/SimpleFade.js';
|
||||
import UnicornFart from './src/effects/UnicornFart.js';
|
||||
|
||||
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
@@ -83,7 +83,7 @@ export default class BurnMyWindows extends Extension {
|
||||
new Matrix(), new PaintBrush(), new Pixelate(), new PixelWheel(),
|
||||
new PixelWipe(), new Portal(), new RGBWarp(), new SnapOfDisintegration(),
|
||||
new TeamRocket(), new TRexAttack(), new TVEffect(), new TVGlitch(),
|
||||
new Wisps(), new Mushroom(), new SimpleFade(),
|
||||
new Wisps(), new Mushroom(), new UnicornFart(),
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ import TVEffect from './src/effects/TVEffect.js';
|
||||
import TVGlitch from './src/effects/TVGlitch.js';
|
||||
import Wisps from './src/effects/Wisps.js';
|
||||
|
||||
import SimpleFade from './src/effects/SimpleFade.js';
|
||||
import UnicornFart from './src/effects/UnicornFart.js';
|
||||
|
||||
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {
|
||||
Pixelate, PixelWheel, PixelWipe,
|
||||
Portal, RGBWarp, SnapOfDisintegration,
|
||||
TeamRocket, TRexAttack, TVEffect,
|
||||
TVGlitch, Wisps, SimpleFade,
|
||||
TVGlitch, Wisps, UnicornFart,
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -31,27 +31,60 @@
|
||||
// void setOutputColor(vec4 outColor)
|
||||
|
||||
// The width of the fading effect is loaded from the settings.
|
||||
// uniform float uFadeWidth;
|
||||
|
||||
uniform bool uParticles;
|
||||
uniform float uParticleSize;
|
||||
uniform float uParticleSpeed;
|
||||
uniform float uParticleColorRandom;
|
||||
uniform float uParticleColorSpeed;
|
||||
uniform float uSparkCount;
|
||||
uniform vec2 uSparkStartEnd;
|
||||
uniform float uSparkOffset;
|
||||
uniform float uStarCount;
|
||||
uniform float uStarRot;
|
||||
uniform float uStarSize;
|
||||
uniform vec2 uStarStartEnd;
|
||||
uniform float uBlurQuality;
|
||||
uniform float uSeed;
|
||||
|
||||
|
||||
//particle colors
|
||||
uniform vec4 uParticleColor0;
|
||||
uniform vec4 uParticleColor1;
|
||||
uniform vec4 uParticleColor2;
|
||||
uniform vec4 uParticleColor3;
|
||||
uniform vec4 uParticleColor4;
|
||||
uniform vec4 uParticleColor5;
|
||||
|
||||
//star colors
|
||||
uniform vec4 uStarColor0;
|
||||
uniform vec4 uStarColor1;
|
||||
uniform vec4 uStarColor2;
|
||||
uniform vec4 uStarColor3;
|
||||
uniform vec4 uStarColor4;
|
||||
uniform vec4 uStarColor5;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
bool uParticles = True;
|
||||
float uParticleSize = 100.0;
|
||||
float uParticleSpeed = 10.0;
|
||||
float uParticleColorRandom = 1.0;
|
||||
float uParticleColorSpeed = 1.0;
|
||||
|
||||
float uSparkCount = 50.0;
|
||||
vec2 uSparkStartEnd = vec2(0.1,0.75);
|
||||
float uSparkOffset = 0.25;
|
||||
|
||||
float uBlurQuality = 5.0;
|
||||
vec4 uSeed = vec4(1.0,0.1,0.5,1.0);
|
||||
|
||||
float uStarCount = 5.0;
|
||||
float uStarRot = 1.0;
|
||||
float uStarSize = 0.1;
|
||||
vec2 uStarStartEnd = vec2(0.0,0.66);
|
||||
|
||||
//pastel
|
||||
// vec4 uParticleColor0 = vec4(1.0, 0.8, 0.8, 1.0);
|
||||
// vec4 uParticleColor1 = vec4(1.0, 1.0, 0.8, 1.0);
|
||||
// vec4 uParticleColor2 = vec4(0.8, 1.0, 0.8, 1.0);
|
||||
// vec4 uParticleColor3 = vec4(0.8, 0.8, 1.0, 1.0);
|
||||
// vec4 uParticleColor4 = vec4(1.0, 0.8, 1.0, 1.0);
|
||||
// vec4 uParticleColor5 = vec4(0.8, 1.0, 1.0, 1.0);
|
||||
float uBlurQuality = 5.0;
|
||||
vec4 uSeed = vec4(1.0,0.1,0.5,1.0);
|
||||
|
||||
|
||||
//bold colors
|
||||
vec4 uParticleColor0 = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
@@ -68,7 +101,7 @@ vec4 uStarColor2 = vec4(0.0, 1.0, 0.0, 0.0);
|
||||
vec4 uStarColor3 = vec4(0.0, 0.0, 1.0, 0.0);
|
||||
vec4 uStarColor4 = vec4(1.0, 0.0, 1.0, 0.0);
|
||||
vec4 uStarColor5 = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -430,7 +463,7 @@ vec4 getStars(float t)
|
||||
for (float i = 0.0; i < uStarCount ; ++i)
|
||||
{
|
||||
|
||||
vec4 v4 = hash41( i * uSeed.x);
|
||||
vec4 v4 = hash41( i * uSeed);
|
||||
|
||||
//the X and Y position ... at the end
|
||||
vec3 pos = getPosByAngle( (i/uStarCount) * tau + (uStarRot * tau * t) );
|
||||
@@ -477,12 +510,11 @@ vec4 getParticles(float alpha)
|
||||
{
|
||||
vec2 uv = iTexCoord.st;
|
||||
|
||||
float particles = pow((simplex3D(vec3(uv * 50.0, 10.0 * uProgress ))), 3.0);
|
||||
float particles = pow((simplex3D(vec3(uv * uParticleSize, uParticleSpeed * uProgress ))), 3.0);
|
||||
|
||||
float pc = pow((simplex3D(vec3(uv * 50, 10.0 * uProgress ))), 1.0);
|
||||
float pc = simplex3D(vec3(uv * uParticleColorRandom, uParticleColorSpeed * uProgress ));
|
||||
vec4 particleColor = getParticleColors(pc,1.0);
|
||||
|
||||
|
||||
particles *= alpha;
|
||||
|
||||
return vec4(particleColor.rgb,particles);
|
||||
@@ -502,36 +534,36 @@ void main() {
|
||||
);
|
||||
ztomo = easeInOutSine(ztomo);
|
||||
|
||||
//out Expo
|
||||
float oExpo = easeOutExpo(progress);
|
||||
float iExpo = easeInExpo(progress);
|
||||
//progress variants
|
||||
// float oExpo = easeOutExpo(progress);
|
||||
// float iExpo = easeInExpo(progress);
|
||||
float ioSine = easeInOutSine(progress);
|
||||
float ioSine_r = 1.0 - ioSine;
|
||||
|
||||
vec2 uv = iTexCoord.st;
|
||||
//get blured version of the window
|
||||
vec4 oColor = blur(iTexCoord.st, ztomo * 100.0,uBlurQuality);
|
||||
|
||||
// // change the center
|
||||
// uv = uv * 2.0 - 1.0;
|
||||
// //scale
|
||||
// uv /= ioSine_r;
|
||||
// //re-center
|
||||
// uv = uv * 0.5 + 0.5;
|
||||
|
||||
//get color
|
||||
vec4 oColor = blur(uv, ztomo * 100.0,uBlurQuality);
|
||||
//apply mask
|
||||
oColor.a *= getMask(1.0 - ioSine);
|
||||
|
||||
//get and apply particles
|
||||
vec4 particles = getParticles(oColor.a);
|
||||
oColor = mix(oColor,particles,ztomo);
|
||||
if (uParticles)
|
||||
{
|
||||
vec4 particles = getParticles(oColor.a);
|
||||
oColor = mix(oColor,particles,ztomo);
|
||||
}
|
||||
|
||||
//get and apply sparks
|
||||
float sparks = getSparks(progress);
|
||||
oColor = alphaOver(oColor, vec4(1.0,1.0,1.0,sparks));
|
||||
|
||||
|
||||
oColor = alphaOver(oColor, getStars(mix(0.0001,0.999,progress)));
|
||||
if (uSparkCount > 0)
|
||||
{
|
||||
float sparks = getSparks(progress);
|
||||
oColor = alphaOver(oColor, vec4(1.0,1.0,1.0,sparks));
|
||||
}
|
||||
|
||||
//get and apply stars
|
||||
if (uStarCount > 0 )
|
||||
{
|
||||
oColor = alphaOver(oColor, getStars(mix(0.0001,0.999,progress)));
|
||||
}
|
||||
|
||||
setOutputColor(oColor);
|
||||
}
|
||||
@@ -0,0 +1,676 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
SPDX-FileCopyrightText: Justin Garza JGarza9788@gmail.com
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<interface domain="burn-my-windows">
|
||||
|
||||
<!-- Main container for the unicorn-fart preferences section -->
|
||||
<object class="AdwExpanderRow" id="unicorn-fart-prefs">
|
||||
|
||||
<!-- Animation Time Adjustment Section -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
|
||||
<property name="title" translatable="yes">Animation Time [ms]</property>
|
||||
<child>
|
||||
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-animation-time">
|
||||
<property name="upper">5000</property>
|
||||
<property name="lower">100</property>
|
||||
<property name="step-increment">10</property>
|
||||
<property name="page-increment">100</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-animation-time">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
||||
|
||||
<!-- Switch for Enabling Particles -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Enable Particles</property>
|
||||
<property name="activatable-widget">unicorn-fart-particles-enable</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="unicorn-fart-particles-enable">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particles-enable">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Particle Size Adjustment -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Particle Size</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-particle-size">
|
||||
<property name="upper">100.0</property>
|
||||
<property name="lower">1.0</property>
|
||||
<property name="step-increment">1.0</property>
|
||||
<property name="page-increment">10.0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particle-size">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Particle Speed Adjustment -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Particle Speed</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-particle-speed">
|
||||
<property name="upper">50.0</property>
|
||||
<property name="lower">0.1</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1.0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particle-speed">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Particle Color Random</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-particle-color-random">
|
||||
<property name="upper">100.0</property>
|
||||
<property name="lower">0.1</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1.0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particle-color-random">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Particle Color Speed</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-particle-color-speed">
|
||||
<property name="upper">100.0</property>
|
||||
<property name="lower">0.1</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1.0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particle-color-speed">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Spark Count</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-spark-count">
|
||||
<property name="upper">100</property>
|
||||
<property name="lower">0</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-spark-count">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Spark Start</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-spark-start">
|
||||
<property name="upper">0.5</property>
|
||||
<property name="lower">0.0</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-spark-start">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Spark End</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-spark-end">
|
||||
<property name="upper">1.0</property>
|
||||
<property name="lower">0.5</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-spark-end">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Spark offset</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-spark-offset">
|
||||
<property name="upper">0.5</property>
|
||||
<property name="lower">0.0</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">0.25</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-spark-offset">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star Count</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-star-count">
|
||||
<property name="upper">50</property>
|
||||
<property name="lower">0</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">5</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-count">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star Rotation</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-star-rotation">
|
||||
<property name="upper">3.0</property>
|
||||
<property name="lower">-3.0</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">0.5</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-rotation">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star Size</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-star-size">
|
||||
<property name="upper">1.0</property>
|
||||
<property name="lower">0.0</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">0.5</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-size">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star Start</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-star-start">
|
||||
<property name="upper">0.5</property>
|
||||
<property name="lower">0.0</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-start">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star End</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-star-end">
|
||||
<property name="upper">1.0</property>
|
||||
<property name="lower">0.5</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-end">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Blur Quality</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">2</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="unicorn-fart-blur-quality">
|
||||
<property name="upper">10.0</property>
|
||||
<property name="lower">0.0</property>
|
||||
<property name="step-increment">0.01</property>
|
||||
<property name="page-increment">0.1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-blur-quality">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
||||
<!-- Particle Colors -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Particle Colors</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="linked" />
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-0">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-1">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-2">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-3">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-4">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-particle-color-5">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-particle-colors">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Values</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Star Gradient Colors -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Star Colors</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="linked" />
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-0">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-1">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-2">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-3">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-4">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unicorn-fart-star-color-5">
|
||||
<property name="use_alpha">1</property>
|
||||
<property name="show_editor">1</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-unicorn-fart-star-colors">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Values</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
|
||||
@@ -1119,7 +1119,7 @@ SPDX-License-Identifier: CC0-1.0
|
||||
<summary>Rotate the Window</summary>
|
||||
<description>Rotate the Window</description>
|
||||
</key>
|
||||
|
||||
|
||||
<key name="team-rocket-sparkle-rot" type="d">
|
||||
<default>0.33</default>
|
||||
<summary>Sparkle Rotation</summary>
|
||||
@@ -1134,25 +1134,193 @@ SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- Simple Fade Effect Options -->
|
||||
<!-- Unicorn Fart Options -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
|
||||
<key name="simple-fade-enable-effect" type="b">
|
||||
<key name="unicorn-fart-enable-effect" type="b">
|
||||
<default>false</default>
|
||||
<summary>Simple Fade Enable Effect</summary>
|
||||
<description>Use the Simple Fade effect.</description>
|
||||
<summary>Unicorn Fart Enable Effect</summary>
|
||||
<description>Use the Unicorn Fart effect.</description>
|
||||
</key>
|
||||
|
||||
<key name="simple-fade-animation-time" type="i">
|
||||
<default>3000</default>
|
||||
<summary>Simple Fade Animation Time</summary>
|
||||
<description>The time the Simple Fade effect takes.</description>
|
||||
<key name="unicorn-fart-animation-time" type="i">
|
||||
<default>1500</default>
|
||||
<summary>Unicorn Fart Animation Time</summary>
|
||||
<description>The time the Unicorn Fart effect takes.</description>
|
||||
</key>
|
||||
|
||||
<key name="simple-fade-width" type="d">
|
||||
<default>0.1</default>
|
||||
<summary>Simple Fade Width</summary>
|
||||
<description>Width of the fading effect.</description>
|
||||
<!-- particles -->
|
||||
<key name="unicorn-fart-particles-enable" type="b">
|
||||
<default>false</default>
|
||||
<summary>Enable Particles</summary>
|
||||
<description>Toggle whether particles are enabled in the effect.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-size" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Particle Size</summary>
|
||||
<description>Set the size of the particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-speed" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Particle Speed</summary>
|
||||
<description>Control the speed of the particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-random" type="d">
|
||||
<default>0.0</default>
|
||||
<summary>Particle Color Randomness</summary>
|
||||
<description>Adjust the randomness of particle colors.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-speed" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Particle Color Change Speed</summary>
|
||||
<description>Set the speed of particle color transitions.</description>
|
||||
</key>
|
||||
|
||||
<!-- sparks -->
|
||||
<key name="unicorn-fart-spark-count" type="i">
|
||||
<default>25</default>
|
||||
<summary>Number of Sparks</summary>
|
||||
<description>Set the total number of sparks generated.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-spark-start" type="d">
|
||||
<default>0.0</default>
|
||||
<summary>Spark Start Point</summary>
|
||||
<description>Define the starting position for sparks.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-spark-end" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Spark End Point</summary>
|
||||
<description>Define the ending position for sparks.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-spark-offset" type="d">
|
||||
<default>0.0</default>
|
||||
<summary>Spark Offset</summary>
|
||||
<description>Set the positional offset for sparks.</description>
|
||||
</key>
|
||||
|
||||
<!-- stars -->
|
||||
<key name="unicorn-fart-star-count" type="i">
|
||||
<default>5</default>
|
||||
<summary>Number of Stars</summary>
|
||||
<description>Set the total number of stars displayed.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-rotation" type="d">
|
||||
<default>0.0</default>
|
||||
<summary>Star Rotation</summary>
|
||||
<description>Control the rotational angle of stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-size" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Star Size</summary>
|
||||
<description>Set the size of the stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-start" type="d">
|
||||
<default>0.0</default>
|
||||
<summary>Star Start Point</summary>
|
||||
<description>Define the starting position for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-end" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Star End Point</summary>
|
||||
<description>Define the ending position for stars.</description>
|
||||
</key>
|
||||
|
||||
<!-- blur -->
|
||||
<key name="unicorn-fart-blur-quality" type="d">
|
||||
<default>5.0</default>
|
||||
<summary>Blur Quality</summary>
|
||||
<description>Set the quality level for the blur effect.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-seed" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Random Seed</summary>
|
||||
<description>Define the seed value for random effects.</description>
|
||||
</key>
|
||||
|
||||
<!-- particle colors -->
|
||||
<key name="unicorn-fart-particle-color-0" type="s">
|
||||
<default>"rgba(255, 0, 0, 1.0)"</default>
|
||||
<summary>Primary Particle Color</summary>
|
||||
<description>Set the first color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-1" type="s">
|
||||
<default>"rgba(0, 255, 0, 1.0)"</default>
|
||||
<summary>Secondary Particle Color</summary>
|
||||
<description>Set the second color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-2" type="s">
|
||||
<default>"rgba(0, 0, 255, 1.0)"</default>
|
||||
<summary>Tertiary Particle Color</summary>
|
||||
<description>Set the third color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-3" type="s">
|
||||
<default>"rgba(255, 255, 0, 1.0)"</default>
|
||||
<summary>Quaternary Particle Color</summary>
|
||||
<description>Set the fourth color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-4" type="s">
|
||||
<default>"rgba(255, 0, 255, 1.0)"</default>
|
||||
<summary>Quinary Particle Color</summary>
|
||||
<description>Set the fifth color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-particle-color-5" type="s">
|
||||
<default>"rgba(0, 255, 255, 1.0)"</default>
|
||||
<summary>Senary Particle Color</summary>
|
||||
<description>Set the sixth color used for particles.</description>
|
||||
</key>
|
||||
|
||||
<!-- star colors -->
|
||||
<key name="unicorn-fart-star-color-0" type="s">
|
||||
<default>"rgba(255, 0, 0, 1.0)"</default>
|
||||
<summary>Primary Star Color</summary>
|
||||
<description>Set the first color used for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-color-1" type="s">
|
||||
<default>"rgba(0, 255, 0, 1.0)"</default>
|
||||
<summary>Secondary Star Color</summary>
|
||||
<description>Set the second color used for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-color-2" type="s">
|
||||
<default>"rgba(0, 0, 255, 1.0)"</default>
|
||||
<summary>Tertiary Star Color</summary>
|
||||
<description>Set the third color used for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-color-3" type="s">
|
||||
<default>"rgba(255, 255, 0, 1.0)"</default>
|
||||
<summary>Quaternary Star Color</summary>
|
||||
<description>Set the fourth color used for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-color-4" type="s">
|
||||
<default>"rgba(255, 0, 255, 1.0)"</default>
|
||||
<summary>Quinary Star Color</summary>
|
||||
<description>Set the fifth color used for stars.</description>
|
||||
</key>
|
||||
|
||||
<key name="unicorn-fart-star-color-5" type="s">
|
||||
<default>"rgba(0, 255, 255, 1.0)"</default>
|
||||
<summary>Senary Star Color</summary>
|
||||
<description>Set the sixth color used for stars.</description>
|
||||
</key>
|
||||
|
||||
</schema>
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ export var Shader = GObject.registerClass({
|
||||
// resolving any #includes in this file.
|
||||
_init(nick) {
|
||||
this._nick = nick;
|
||||
|
||||
|
||||
// This will call vfunc_build_pipeline().
|
||||
super._init();
|
||||
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ) ( //
|
||||
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
|
||||
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
|
||||
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
|
||||
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
|
||||
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
|
||||
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
|
||||
// |__/ //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SPDX-FileCopyrightText: Justin Garza JGarza9788@gmail.com
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||
// preferences process. The preferences process does not create any shader instances, it
|
||||
// only uses the static metadata of the effect.
|
||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||
|
||||
const _ = await utils.importGettext();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// This effect ... //
|
||||
// <- Please add a description of your effect here -> //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// The effect class can be used to get some metadata (like the effect's name or supported
|
||||
// GNOME Shell versions), to initialize the respective page of the settings dialog, as
|
||||
// well as to create the actual shader for the effect.
|
||||
export default class Effect {
|
||||
// The constructor creates a ShaderFactory which will be used by extension.js to create
|
||||
// shader instances for this effect. The shaders will be automagically created using the
|
||||
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
|
||||
// newly created shader instance.
|
||||
constructor() {
|
||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||
// Store uniform locations of newly created shaders.
|
||||
// shader._uFadeWidth = shader.get_uniform_location('uFadeWidth');
|
||||
|
||||
// Write all uniform values at the start of each animation.
|
||||
shader.connect('begin-animation',
|
||||
(shader, settings) => {
|
||||
|
||||
// shader.set_uniform_float(shader._uFadeWidth, 1, [
|
||||
// settings.get_double('simple-fade-width'),
|
||||
// ]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------- metadata
|
||||
|
||||
// The effect is available on all GNOME Shell versions supported by this extension.
|
||||
static getMinShellVersion() {
|
||||
return [3, 36];
|
||||
}
|
||||
|
||||
// This will be called in various places where a unique identifier for this effect is
|
||||
// required. It should match the prefix of the settings keys which store whether the
|
||||
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time
|
||||
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
|
||||
// named likes this.
|
||||
static getNick() {
|
||||
return 'simple-fade';
|
||||
}
|
||||
|
||||
// This will be shown in the sidebar of the preferences dialog as well as in the
|
||||
// drop-down menus where the user can choose the effect.
|
||||
static getLabel() {
|
||||
return _('Simple Fade Effect');
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------- API for prefs.js
|
||||
|
||||
// This is called by the preferences dialog whenever a new effect profile is loaded. It
|
||||
// binds all user interface elements to the respective settings keys of the profile.
|
||||
static bindPreferences(dialog) {
|
||||
// Empty for now... Code is added here later in the tutorial!
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
// The getActorScale() is called from extension.js to adjust the actor's size during the
|
||||
// animation. This is useful if the effect requires drawing something beyond the usual
|
||||
// bounds of the actor. This only works for GNOME 3.38+.
|
||||
static getActorScale(settings, forOpening, actor) {
|
||||
return {x: 1.0, y: 1.0};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ) ( //
|
||||
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
|
||||
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
|
||||
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
|
||||
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
|
||||
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
|
||||
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
|
||||
// |__/ //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SPDX-FileCopyrightText: Justin Garza JGarza9788@gmail.com
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
'use strict';
|
||||
|
||||
// Import the Gio module from the GNOME platform (GObject Introspection).
|
||||
// This module provides APIs for I/O operations, settings management, and other core
|
||||
// features.
|
||||
import Gio from 'gi://Gio';
|
||||
|
||||
// Import utility functions from the local utils.js file.
|
||||
// These utilities likely contain helper functions or shared logic used across the
|
||||
// application.
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
// We import the ShaderFactory only in the Shell process as it is not required in the
|
||||
// preferences process. The preferences process does not create any shader instances, it
|
||||
// only uses the static metadata of the effect.
|
||||
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
|
||||
|
||||
const _ = await utils.importGettext();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// I thought to myself, i said "self what would a unicorn fart look like" and then i came up with this, and i don't care that i'm out of the box, i think outside of the box, yeah f*ck that box!
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// The effect class can be used to get some metadata (like the effect's name or supported
|
||||
// GNOME Shell versions), to initialize the respective page of the settings dialog, as
|
||||
// well as to create the actual shader for the effect.
|
||||
export default class Effect {
|
||||
// The constructor creates a ShaderFactory which will be used by extension.js to create
|
||||
// shader instances for this effect. The shaders will be automagically created using the
|
||||
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
|
||||
// newly created shader instance.
|
||||
constructor() {
|
||||
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
|
||||
// Store uniform locations of newly created shaders.
|
||||
|
||||
shader._uParticles = shader.get_uniform_location('uParticles');
|
||||
shader._uParticleSize = shader.get_uniform_location('uParticleSize');
|
||||
shader._uParticleSpeed = shader.get_uniform_location('uParticleSpeed');
|
||||
shader._uParticleColorRandom = shader.get_uniform_location('uParticleColorRandom');
|
||||
shader._uParticleColorSpeed = shader.get_uniform_location('uParticleColorSpeed');
|
||||
|
||||
shader._uSparkCount = shader.get_uniform_location('uSparkCount');
|
||||
shader._uSparkStartEnd = shader.get_uniform_location('uSparkStartEnd');
|
||||
shader._uSparkOffset = shader.get_uniform_location('uSparkOffset');
|
||||
shader._uSparkCount = shader.get_uniform_location('uSparkCount');
|
||||
|
||||
shader._uStarCount = shader.get_uniform_location('uStarCount');
|
||||
shader._uStarRot = shader.get_uniform_location('uStarRot');
|
||||
shader._uStarSize = shader.get_uniform_location('uStarSize');
|
||||
shader._uStarStartEnd = shader.get_uniform_location('uStarStartEnd');
|
||||
|
||||
shader._uBlurQuality = shader.get_uniform_location('uBlurQuality');
|
||||
shader._uSeed = shader.get_uniform_location('uSeed');
|
||||
|
||||
shader._uStarColors = [
|
||||
shader.get_uniform_location('uStarColor0'),
|
||||
shader.get_uniform_location('uStarColor1'),
|
||||
shader.get_uniform_location('uStarColor2'),
|
||||
shader.get_uniform_location('uStarColor3'),
|
||||
shader.get_uniform_location('uStarColor4'),
|
||||
shader.get_uniform_location('uStarColor5'),
|
||||
];
|
||||
|
||||
shader._uParticleColors = [
|
||||
shader.get_uniform_location('uParticlesColor0'),
|
||||
shader.get_uniform_location('uParticlesColor1'),
|
||||
shader.get_uniform_location('uParticlesColor2'),
|
||||
shader.get_uniform_location('uParticlesColor3'),
|
||||
shader.get_uniform_location('uParticlesColor4'),
|
||||
shader.get_uniform_location('uParticlesColor5'),
|
||||
];
|
||||
|
||||
|
||||
// shader._uFadeWidth = shader.get_uniform_location('uFadeWidth');
|
||||
|
||||
// Write all uniform values at the start of each animation.
|
||||
shader.connect('begin-animation',
|
||||
(shader, settings) => {
|
||||
|
||||
for (let i = 0; i <= 5; i++) {
|
||||
shader.set_uniform_float(
|
||||
shader._uStarColors[i], 4,
|
||||
utils.parseColor(settings.get_string('unicorn-fart-star-color-' + i)));
|
||||
}
|
||||
|
||||
for (let i = 0; i <= 5; i++) {
|
||||
shader.set_uniform_float(
|
||||
shader._uParticleColors[i], 4,
|
||||
utils.parseColor(settings.get_string('unicorn-fart-particle-color-' + i)));
|
||||
}
|
||||
|
||||
shader.set_uniform_float(shader._uParticles, 1,
|
||||
[settings.get_boolean('unicorn-fart-particles-enable')]);
|
||||
|
||||
shader.set_uniform_float(shader._uParticleSize, 1,
|
||||
[settings.get_double('unicorn-fart-particle-size')]);
|
||||
|
||||
shader.set_uniform_float(shader._uParticleSpeed, 1,
|
||||
[settings.get_double('unicorn-fart-particle-speed')]);
|
||||
|
||||
shader.set_uniform_float(shader._uParticleColorRandom, 1,
|
||||
[settings.get_double('unicorn-fart-particle-color-random')]);
|
||||
|
||||
shader.set_uniform_float(shader._uParticleColorSpeed, 1,
|
||||
[settings.get_double('unicorn-fart-particle-color-speed')]);
|
||||
|
||||
shader.set_uniform_float(shader._uSparkCount, 1,
|
||||
[settings.get_int('unicorn-fart-spark-count')]);
|
||||
|
||||
shader.set_uniform_float(shader._uSparkStartEnd, 2,
|
||||
[settings.get_double('unicorn-fart-spark-start'),
|
||||
settings.get_double('unicorn-fart-spark-end')]
|
||||
);
|
||||
|
||||
shader.set_uniform_float(shader._uSparkOffset, 1,
|
||||
[settings.get_double('unicorn-fart-spark-offset')]);
|
||||
|
||||
shader.set_uniform_float(shader._uStarCount, 1,
|
||||
[settings.get_int('unicorn-fart-star-count')]);
|
||||
|
||||
shader.set_uniform_float(shader._uStarRot, 1,
|
||||
[settings.get_double('unicorn-fart-star-rotation')]);
|
||||
|
||||
shader.set_uniform_float(shader._uStarSize, 1,
|
||||
[settings.get_double('unicorn-fart-star-size')]);
|
||||
|
||||
shader.set_uniform_float(shader._uStarStartEnd, 2,
|
||||
[settings.get_double('unicorn-fart-star-start'),
|
||||
settings.get_double('unicorn-fart-star-end')]
|
||||
);
|
||||
|
||||
shader.set_uniform_float(shader._uBlurQuality, 1,
|
||||
[settings.get_double('unicorn-fart-blur-quality')]);
|
||||
|
||||
shader.set_uniform_float(shader._uSeed, 1,
|
||||
[Math.random()]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------- metadata
|
||||
|
||||
// The effect is available on all GNOME Shell versions supported by this extension.
|
||||
static getMinShellVersion() {
|
||||
return [3, 36];
|
||||
}
|
||||
|
||||
// This will be called in various places where a unique identifier for this effect is
|
||||
// required. It should match the prefix of the settings keys which store whether the
|
||||
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time
|
||||
// (e.g. '*-animation-time'). Also, the shader file and the settings UI files should be
|
||||
// named likes this.
|
||||
static getNick() {
|
||||
return 'unicorn-fart';
|
||||
}
|
||||
|
||||
// This will be shown in the sidebar of the preferences dialog as well as in the
|
||||
// drop-down menus where the user can choose the effect.
|
||||
static getLabel() {
|
||||
return _('UnicornFart');
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------- API for prefs.js
|
||||
|
||||
// This is called by the preferences dialog whenever a new effect profile is loaded. It
|
||||
// binds all user interface elements to the respective settings keys of the profile.
|
||||
static bindPreferences(dialog) {
|
||||
// Empty for now... Code is added here later in the tutorial!
|
||||
|
||||
dialog.bindAdjustment('unicorn-fart-animation-time');
|
||||
|
||||
//ints and floats
|
||||
dialog.bindAdjustment('unicorn-fart-particle-size');
|
||||
dialog.bindAdjustment('unicorn-fart-particle-speed');
|
||||
dialog.bindAdjustment('unicorn-fart-particle-color-random');
|
||||
dialog.bindAdjustment('unicorn-fart-particle-color-speed');
|
||||
|
||||
dialog.bindAdjustment('unicorn-fart-spark-count');
|
||||
dialog.bindAdjustment('unicorn-fart-spark-start');
|
||||
dialog.bindAdjustment('unicorn-fart-spark-end');
|
||||
dialog.bindAdjustment('unicorn-fart-spark-offset');
|
||||
|
||||
dialog.bindAdjustment('unicorn-fart-star-count');
|
||||
dialog.bindAdjustment('unicorn-fart-star-rotation');
|
||||
dialog.bindAdjustment('unicorn-fart-star-size');
|
||||
dialog.bindAdjustment('unicorn-fart-star-start');
|
||||
dialog.bindAdjustment('unicorn-fart-star-end');
|
||||
dialog.bindAdjustment('unicorn-fart-blur-quality');
|
||||
|
||||
//switches
|
||||
dialog.bindSwitch('unicorn-fart-particles-enable');
|
||||
|
||||
//star-color
|
||||
dialog.bindColorButton('unicorn-fart-star-color-0');
|
||||
dialog.bindColorButton('unicorn-fart-star-color-1');
|
||||
dialog.bindColorButton('unicorn-fart-star-color-2');
|
||||
dialog.bindColorButton('unicorn-fart-star-color-3');
|
||||
dialog.bindColorButton('unicorn-fart-star-color-4');
|
||||
dialog.bindColorButton('unicorn-fart-star-color-5');
|
||||
|
||||
//particle-colors
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-0');
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-1');
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-2');
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-3');
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-4');
|
||||
dialog.bindColorButton('unicorn-fart-particle-color-5');
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
// The getActorScale() is called from extension.js to adjust the actor's size during the
|
||||
// animation. This is useful if the effect requires drawing something beyond the usual
|
||||
// bounds of the actor. This only works for GNOME 3.38+.
|
||||
static getActorScale(settings, forOpening, actor) {
|
||||
return {x: 1.0, y: 1.0};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user