diff --git a/www/404.html b/www/404.html new file mode 100644 index 0000000..98a2314 --- /dev/null +++ b/www/404.html @@ -0,0 +1,25 @@ + + + + + + +Page not found – Nelson Thomas + + + + + + +
+
+
$ traceroute this-page
+
1nelson-thomas.frokReached the site
+
2* * *404This page does not exist
+
+

Page not found

+

The link may be old or mistyped.

+ Back to the portfolio +
+ + diff --git a/www/contact.php b/www/contact.php index 344826e..b61f4b0 100644 --- a/www/contact.php +++ b/www/contact.php @@ -31,6 +31,7 @@ if (!is_readable($configFile)) { reply(500, false, 'The contact form is not configured yet.'); } $cfg = require $configFile; +date_default_timezone_set($cfg['timezone'] ?? 'Europe/Paris'); require $private . '/PHPMailer/Exception.php'; require $private . '/PHPMailer/PHPMailer.php'; @@ -38,6 +39,7 @@ require $private . '/PHPMailer/SMTP.php'; // ---------- Request checks ---------- if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') { + header('Allow: POST'); reply(405, false, 'Method not allowed.'); } $origin = $_SERVER['HTTP_ORIGIN'] ?? ''; @@ -63,12 +65,13 @@ function field(array $in, string $key, int $max): string } $first = field($in, 'first_name', 60); $last = field($in, 'last_name', 60); -$name = trim($first . ' ' . $last); -$phone = field($in, 'phone', 30); $email = field($in, 'email', 150); +$phone = field($in, 'phone', 30); $company = field($in, 'company', 100); $subject = field($in, 'subject', 150); $message = field($in, 'message', 4000); +$consent = ($in['consent'] ?? false) === true; +$name = trim($first . ' ' . $last); // Header-bound fields must not contain line breaks (header injection). foreach ([$first, $last, $email, $phone, $company, $subject] as $v) { @@ -76,27 +79,28 @@ foreach ([$first, $last, $email, $phone, $company, $subject] as $v) { reply(400, false, 'Invalid characters in the form.'); } } -if ($first === '' || $last === '' || $subject === '' || $message === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) { - reply(422, false, 'Fill in the required fields (*) with a valid email address.'); +if ($first === '' || $last === '' || $subject === '' || $message === '' + || !filter_var($email, FILTER_VALIDATE_EMAIL) + || ($phone !== '' && !preg_match('~^[0-9+()./ -]{6,30}$~', $phone))) { + reply(422, false, 'Fill in the required fields (*), and check your email and phone number.'); } -if ($phone !== '' && !preg_match('/^[0-9+().\/ -]{6,30}$/', $phone)) { - reply(422, false, 'The phone number looks invalid.'); -} -if (empty($in['consent'])) { - reply(422, false, 'Please tick the consent box so I can reply to you.'); +// GDPR: nothing is sent without the visitor's explicit consent. +if (!$consent) { + reply(422, false, 'Please tick the consent box so I can use your details to reply.'); } // ---------- Rate limit per IP ---------- $ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown'; $store = sys_get_temp_dir() . '/portfolio-contact-' . hash('sha256', $ip . ($cfg['rate_salt'] ?? '')); $now = time(); -$hits = []; -// Forget visitors after one hour: delete expired rate-limit files + +// Delete fingerprints older than one hour (as stated in the legal notice). foreach (glob(sys_get_temp_dir() . '/portfolio-contact-*') ?: [] as $old) { if (@filemtime($old) < $now - 3600) { @unlink($old); } } +$hits = []; if (is_readable($store)) { foreach (explode(',', (string) file_get_contents($store)) as $t) { if ((int) $t > $now - 3600) { @@ -112,15 +116,15 @@ if (count($hits) >= (int) ($cfg['max_per_hour'] ?? 5)) { $mail = new PHPMailer(true); try { $mail->isSMTP(); - $mail->Host = $cfg['smtp_host'] ?? 'smtp.protonmail.ch'; - $mail->Port = (int) ($cfg['smtp_port'] ?? 587); - $mail->SMTPSecure = $cfg['smtp_secure'] ?? PHPMailer::ENCRYPTION_STARTTLS; + $mail->Host = $cfg['smtp_host'] ?? 'smtp.protonmail.ch'; + $mail->Port = (int) ($cfg['smtp_port'] ?? 587); + $mail->SMTPSecure = $cfg['smtp_secure'] ?? PHPMailer::ENCRYPTION_STARTTLS; $mail->SMTPAutoTLS = $mail->SMTPSecure !== ''; - $mail->SMTPAuth = $cfg['smtp_auth'] ?? true; - $mail->Username = $cfg['smtp_user']; - $mail->Password = $cfg['smtp_token']; - $mail->CharSet = PHPMailer::CHARSET_UTF8; - $mail->Timeout = 15; + $mail->SMTPAuth = $cfg['smtp_auth'] ?? true; + $mail->Username = $cfg['smtp_user']; + $mail->Password = $cfg['smtp_token']; + $mail->CharSet = PHPMailer::CHARSET_UTF8; + $mail->Timeout = 15; // Proton only accepts the address tied to the token as sender. $mail->setFrom($cfg['smtp_user'], 'Portfolio: ' . $name); @@ -129,29 +133,17 @@ try { $mail->Subject = '[Portfolio] ' . $subject; $mail->isHTML(false); - // Site name: from the (already validated) Origin, else the configured name - $site = $cfg['site_name'] ?? ''; - if ($site === '') { - $site = (string) (parse_url($origin, PHP_URL_HOST) ?: ($_SERVER['HTTP_HOST'] ?? 'portfolio')); - } - date_default_timezone_set($cfg['timezone'] ?? 'Europe/Paris'); - $line = str_repeat('-', 60); - $or = fn(string $v): string => $v !== '' ? $v : '-'; - $body = str_replace(["\r\n", "\r"], "\n", $message); - $mail->Body = - "Nouveau message depuis le formulaire de contact de $site\n" - . "$line\n" - . "Prénom : $first\n" - . "Nom : $last\n" - . "E-mail : $email\n" - . 'Téléphone: ' . $or($phone) . "\n" - . 'Société : ' . $or($company) . "\n" - . "Objet : $subject\n" - . "$line\n\n" - . $body . "\n\n" - . "$line\n" - . "IP: $ip — " . date('Y-m-d H:i:s') . "\n"; + "New message from your portfolio\n" + . "-------------------------------\n" + . "Name: $name\n" + . "Email: $email\n" + . ($phone !== '' ? "Phone: $phone\n" : '') + . ($company !== '' ? "Company: $company\n" : '') + . 'Date: ' . date('Y-m-d H:i:s T') . "\n" + . "IP: $ip\n" + . "Consent: given (form checkbox)\n\n" + . $message . "\n"; $mail->send(); diff --git a/www/css/fonts.css b/www/css/fonts.css index 48ed33e..f7c4b73 100644 --- a/www/css/fonts.css +++ b/www/css/fonts.css @@ -1,4 +1,4 @@ -/* Self-hosted fonts (SIL Open Font License 1.1), from Fontsource */ +/* Self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt), from Fontsource: latin + latin-ext subsets */ @font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} @font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} @font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/chakra-petch-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} diff --git a/www/css/style.css b/www/css/style.css index 59f1c6d..6bb7961 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -48,7 +48,7 @@ nav a::after{content:"";position:absolute;left:.6rem;right:.6rem;bottom:.15rem;h nav a.active{color:var(--text)} nav a.active::after{transform:scaleX(1)} header::after{content:"";position:absolute;left:0;bottom:-1px;height:1px;width:var(--progress,0%);background:var(--proton-soft)} -.theme{background:none;border:1px solid var(--line);color:var(--muted);border-radius:6px;padding:.35rem .55rem;cursor:pointer;font-size:.9rem} +.theme{display:inline-grid;place-items:center;background:none;border:1px solid var(--line);color:var(--muted);border-radius:6px;padding:.35rem .55rem;cursor:pointer;font-size:.9rem} main{max-width:1080px;margin:0 auto;padding:2.5rem 1.25rem 2rem} html{scroll-behavior:smooth;scroll-padding-top:calc(env(safe-area-inset-top,0px) + 4.5rem)} @@ -66,7 +66,7 @@ p{margin:0 0 1rem;max-width:68ch} /* Hero: traceroute */ .hero{display:grid;grid-template-columns:1.1fr 1fr;gap:2.5rem;align-items:center;margin-bottom:3rem} .avatar{box-shadow:0 0 0 4px color-mix(in srgb,var(--proton) 25%,transparent);width:96px;height:96px;border-radius:50%;display:grid;place-items:center;font:700 1.8rem var(--display); - background:var(--surface-2);border:2px dashed var(--todo);color:var(--todo);margin-bottom:1.2rem} + background:var(--grad);color:#fff;margin-bottom:1.2rem} .role{font:500 1.1rem var(--display);color:var(--proton-soft);margin-bottom:1rem} .trace{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:1.1rem 1.2rem;font:400 .86rem/1.75 var(--mono);overflow-x:auto} .trace .cmd{color:var(--muted);margin-bottom:.4rem} @@ -94,15 +94,8 @@ dl.star dt{color:var(--muted)} dl.star dd{margin:0} .tags span{font-size:.8rem;padding:.15rem .55rem;border-radius:4px;background:var(--surface-2);color:var(--muted)} .result{color:var(--signal);font-weight:500} -.todo{border:1px dashed var(--todo);border-radius:6px;padding:.1rem .4rem;color:var(--todo);font-size:.95em} -.item.todo-box{border-style:dashed;border-color:var(--todo)} .sub{margin:2.5rem 0 1rem;font:600 1.25rem var(--display);color:var(--text)} -.checklist{list-style:none;padding:0;margin:0 0 2rem;display:grid;gap:.5rem;max-width:720px} -.checklist li{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem .9rem;background:var(--surface);border:1px solid var(--line);border-radius:8px} -.checklist .st{flex:none;width:1.3rem;height:1.3rem;border-radius:50%;border:2px solid var(--todo);margin-top:.15rem} -.checklist .st.ok{border-color:var(--signal);background:var(--signal)} -.video{aspect-ratio:16/9;display:grid;place-items:center;background:var(--surface-2);border:1px dashed var(--todo);border-radius:10px;color:var(--todo);text-align:center;padding:1rem} .meter{height:10px;background:var(--surface-2);border-radius:5px;overflow:hidden;margin:.6rem 0 .3rem;max-width:520px} .meter i{display:block;height:100%;width:0;background:var(--proton-soft)} @@ -125,19 +118,17 @@ input:user-invalid,textarea:user-invalid{border-color:var(--rose)} .direct{display:grid;gap:.6rem} @media (max-width:600px){.row{grid-template-columns:1fr}} /* Hover: frames lift slightly and pick up the Proton purple */ -.item,.checklist li,.trace,.form,.video,.btn,.tags span{transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease,background-color .25s ease} +.item,.trace,.form,.btn,.tags span{transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease,background-color .25s ease} @media (hover:hover){ - .item:hover,.trace:hover,.form:hover,.video:hover{transform:translateY(-3px);border-color:var(--proton-soft); + .item:hover,.trace:hover,.form:hover{transform:translateY(-3px);border-color:var(--proton-soft); box-shadow:0 10px 28px -12px color-mix(in srgb,var(--proton) 55%,transparent)} - .item.todo-box:hover{border-color:var(--todo)} - .checklist li:hover{transform:translateX(4px);border-color:var(--proton-soft)} .btn:hover{transform:translateY(-2px);border-color:var(--proton-soft);box-shadow:0 6px 18px -8px color-mix(in srgb,var(--proton) 70%,transparent)} .btn.primary:hover{background:var(--proton-soft);filter:none} .item:hover .tags span{background:color-mix(in srgb,var(--proton) 22%,var(--surface-2));color:var(--text)} .form button:hover{transform:translateY(-1px)} } @media (prefers-reduced-motion:reduce){ - .item:hover,.trace:hover,.form:hover,.video:hover,.checklist li:hover,.btn:hover,.form button:hover{transform:none} + .item:hover,.trace:hover,.form:hover,.btn:hover,.form button:hover{transform:none} } .cover{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:8px;margin-bottom:1rem;background:var(--surface-2)} .civic-head{display:flex;justify-content:space-between;align-items:baseline;gap:.8rem} @@ -416,3 +407,34 @@ dl.facts dd{margin:0} nav a.active::after{transform:scaleY(1)} } @media (prefers-reduced-motion:reduce){nav,nav.open,.menu-btn span{transition:none}} + +/* Career cards: keep the action buttons at the bottom */ +#career .item{display:flex;flex-direction:column;align-items:flex-start} +#career .item>.btn,#career .cv-links{margin-top:auto} +#career .cv-links{display:flex;margin-bottom:0} + +/* 404 page */ +.notfound{max-width:640px;min-height:100vh;display:grid;align-content:center;gap:1.2rem;padding:2rem 1.25rem} +.notfound h1{margin:0} + +/* Former inline styles (moved here so a strict Content-Security-Policy can block inline CSS) */ +.u-019d5f{left:4.76% !important;width:78.57% !important} +.u-054622{animation-delay:.5s !important} +.u-084650{animation-delay:1.4s !important} +.u-2133b3{left:47.62% !important} +.u-465ef4{object-position:50% 38% !important} +.u-4913bb{left:9.52% !important} +.u-51037d{width:12.5% !important} +.u-554682{width:34.9% !important} +.u-603952{left:66.67% !important} +.u-6e5a89{animation-delay:1.1s !important} +.u-6f748d{left:71.43% !important} +.u-75bc8d{left:90.48% !important;width:9.52% !important} +.u-7d53d2{height:20px !important;margin:4px 2px !important} +.u-925d61{object-position:50% 12% !important} +.u-ae93b7{animation-delay:.8s !important} +.u-bd9c6a{left:42.86% !important} +.u-c55905{left:21.43% !important} +.u-cf3fb6{left:14.29% !important} +.u-d46287{animation-delay:.2s !important} +.u-ed50ea{left:92.86% !important} diff --git a/www/favicon.svg b/www/favicon.svg new file mode 100644 index 0000000..810bcfd --- /dev/null +++ b/www/favicon.svg @@ -0,0 +1 @@ +NT diff --git a/www/fonts/LICENSE-ibm-plex-mono.txt b/www/fonts/LICENSE-ibm-plex-mono.txt deleted file mode 100644 index 83eac82..0000000 --- a/www/fonts/LICENSE-ibm-plex-mono.txt +++ /dev/null @@ -1,93 +0,0 @@ -Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ThinItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLight.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Light.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-LightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Regular.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Italic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Medium.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-MediumItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Bold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-BoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/www/fonts/LICENSE-chakra-petch.txt b/www/fonts/OFL-ChakraPetch.txt similarity index 100% rename from www/fonts/LICENSE-chakra-petch.txt rename to www/fonts/OFL-ChakraPetch.txt diff --git a/www/fonts/LICENSE-ibm-plex-sans.txt b/www/fonts/OFL-IBMPlex.txt similarity index 100% rename from www/fonts/LICENSE-ibm-plex-sans.txt rename to www/fonts/OFL-IBMPlex.txt diff --git a/www/img/og-card.png b/www/img/og-card.png new file mode 100644 index 0000000..beddf51 Binary files /dev/null and b/www/img/og-card.png differ diff --git a/www/index.html b/www/index.html index 357213e..59020d4 100644 --- a/www/index.html +++ b/www/index.html @@ -4,16 +4,29 @@ - + + + + + + + + + + + Nelson Thomas – ePortfolio - - + + + + +
Nelson Thomas - +
-

