PageSourceSearch

https://dustinbrett.com/_next/static/chunks/7950.b7ac7d75acad326c.js

js dustinbrett.com collected 2026-09-25 14:11:32 UTC 4,275 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7950],{47950:r=>{r.exports="//////////////////////////////////////////////////////////////////////////////////////////\r\n//          )                                                   (                       //\r\n//       ( /(   (  (               )    (       (  (  (         )\\ )    (  (            //\r\n//       )\\()) ))\\ )(   (         (     )\\ )    )\\))( )\\  (    (()/( (  )\\))(  (        //\r\n//      ((_)\\ /((_|()\\  )\\ )      )\\  '(()/(   ((_)()((_) )\\ )  ((_)))\\((_)()\\ )\\       //\r\n//      | |(_|_))( ((_)_(_/(    _((_))  )(_))  _(()((_|_)_(_/(  _| |((_)(()((_|(_)      //\r\n//      | '_ \\ || | '_| ' \\))  | '  \\()| || |  \\ V  V / | ' \\)) _` / _ \\ V  V (_-<      //\r\n//      |_.__/\\_,_|_| |_||_|   |_|_|_|  \\_, |   \\_/\\_/|_|_||_|\\__,_\\___/\\_/\\_//__/      //\r\n//                                 |__/                                                 //\r\n//////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n// SPDX-FileCopyrightText: Simon Schneegans <[email protected]>\r\n// SPDX-License-Identifier: GPL-3.0-or-later\r\n\r\n// The content from common.glsl is automatically prepended to each shader effect.\r\n\r\nuniform sampler2D uDustTexture;\r\nuniform vec4 uDustColor;\r\nuniform vec2 uSeed;\r\nuniform float uDustScale;\r\n\r\nconst float DUST_LAYERS      = 4.0;\r\nconst float GROW_INTENSITY   = 0.05;\r\nconst float SHRINK_INTENSITY = 0.05;\r\nconst float WIND_INTENSITY   = 0.05;\r\nconst float ACTOR_SCALE      = 1.2;\r\nconst float PADDING          = ACTOR_SCALE / 2.0 - 0.5;\r\n\r\nvoid main() {\r\n  // We simply inverse the progress for opening windows.\r\n  float progress = uForOpening ? uProgress : 1.0 - uProgress;\r\n\r\n  float gradient = iTexCoord.t * ACTOR_SCALE - PADDING;\r\n  progress       = 2.0 - gradient - 2.0 * progress;\r\n  progress       = progress + 0.25 - 0.5 * simplex2D((iTexCoord.st + uSeed) * 2.0);\r\n  progress       = pow(max(0.0, progress), 2.0);\r\n\r\n  vec4 oColor = vec4(0.0);\r\n\r\n  for (float i = 0.0; i < DUST_LAYERS; ++i) {\r\n\r\n    // Create a random direction.\r\n    float factor   = DUST_LAYERS == 1.0 ? 0.0 : i / (DUST_LAYERS - 1.0);\r\n    float angle    = 123.123 * (uSeed.x + factor);\r\n    vec2 direction = vec2(1.0, 0.0);\r\n    direction      = rotate(direction, angle);\r\n\r\n    // Flip direction for one side of the window.\r\n    vec2 coords = iTexCoord.st * ACTOR_SCALE - PADDING - 0.5;\r\n    if (getWinding(direction, coords) > 0.0) {\r\n      direction *= -1.0;\r\n    }\r\n\r\n    // Flip direction for half the layers.\r\n    if (factor > 0.5) {\r\n      direction *= -1.0;\r\n    }\r\n\r\n    // We grow the layer along the random direction, shrink it orthogonally to it\r\n    // and scale it up slightly.\r\n    float dist = distToLine(vec2(0.0), direction, coords);\r\n    vec2 grow  = direction * dist * mix(0.0, GROW_INTENSITY, progress);\r\n    vec2 shrink =\r\n      vec2(direction.y, -direction.x) * dist * mix(0.0, SHRINK_INTENSITY, progress);\r\n    float scale = mix(1.0, 1.05, factor * progress);\r\n    coords      = (coords + grow + shrink) / scale;\r\n\r\n    // Add some wind.\r\n    coords.x += WIND_INTENSITY * progress * (uForOpening ? 1.0 : -1.0);\r\n\r\n    // Now check wether there is actually something in the current dust layer at\r\n    // the coords position.\r\n    vec2 dustCoords = (coords + uSeed) * uSize / uDustScale / 100.0;\r\n    vec2 dustMap    = texture2D(uDustTexture, dustCoords).rg;\r\n    float dustGroup = floor(dustMap.g * DUST_LAYERS * 0.999);\r\n\r\n    if (dustGroup == i) {\r\n\r\n      // Get the window color.\r\n      vec4 windowColor = getInputColor(coords + 0.5);\r\n\r\n      // Fade the window color to uDustColor.\r\n      vec3 dustColor  = mix(windowColor.rgb, uDustColor.rgb, uDustColor.a);\r\n      windowColor.rgb = mix(windowColor.rgb, dustColor, progress);\r\n\r\n      // Dissolve and blend the layers.\r\n      if (dustMap.x - progress > 0.0) {\r\n        oColor = windowColor;\r\n      }\r\n    }\r\n  }\r\n\r\n  // This may help you to understand how this effect works.\r\n  // oColor = vec4(progress, 0, 0, 0);\r\n\r\n  setOutputColor(oColor);\r\n}\r\n"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.