diff --git a/src/routes/index.rs b/src/routes/index.rs index b6707a5..fe13f4b 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -19,6 +19,7 @@ pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder #[derive(Content, Debug)] struct IndexTemplate { navbar: NavBar, + fullname: String, } #[once(time = 60)] @@ -30,6 +31,11 @@ pub fn build_page(config: Config, url: String) -> String { index: true, ..NavBar::default() }, + fullname: config + .fc + .fullname + .to_owned() + .unwrap_or("Fullname".to_owned()), }, Infos { page_title: config.fc.fullname, diff --git a/static/css/constants.css b/static/css/constants.css new file mode 100644 index 0000000..45c50e9 --- /dev/null +++ b/static/css/constants.css @@ -0,0 +1,22 @@ +/* Parameters light */ +@media (prefers-color-scheme: light) { + :root { + --background: #ffffff; + --font-color: #18181b; + --link-hover-color: #df5a9c; + } +} + +/* Parameters dark */ +@media (prefers-color-scheme: dark) { + :root { + --background: #171e26; + --font-color: #bcbcc5; + --link-hover-color: #ff80bf; + } +} + +/* Global parameters */ +:root { + --font-size: 17px; +} diff --git a/static/css/index.css b/static/css/index.css new file mode 100644 index 0000000..15698f3 --- /dev/null +++ b/static/css/index.css @@ -0,0 +1,51 @@ +/* Parameters light */ +@media (prefers-color-scheme: light) { + :root { + --name-color: #e61515; + --pronouns-color: #646062; + } +} + +/* Parameters dark */ +@media (prefers-color-scheme: dark) { + :root { + --name-color: #ee9cc5; + --pronouns-color: #7c7579; + } +} + +/* Page theme */ +main { + color: var(--font-color); + font-size: var(--font-size); + margin-inline: 25%; + padding: 2em 1em; +} + +/* Name header */ +.name { + font-size: 2.2rem; + color: var(--name-color); +} + +.subname { + margin-top: 0; + font-size: large; +} + +.pronouns { + font-size: smaller; + color: var(--pronouns-color); +} + +.avatar { + width: 65px; + border-radius: 50%; + float: right; +} + +/* Description */ + +h1 { + font-weight: 600; +} diff --git a/static/css/style.css b/static/css/style.css index a974097..d4e3614 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,7 +1,25 @@ +/* Theme of the pages */ +html { + background-color: var(--background); + font-family: "Segoe UI", "Segoe UI Emoji", "Segoe UI Symbol"; +} + +p, +a { + color: var(--font-color); + font-size: var(--font-size); +} + +/* Navigation bar across all of the pages */ +.navbar { + text-align: center; +} + .navbar li { display: inline-block; } +/* Maybe do this only with 'large' screens */ .navbar p::after { content: "ยท"; padding: 10px; @@ -11,6 +29,17 @@ content: ""; } +.navbar a { + text-decoration: none; + color: var(--link-hover-color); +} + +.navbar a:hover { + text-decoration: underline; + opacity: 0.6; + transition: opacity 0.2s; +} + .bold { font-weight: bold; } diff --git a/templates/head.html b/templates/head.html index 683bbc5..36237f9 100644 --- a/templates/head.html +++ b/templates/head.html @@ -6,4 +6,5 @@ {{>icons.html}} {{>metadata.html}} + diff --git a/templates/index.html b/templates/index.html index 4d4d99e..135e0aa 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,8 +2,31 @@ {{>head.html}} + - {{>navbar.html}} +
{{>navbar.html}}
+
+ {{#data}} + +
+ {{fullname}} + (il/lui, he/him) + Mon avatar +
+

Etudiant qui va rater son master

+ +
+

Bienvenue !

+

Content de vous voir ici !

+
+ + {{/data}} +