Photography

Nature, wildlife and landmarks, including drone shots. [Add 3–4 of your photos]

+

Photography

Nature, wildlife and landmarks, including drone shots.

Geopolitics

Following world affairs, which often explains the threats a SOC ends up seeing.

@@ -482,8 +427,8 @@

Civic engagement

-

Forty hours required by S9. Here is what's done and what's planned.

-
+

Volunteering and awareness actions, with a goal of forty hours over my engineering degree.

+

5 of 40 hours completed

@@ -501,11 +446,6 @@

A group walk through the streets of Toulouse to collect litter and keep it out of drains and green spaces.

EnvironmentLocal action
-
-

[Next action]

-

[35 hours to go: e.g. cyber-awareness sessions for a school or an association, digital help for seniors, N7 student association]

-
[hours, dates]
-
@@ -542,6 +482,6 @@ - + diff --git a/www/js/legal.js b/www/js/legal.js new file mode 100644 index 0000000..b076722 --- /dev/null +++ b/www/js/legal.js @@ -0,0 +1,21 @@ +(function(){ + // Land at the top, even when the page is shown inside a frame (scrollIntoView also scrolls the parent page) + if('scrollRestoration' in history)history.scrollRestoration='manual'; + function toTop(){window.scrollTo(0,0);var m=document.body;if(m&&m.scrollIntoView)m.scrollIntoView({block:'start',behavior:'instant'})} + window.addEventListener('load',function(){if(!/^#(en|fr)-/.test(location.hash))toTop()}); + var arts={en:document.getElementById('en'),fr:document.getElementById('fr')}; + var links=[].slice.call(document.querySelectorAll('.lang-switch a')); + function show(lang,top){ + Object.keys(arts).forEach(function(k){arts[k].hidden=k!==lang}); + links.forEach(function(a){a.setAttribute('aria-current',a.getAttribute('href')==='#'+lang)}); + document.documentElement.lang=lang; + document.title=lang==='fr'?'Mentions légales – Nelson Thomas':'Legal notice – Nelson Thomas'; + if(top)toTop(); + } + links.forEach(function(a){a.addEventListener('click',function(e){ + e.preventDefault(); var l=a.getAttribute('href').slice(1); + history.replaceState(null,'','#'+l); show(l,true); + })}); + var h=location.hash.slice(1,3); + show(h==='fr'||h==='en'?h:(/^fr\b/i.test(navigator.language||'')?'fr':'en'),!/^#(en|fr)-/.test(location.hash)); +})(); diff --git a/www/js/main.js b/www/js/main.js index f6d458a..5e2d088 100644 --- a/www/js/main.js +++ b/www/js/main.js @@ -8,7 +8,6 @@ var LINKEDIN_URL = "https://www.linkedin.com/in/nelson-thomas-pr/"; (function(){ var root=document.documentElement; - try{var s=localStorage.getItem('theme');if(s)root.dataset.theme=s}catch(e){} document.getElementById('theme').addEventListener('click',function(){ var dark=root.dataset.theme?root.dataset.theme==='dark':!matchMedia('(prefers-color-scheme: light)').matches; root.dataset.theme=dark?'light':'dark'; diff --git a/www/js/theme.js b/www/js/theme.js new file mode 100644 index 0000000..be7f6fd --- /dev/null +++ b/www/js/theme.js @@ -0,0 +1,2 @@ +/* Apply the saved light/dark choice before the page paints (no flash). */ +try{var t=localStorage.getItem('theme');if(t==='light'||t==='dark')document.documentElement.dataset.theme=t}catch(e){} diff --git a/www/legal.html b/www/legal.html index eebb247..96531e1 100644 --- a/www/legal.html +++ b/www/legal.html @@ -5,9 +5,11 @@ Legal notice – Nelson Thomas - - - + +Legal notice – Nelson Thomas + + +
@@ -101,29 +103,6 @@
- + diff --git a/www/robots.txt b/www/robots.txt new file mode 100644 index 0000000..d79fc43 --- /dev/null +++ b/www/robots.txt @@ -0,0 +1,5 @@ +User-agent: * +Allow: / +Disallow: /contact.php + +Sitemap: https://nelson-thomas.fr/sitemap.xml diff --git a/www/sitemap.xml b/www/sitemap.xml new file mode 100644 index 0000000..95ca2c9 --- /dev/null +++ b/www/sitemap.xml @@ -0,0 +1,4 @@ + + + https://nelson-thomas.fr/2026-10-22 +