summaryrefslogtreecommitdiff
path: root/html/basics
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2022-11-16 23:05:51 +0100
committerQuentin Aristote <quentin@aristote.fr>2022-11-16 23:05:51 +0100
commit3229cdeb36992f429a4cba6c0e0f0c0fb38db527 (patch)
tree461b217408ed0ec51ab3bb5ca4a9515ceae264ad /html/basics
parent22feac158125136a669b3436f601bd90529d230d (diff)
adapt avatar size to screen
Diffstat (limited to 'html/basics')
-rw-r--r--html/basics/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/html/basics/default.nix b/html/basics/default.nix
index 1490529..ce15589 100644
--- a/html/basics/default.nix
+++ b/html/basics/default.nix
@@ -1,4 +1,4 @@
-{ html, data, ... }:
+{ html, data, lib, ... }:
let
basics = data.basics;
@@ -20,7 +20,17 @@ in {
(col [
(imgWith {
src = avatar;
+ srcset = lib.concatStringsSep ", "
+ (builtins.map (size: "${avatar}.${size} ${size}w") [
+ "128"
+ "256"
+ "512"
+ ] ++ [ "${avatar} 934w" ]);
+ sizes = "(max-width: 480px) 60vw, 30vw";
+ loading = "lazy";
+ alt = "Quentin Aristote";
style = ''
+ aspect-ratio: 1 / 1;
border-radius: 50%;
padding-left: 20%;
padding-right: 20%;