index.html 3.9 KB

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