layout.html.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <!DOCTYPE html>
  3. <html lang="<?php echo blog_language();?>" class="__variable_space scroll-smooth light" id="html-id">
  4. <head>
  5. <?php echo head_contents();?>
  6. <?php echo $metatags;?>
  7. <link rel="stylesheet" href="<?php echo theme_path();?>css/typography.css" data-precedence="next" />
  8. <link rel="stylesheet" href="<?php echo theme_path();?>css/tailwind.css" data-precedence="next" />
  9. <link rel="stylesheet" href="<?php echo theme_path();?>css/style.css" data-precedence="next" />
  10. </head>
  11. <body class="bg-white pl-[calc(100vw-100%)] text-black antialiased dark:bg-gray-950 dark:text-white">
  12. <?php if (facebook()) { echo facebook(); } ?>
  13. <?php if (login()) { toolbar(); } ?>
  14. <script>
  15. var html = document.getElementById("html-id");
  16. if (localStorage.getItem("tw-theme") === "dark") {
  17. html.classList.remove('light');
  18. html.classList.add('dark');
  19. } else if (localStorage.getItem("tw-theme") === "light") {
  20. html.classList.remove('dark');
  21. html.classList.add('light');
  22. }
  23. </script>
  24. <section class="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0">
  25. <div class="flex h-screen flex-col justify-between font-sans">
  26. <header class="flex items-center justify-between py-10">
  27. <div>
  28. <a aria-label="<?php echo blog_title();?>" href="<?php echo site_url();?>">
  29. <div class="flex items-center justify-between">
  30. <div class="mr-3">
  31. <img width="45" src="<?php echo theme_path();?>logo.png" alt="<?php echo blog_title();?>"/>
  32. </div>
  33. <div class="hidden h-6 text-2xl font-semibold sm:block"><?php echo blog_title();?></div>
  34. </div>
  35. </a>
  36. </div>
  37. <div class="flex items-center space-x-4 leading-5 sm:space-x-6">
  38. <?php echo menu('nav-top');?>
  39. <button aria-label="Search" class="search-open">
  40. <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-6 w-6 text-gray-900 dark:text-gray-100">
  41. <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"></path>
  42. </svg>
  43. </button>
  44. <div class="mr-5">
  45. <div class="relative inline-block text-left">
  46. <div>
  47. <button id="theme-toggle" type="button" aria-label="Theme Mode" aria-haspopup="menu" aria-expanded="false">
  48. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-6 w-6 text-gray-900 dark:text-gray-100">
  49. <path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
  50. </svg>
  51. </button>
  52. </div>
  53. </div>
  54. </div>
  55. <button aria-label="Toggle Menu" class="sm:hidden menu-open" id="menu-toggle">
  56. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-8 w-8 text-gray-900 dark:text-gray-100">
  57. <path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path>
  58. </svg>
  59. </button>
  60. <div class="menu-mobile" role="dialog" tabindex="-1">
  61. <div class="fixed inset-0 z-60 bg-black/25"></div>
  62. <div class="fixed left-0 top-0 z-70 h-full w-full bg-white opacity-95 duration-300 dark:bg-gray-950 dark:opacity-[0.98]">
  63. <nav class="mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pl-12 pt-2 text-left">
  64. <?php echo menu('nav-mobile');?>
  65. </nav>
  66. <button class="fixed right-4 top-7 z-80 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400 menu-close" aria-label="Toggle Menu">
  67. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
  68. <path
  69. fill-rule="evenodd"
  70. d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
  71. clip-rule="evenodd"
  72. ></path>
  73. </svg>
  74. </button>
  75. </div>
  76. </div>
  77. </div>
  78. </header>
  79. <main class="mb-auto">
  80. <?php if (is_index() || isset($is_profile)) {?>
  81. <div class="divide-y divide-gray-200 dark:divide-gray-700">
  82. <?php echo content();?>
  83. </div>
  84. <?php } else {?>
  85. <?php echo content();?>
  86. <?php } ?>
  87. </main>
  88. <footer>
  89. <div class="mt-16 flex flex-col items-center">
  90. <div class="mb-3 flex space-x-4">
  91. <?php echo social();?>
  92. </div>
  93. <div class="mb-2 flex space-x-2 text-sm text-gray-500 dark:text-gray-400">
  94. <div><?php echo copyright();?></div>
  95. </div>
  96. <div class="mb-8 text-sm text-gray-500 dark:text-gray-400">Design by <a style="te" target="_blank" rel="nofollow" href="https://www.timlrx.com/">Timlrx</a></div>
  97. </div>
  98. </footer>
  99. </div>
  100. </section>
  101. <div style="position: fixed; align-items: flex-start; justify-content: center; width: 100%; inset: 0px; padding: 14vh 16px 16px;" class="z-50 bg-gray-300/50 p-4 backdrop-blur backdrop-filter dark:bg-black/50 search-form">
  102. <div style="opacity: 1; transform: scale(0.99); pointer-events: auto;" class="w-full max-w-xl">
  103. <div>
  104. <div class="overflow-hidden rounded-2xl border border-gray-100 bg-gray-50 dark:border-gray-800 dark:bg-gray-900">
  105. <div class="flex items-center space-x-4 p-4">
  106. <span class="block w-5">
  107. <svg class="text-gray-400 dark:text-gray-300" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
  108. </span>
  109. <form role="search" class="w-full"><input name="search" class="h-8 w-full bg-transparent text-gray-600 placeholder-gray-400 focus:outline-none dark:text-gray-200 dark:placeholder-gray-500" autocomplete="off" role="combobox" spellcheck="false" aria-expanded="true" aria-controls="kbar-listbox" aria-activedescendant="kbar-listbox-item-1" placeholder="<?php echo i18n('type_to_search');?>" value=""></form>
  110. <button class="z-80 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400 search-close" aria-label="Toggle Menu">
  111. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
  112. <path
  113. fill-rule="evenodd"
  114. d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
  115. clip-rule="evenodd"
  116. ></path>
  117. </svg>
  118. </button>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="fixed bottom-8 right-8 hidden flex-col gap-3" id="scroll-up">
  125. <button aria-label="Scroll To Top" class="rounded-full bg-gray-200 p-2 text-gray-500 transition-all hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600">
  126. <a href="#"><svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  127. <path fill-rule="evenodd" d="M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
  128. </svg></a>
  129. </button>
  130. </div>
  131. <script>
  132. var mybutton = document.getElementById("scroll-up");
  133. window.onscroll = function () {
  134. if (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200) {
  135. mybutton.style.display = "flex";
  136. mybutton.style.opacity = "1";
  137. } else {
  138. mybutton.style.display = "none";
  139. mybutton.style.opacity = "0";
  140. }
  141. };
  142. </script>
  143. <script>
  144. var html = document.getElementById("html-id");
  145. document.getElementById("theme-toggle").addEventListener("click", () => {
  146. if (html.className.includes("dark")) {
  147. html.classList.remove('dark');
  148. html.classList.add('light');
  149. localStorage.setItem("tw-theme", 'light');
  150. } else {
  151. html.classList.remove('light');
  152. html.classList.add('dark');
  153. localStorage.setItem("tw-theme", 'dark');
  154. }
  155. })
  156. </script>
  157. <script src="<?php echo theme_path();?>js/functions.js"></script>
  158. <?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
  159. </body>
  160. </html>