Repository with sources and generator of https://larlet.fr/david/ https://larlet.fr/david/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base_2020.html 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="{% block lang %}fr{% endblock lang %}">
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>{% block title %}{% endblock %} — David Larlet</title>
  13. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  14. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  15. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  16. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  17. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  18. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  19. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  20. <meta name="msapplication-TileColor" content="#f0f0ea">
  21. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  22. <meta name="theme-color" content="#f0f0ea">
  23. <!-- Documented, feel free to shoot an email. -->
  24. <link rel="stylesheet" href="/static/david/css/style_2020-04-25.css">
  25. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  26. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  27. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  28. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  29. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  32. {% block extra_head %}{% endblock %}
  33. <body class="remarkdown h1-underline h2-underline h3-underline hr-center ul-star pre-tick">
  34. {% block content %}{% endblock content %}
  35. <hr>
  36. <footer>
  37. <p>
  38. <a href="/david/" title="Aller à l’accueil">🏠</a> •
  39. <a href="/david/log/" title="Accès au flux RSS">🤖</a> •
  40. <a href="http://larlet.com" title="Go to my English profile" data-instant>🇨🇦</a> •
  41. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">📮</a> •
  42. <abbr title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340">🧚</abbr>
  43. </p>
  44. </footer>
  45. <script src="/static/david/js/instantpage-3.0.0.min.js" type="module" defer></script>
  46. <template id="theme-selector">
  47. <form id="chosen-color-scheme">
  48. <fieldset>
  49. <legend>Thème</legend>
  50. <label>
  51. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  52. </label>
  53. <label>
  54. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  55. </label>
  56. <label>
  57. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  58. </label>
  59. </fieldset>
  60. </form>
  61. </template>
  62. <script type="text/javascript">
  63. /* This is a work in progress with Anthony https://ricaud.me */
  64. // TODISCUSS:
  65. // 1. give a way for the user to close that choice?
  66. // 2. store preferences? (in a cookie or localstorage)
  67. // 3. create the template from scratch in JS?
  68. // 4. how to deal with multiple rules by stylesheet?
  69. const themeSelectorTemplate = document.querySelector('#theme-selector')
  70. const clone = themeSelectorTemplate.content.cloneNode(true)
  71. const firstChild = clone.firstElementChild
  72. document.body.insertAdjacentElement('afterbegin', firstChild)
  73. const form = document.querySelector('form#chosen-color-scheme')
  74. form.addEventListener('change', (e) => {
  75. const chosenColorScheme = e.target.value
  76. document.body.classList.toggle('forced-dark', chosenColorScheme === 'dark')
  77. document.body.classList.toggle(
  78. 'forced-light',
  79. chosenColorScheme === 'light'
  80. )
  81. })
  82. const mediaQueryTest = '(prefers-color-scheme: dark)'
  83. window.addEventListener('load', () => {
  84. // TODO: do not display the form if there is no related media CSS rule.
  85. for (const styleSheet of [...document.styleSheets]) {
  86. for (const cssRule of styleSheet.cssRules) {
  87. if (cssRule.type !== CSSRule.MEDIA_RULE) continue
  88. // Warning, Safari does not have/supports `conditionText`.
  89. if (cssRule.conditionText) {
  90. if (cssRule.conditionText !== mediaQueryTest) continue
  91. } else {
  92. if (cssRule.cssText.startsWith(mediaQueryTest)) continue
  93. }
  94. const mediaRule = cssRule
  95. for (const innerCssRule of mediaRule.cssRules) {
  96. styleSheet.insertRule(innerCssRule.cssText)
  97. }
  98. // TODO: what if there are more than one declaration?
  99. break
  100. }
  101. }
  102. })
  103. </script>
  104. </body>
  105. </html>