diff options
Diffstat (limited to 'web/tvl/logo/default.nix')
-rw-r--r-- | web/tvl/logo/default.nix | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/web/tvl/logo/default.nix b/web/tvl/logo/default.nix index 940f67199bf6..d9e023946a42 100644 --- a/web/tvl/logo/default.nix +++ b/web/tvl/logo/default.nix @@ -21,20 +21,22 @@ let # Create an animated CSS that equally spreads out the colours over # the animation duration (1min). - animatedCss = colours: let - # Calculate at which percentage offset each colour should appear. - stepSize = 100 / ((builtins.length colours) - 1); - frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours; - frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }"; - in '' - #armchair-background { - animation: 30s infinite alternate armchairPalette; - } + animatedCss = colours: + let + # Calculate at which percentage offset each colour should appear. + stepSize = 100 / ((builtins.length colours) - 1); + frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours; + frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }"; + in + '' + #armchair-background { + animation: 30s infinite alternate armchairPalette; + } - @keyframes armchairPalette { - ${lib.concatStringsSep "\n" (map frameCss frames)} - } - ''; + @keyframes armchairPalette { + ${lib.concatStringsSep "\n" (map frameCss frames)} + } + ''; # Dark version of the logo, suitable for light backgrounds. darkCss = armchairCss: '' @@ -67,7 +69,8 @@ let </svg> ''; -in depot.nix.readTree.drvTargets(lib.fix (self: { +in +depot.nix.readTree.drvTargets (lib.fix (self: { # Expose the logo construction functions. inherit palette darkCss lightCss animatedCss staticCss; @@ -75,7 +78,7 @@ in depot.nix.readTree.drvTargets(lib.fix (self: { logoSvg = style: pkgs.writeText "logo.svg" (logoSvg style); # Create a PNG of the TVL logo with the specified style and DPI. - logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" {} '' + logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" { } '' ${pkgs.inkscape}/bin/inkscape \ --export-area-drawing \ --export-background-opacity 0 \ @@ -87,7 +90,8 @@ in depot.nix.readTree.drvTargets(lib.fix (self: { pastelRainbow = self.logoSvg (darkCss (animatedCss (lib.attrValues palette))); } -# Add individual outputs for static dark logos of each colour. -// (lib.mapAttrs' - (k: v: lib.nameValuePair "${k}Png" - (self.logoPng (darkCss (staticCss v)) 96)) palette))) + # Add individual outputs for static dark logos of each colour. + // (lib.mapAttrs' + (k: v: lib.nameValuePair "${k}Png" + (self.logoPng (darkCss (staticCss v)) 96)) + palette))) |