From 116bc311c8ac9c4afb55796cc78b74033df3cf69 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 3 Mar 2024 20:55:00 +0100 Subject: [PATCH 1/7] rounded square pfp #55 --- Documentation.md | 2 ++ src/misc/markdown.rs | 1 + src/routes/index.rs | 21 +++++++++++++++++++++ static/css/index.css | 1 - templates/index.html | 15 +++++++++++++-- 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Documentation.md b/Documentation.md index cc4c9c7..f0be113 100644 --- a/Documentation.md +++ b/Documentation.md @@ -149,6 +149,7 @@ name: Option pronouns: Option avatar: Option avatar_caption: Option +avatar_style: Option --- Index content @@ -156,6 +157,7 @@ Index content - If no `name`, the `fullname` used in the configuration will be used - `avatar` is the link of the avatar +- `avatar_style` is either `round` (default) or `square` ## Blog diff --git a/src/misc/markdown.rs b/src/misc/markdown.rs index 7b68b80..51aea8c 100644 --- a/src/misc/markdown.rs +++ b/src/misc/markdown.rs @@ -56,6 +56,7 @@ pub struct FileMetadataIndex { pub pronouns: Option, pub avatar: Option, pub avatar_caption: Option, + pub avatar_style: Option, } /// Metadata for portfolio cards diff --git a/src/routes/index.rs b/src/routes/index.rs index bf9db99..cb23ad1 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -24,6 +24,13 @@ struct IndexTemplate { content: Option, avatar: String, avatar_caption: String, + avatar_style: StyleAvatar, +} + +#[derive(Content, Debug, Default)] +struct StyleAvatar { + round: bool, + square: bool, } #[once(time = 60)] @@ -38,6 +45,10 @@ fn build_page(config: Config) -> String { let mut pronouns = None; let mut avatar = "/icons/apple-touch-icon.png".to_owned(); let mut avatar_caption = "EWP avatar".to_owned(); + let mut avatar_style = StyleAvatar { + round: true, + square: false, + }; if let Some(f) = &file { if let Some(m) = &f.metadata.info.index { @@ -45,6 +56,15 @@ fn build_page(config: Config) -> String { avatar = m.avatar.to_owned().unwrap_or(avatar); pronouns = m.pronouns.to_owned(); avatar_caption = m.avatar_caption.to_owned().unwrap_or(avatar_caption); + + if let Some(style) = m.avatar_style.to_owned() { + if style.trim() == "square" { + avatar_style = StyleAvatar { + square: true, + ..StyleAvatar::default() + } + } + } } } else { file = read_file("README.md", TypeFileMetadata::Generic); @@ -62,6 +82,7 @@ fn build_page(config: Config) -> String { pronouns, avatar, avatar_caption, + avatar_style, }, Infos { page_title: config.fc.fullname, diff --git a/static/css/index.css b/static/css/index.css index 6c654d4..40cf831 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -38,7 +38,6 @@ #avatar { width: calc(var(--font-size) * 5); - border-radius: 50%; float: right; } diff --git a/templates/index.html b/templates/index.html index 6c06b7b..2df0219 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,12 +3,23 @@ {{>head.html}} + {{#data}} {{#avatar_style}} {{#round}} + + {{/round}} {{#square}} + + {{/square}} {{/avatar_style}}
{{>navbar.html}}
- {{#data}} -
{{name}} {{#pronouns}}{{pronouns}}{{/pronouns}} From 8ff80d8b34d5faa01e7604bf34e02540d42b5d2f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 5 Mar 2024 13:20:23 +0100 Subject: [PATCH 2/7] add pasteque --- static/badges/palestine.png | 3 +++ templates/web3.html | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 static/badges/palestine.png diff --git a/static/badges/palestine.png b/static/badges/palestine.png new file mode 100644 index 0000000..67cd679 --- /dev/null +++ b/static/badges/palestine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c05b9901ecc2f205b4b83e93243fc4588227ea452a640dcc96eba85dbb1594c +size 2437 diff --git a/templates/web3.html b/templates/web3.html index 9f23ce4..c753149 100644 --- a/templates/web3.html +++ b/templates/web3.html @@ -264,6 +264,13 @@ title="We are humans" /> + Stand with palestine + Date: Tue, 5 Mar 2024 13:23:59 +0100 Subject: [PATCH 3/7] sry to myself --- static/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index b8f2bd6..92e4506 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -14,7 +14,7 @@ window.addEventListener("load", () => { new Tag("Étudiant qui va rater son master"), new Tag("Peak D2 sur Valo 🤡"), new Tag( - "1312", + "0x520", ` display: inline; background: linear-gradient(to bottom right, red 0%, red 50%, black 50%); From bf35016f45aa66ac6d5a1100fc375b41324dc08d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 5 Mar 2024 13:24:07 +0100 Subject: [PATCH 4/7] CHENIL --- static/js/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/static/js/index.js b/static/js/index.js index 92e4506..781e7b8 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -24,6 +24,7 @@ window.addEventListener("load", () => { ` ), new Tag("Nul en CSS", "font-family: 'Comic Sans MS', cursive"), + new Tag("anri caterpillar"), ]; const random = Math.round(Math.random() * (tags.length - 1)); From 04db32006581bee551d44bcc24cbe9f5af8646e5 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 6 Mar 2024 13:07:39 +0100 Subject: [PATCH 5/7] EVEN FUNNIER --- static/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index 781e7b8..bfa9afb 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -24,7 +24,7 @@ window.addEventListener("load", () => { ` ), new Tag("Nul en CSS", "font-family: 'Comic Sans MS', cursive"), - new Tag("anri caterpillar"), + new Tag("anri k... caterpillar 🐛☝️"), ]; const random = Math.round(Math.random() * (tags.length - 1)); From 943603a330c07758f4b8528496517fd0e45b9193 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 19 Mar 2024 13:01:03 +0100 Subject: [PATCH 6/7] fix breakpoint --- static/css/portfolio.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/css/portfolio.css b/static/css/portfolio.css index c4a6618..bd04af6 100644 --- a/static/css/portfolio.css +++ b/static/css/portfolio.css @@ -28,7 +28,7 @@ main ul:not(ul ul) { /* breakpoint */ @media only screen and (max-width: 740px) { - main ul { + main ul:not(ul ul) { grid-template-columns: none; } } From 51ed97273ca9c620515706cfd6fb5f564761340b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 19 Mar 2024 13:01:34 +0100 Subject: [PATCH 7/7] Last element in odd list take all space available --- static/css/portfolio.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/css/portfolio.css b/static/css/portfolio.css index bd04af6..6687261 100644 --- a/static/css/portfolio.css +++ b/static/css/portfolio.css @@ -31,6 +31,10 @@ main ul:not(ul ul) { main ul:not(ul ul) { grid-template-columns: none; } + + main li:not(ul ul > li) { + grid-column: inherit !important; + } } /* Card */ @@ -50,6 +54,10 @@ main li:not(ul ul > li) { margin-inline: 5px; } +main li:not(ul ul > li):nth-child(odd):last-child { + grid-column: span 2; +} + main li:hover:not(ul ul > li) { background: color-mix(in srgb, var(--background) 40%, var(--extreme)); box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.3);