index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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>Water - UNBLINK</title>
  8. <meta name="description" content="Rain doesn&rsquo;t help us
  9. Remember the cause, the
  10. Animating factor.
  11. Rain only redistributes
  12. Colossal amounts of
  13. Caustic chemicals everywhere.">
  14. <meta name="author" content="[CP]">
  15. <link href="https://unbl.ink/an-old-hope.min.css" rel="stylesheet">
  16. <link href="https://unbl.ink/style.css" rel="stylesheet">
  17. <link rel="apple-touch-icon" href="https://unbl.ink/apple-touch-icon.png">
  18. <link rel="icon" href="https://unbl.ink/favicon.ico">
  19. <meta name="generator" content="Hugo 0.109.0">
  20. <link rel="alternate" type="application/atom+xml" href="https://unbl.ink/index.xml" title="UNBLINK">
  21. <script>
  22. function setTheme() {
  23. const time = new Date();
  24. const prev = localStorage.getItem('date');
  25. const date = String(time.getMonth() + 1) + '.' + String(time.getDate());
  26. const now = time.getTime();
  27. let sunrise;
  28. let sunset;
  29. function setBodyClass() {
  30. if (now > sunrise && now < sunset) return;
  31. document.body.classList.add('dark');
  32. }
  33. if (date !== prev) {
  34. fetch('https://api.ipgeolocation.io/astronomy?apiKey=5ed37d85103e4defa5df4c5298ed5215')
  35. .then(res => res.json())
  36. .then(data => {
  37. sunrise = data.sunrise.split(':').map(Number);
  38. sunset = data.sunset.split(':').map(Number);
  39. })
  40. .catch(() => {
  41. sunrise = [7, 0];
  42. sunset = [19, 0];
  43. })
  44. .finally(() => {
  45. sunrise = time.setHours(sunrise[0], sunrise[1], 0);
  46. sunset = time.setHours(sunset[0], sunset[1], 0);
  47. setBodyClass();
  48. localStorage.setItem('sunrise', sunrise);
  49. localStorage.setItem('sunset', sunset);
  50. });
  51. localStorage.setItem('date', date);
  52. } else {
  53. sunrise = Number(localStorage.getItem('sunrise'));
  54. sunset = Number(localStorage.getItem('sunset'));
  55. setBodyClass();
  56. }
  57. }
  58. </script>
  59. </head>
  60. <body class="single">
  61. <script>
  62. setTheme();
  63. </script>
  64. <header class="header">
  65. <nav class="nav">
  66. <p class="logo"><a href="https://unbl.ink/">UNBLINK</a></p>
  67. <ul class="menu">
  68. <li>
  69. <a href="/">Home</a>
  70. </li>
  71. <li>
  72. <a href="/post/">Archives</a>
  73. </li>
  74. <li>
  75. <a href="/categories/">Categories</a>
  76. </li>
  77. </ul>
  78. </nav>
  79. </header>
  80. <main class="main">
  81. <article class="post-single">
  82. <header class="post-header">
  83. <h1 class="post-title">Water</h1>
  84. <div class="post-meta">[CP] · July 23, 2019</div>
  85. </header>
  86. <div class="post-content"><p>Rain doesn&rsquo;t help us</p>
  87. <p>Remember the cause, the</p>
  88. <p>Animating factor.</p>
  89. <p>Rain only redistributes</p>
  90. <p>Colossal amounts of</p>
  91. <p>Caustic chemicals everywhere.</p>
  92. </div>
  93. </article>
  94. </main>
  95. <footer class="footer">
  96. <span>&copy; 2023 <a href="https://unbl.ink/">UNBLINK</a></span>
  97. <span>&middot;</span>
  98. <span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo️️</a>️</span>
  99. <span>&middot;</span>
  100. <span>Theme️ <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span>
  101. </footer>
  102. <script src="https://unbl.ink/highlight.min.js"></script>
  103. <script>
  104. hljs.initHighlightingOnLoad();
  105. </script>
  106. </body>
  107. </html>