about summary refs log tree commit diff
path: root/web/tvl/logo
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-01-30T16·06+0300
committertazjin <tazjin@tvl.su>2022-01-31T16·11+0000
commitaa122cbae78ce97d60c0c98ba14df753d97e40b1 (patch)
tree12b98d85c4b18fe870feb26de70db9ba61837bd7 /web/tvl/logo
parent2d10d60fac0fd00a71b65cfdcb9fba0477b2086c (diff)
style: format entire depot with nixpkgs-fmt r/3723
This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'web/tvl/logo')
-rw-r--r--web/tvl/logo/default.nix42
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)))