index.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <title>Le Guin - UNBLINK</title>
  8. <meta name="description" content="“If you cannot or will not imagine the results of your actions, there’s no way you can act morally or responsibly, Little kids can’t do it; babies are morally monsters — completely greedy. Their imagination has to be trained into foresight and empathy.”
  9. Ursula K. Le Guin ">
  10. <meta name="author" content="[CP]">
  11. <link href="https://unbl.ink/an-old-hope.min.css" rel="stylesheet">
  12. <link href="https://unbl.ink/style.css" rel="stylesheet">
  13. <link rel="apple-touch-icon" href="https://unbl.ink/apple-touch-icon.png">
  14. <link rel="icon" href="https://unbl.ink/favicon.ico">
  15. <meta name="generator" content="Hugo 0.109.0">
  16. <link rel="alternate" type="application/atom+xml" href="https://unbl.ink/index.xml" title="UNBLINK">
  17. <script>
  18. function setTheme() {
  19. const time = new Date();
  20. const prev = localStorage.getItem('date');
  21. const date = String(time.getMonth() + 1) + '.' + String(time.getDate());
  22. const now = time.getTime();
  23. let sunrise;
  24. let sunset;
  25. function setBodyClass() {
  26. if (now > sunrise && now < sunset) return;
  27. document.body.classList.add('dark');
  28. }
  29. if (date !== prev) {
  30. fetch('https://api.ipgeolocation.io/astronomy?apiKey=5ed37d85103e4defa5df4c5298ed5215')
  31. .then(res => res.json())
  32. .then(data => {
  33. sunrise = data.sunrise.split(':').map(Number);
  34. sunset = data.sunset.split(':').map(Number);
  35. })
  36. .catch(() => {
  37. sunrise = [7, 0];
  38. sunset = [19, 0];
  39. })
  40. .finally(() => {
  41. sunrise = time.setHours(sunrise[0], sunrise[1], 0);
  42. sunset = time.setHours(sunset[0], sunset[1], 0);
  43. setBodyClass();
  44. localStorage.setItem('sunrise', sunrise);
  45. localStorage.setItem('sunset', sunset);
  46. });
  47. localStorage.setItem('date', date);
  48. } else {
  49. sunrise = Number(localStorage.getItem('sunrise'));
  50. sunset = Number(localStorage.getItem('sunset'));
  51. setBodyClass();
  52. }
  53. }
  54. </script>
  55. </head>
  56. <body class="single">
  57. <script>
  58. setTheme();
  59. </script>
  60. <header class="header">
  61. <nav class="nav">
  62. <p class="logo"><a href="https://unbl.ink/">UNBLINK</a></p>
  63. <ul class="menu">
  64. <li>
  65. <a href="/">Home</a>
  66. </li>
  67. <li>
  68. <a href="/post/">Archives</a>
  69. </li>
  70. <li>
  71. <a href="/categories/">Categories</a>
  72. </li>
  73. </ul>
  74. </nav>
  75. </header>
  76. <main class="main">
  77. <article class="post-single">
  78. <header class="post-header">
  79. <h1 class="post-title">Le Guin</h1>
  80. <div class="post-meta">[CP] · January 28, 2018</div>
  81. </header>
  82. <div class="post-content"><p>“If you cannot or will not imagine the results of your actions, there’s no way you can act morally or responsibly, Little kids can’t do it; babies are morally monsters — completely greedy. Their imagination has to be trained into foresight and empathy.”</p>
  83. <ul>
  84. <li>Ursula K. Le Guin</li>
  85. </ul>
  86. </div>
  87. </article>
  88. </main>
  89. <footer class="footer">
  90. <span>&copy; 2023 <a href="https://unbl.ink/">UNBLINK</a></span>
  91. <span>&middot;</span>
  92. <span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo️️</a>️</span>
  93. <span>&middot;</span>
  94. <span>Theme️ <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span>
  95. </footer>
  96. <script src="https://unbl.ink/highlight.min.js"></script>
  97. <script>
  98. hljs.initHighlightingOnLoad();
  99. </script>
  100. </body>
  101. </html>