base.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. {% load static %}
  2. <!doctype html>
  3. <html lang="en">
  4. <head>
  5. <link rel="icon" href="{% static 'fontawesome-free-5.15.3-web/svgs/solid/underline.svg' %}">
  6. <meta charset="utf-8">
  7. <meta name="keywords" content="youtube, playlists, videos, delete videos, delete playlists, delete multiple videos, move multiple videos, merge playlists, video manager, playlist manager, youtube playlists, untube, google">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <meta name="description" content="UnTube is a simple Youtube playlist manager. Modify and keep track of your YouTube playlists with ease.">
  10. <meta name="author" content="Mohammed Abu Bakar Khan">
  11. <title>UnTube - A Youtube Playlist Manager</title>
  12. <style type="text/css">
  13. html {
  14. scroll-behavior: smooth;
  15. }
  16. body {
  17. margin: 0;
  18. {% if user.profile.enable_gradient_bg %}
  19. background: linear-gradient(-45deg, #e2b968, #68af5b, #8a97bc, #d69ab2);
  20. background-size: 400% 400%;
  21. animation: gradient 10s ease infinite;
  22. {% endif %}
  23. //background: linear-gradient(-45deg, #B2A3FF, #84bcf3, #AE876B, #B0E7AE);
  24. //background: linear-gradient(-45deg, #0645a4, #2480cd, #84bcf3, #b7d6f7);
  25. //background: linear-gradient(-45deg, #AE876B, #ABA27B, #A7BC8A, #A3D69A);
  26. }
  27. .gradient-bg {
  28. background: linear-gradient(-45deg, #AE876B, #ABA27B, #A7BC8A, #A3D69A);
  29. background-size: 400% 400%;
  30. animation: gradient 10s ease infinite;
  31. }
  32. .gradient-bg-2 {
  33. background: linear-gradient(-45deg, #e2b968, #68af5b, #8a97bc, #d69ab2);
  34. background-size: 400% 400%;
  35. animation: gradient 10s ease infinite;
  36. }
  37. .gradient-bg-3 {
  38. background: linear-gradient(-45deg, #B2A3FF, #84bcf3, #AE876B, #B0E7AE);;
  39. background-size: 400% 400%;
  40. animation: gradient 10s ease infinite;
  41. }
  42. @keyframes gradient {
  43. 0% {
  44. background-position: 0% 50%;
  45. }
  46. 50% {
  47. background-position: 100% 50%;
  48. }
  49. 100% {
  50. background-position: 0% 50%;
  51. }
  52. }
  53. .scrollToTopBtn {
  54. background-color: black;
  55. border: none;
  56. border-radius: 50%;
  57. color: white;
  58. cursor: pointer;
  59. font-size: 16px;
  60. line-height: 58px;
  61. width: 58px;
  62. /* place it at the bottom right corner */
  63. position: relative;
  64. bottom: 20px;
  65. right: 0px;
  66. left: 30px;
  67. /* hide with opacity */
  68. opacity: 0;
  69. /* also add a translate effect */
  70. transform: translateY(100px);
  71. /* and a transition */
  72. transition: all .5s ease
  73. }
  74. .showBtn {
  75. opacity: 1;
  76. transform: translateY(0)
  77. }
  78. #btn-back-to-top {
  79. display: none; /* Hidden by default */
  80. position: fixed; /* Fixed/sticky position */
  81. bottom: 20px; /* Place the button at the bottom of the page */
  82. right: 30px; /* Place the button 30px from the right */
  83. z-index: 99999; /* Make sure it does not overlap */
  84. border: none; /* Remove borders */
  85. outline: none; /* Remove outline */
  86. background-color: red; /* Set a background color */
  87. color: white; /* Text color */
  88. cursor: pointer; /* Add a mouse pointer on hover */
  89. padding: 15px; /* Some padding */
  90. border-radius: 10px; /* Rounded corners */
  91. font-size: 18px; /* Increase font size */
  92. }
  93. #btn-back-to-top:hover {
  94. background-color: #555; /* Add a dark-grey background on hover */
  95. }
  96. .big-checkbox {width: 30px; height: 30px;}
  97. </style>
  98. <link rel="preconnect" href="https://fonts.googleapis.com">
  99. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  100. <link href="https://fonts.googleapis.com/css2?family=Comfortaa&family=Fredoka+One&display=swap" rel="stylesheet">
  101. <!--- <script src=" static 'fontawesome-free-5.15.3-web/js/all.min.js' " type="application/javascript"></script> -->
  102. <script src="https://kit.fontawesome.com/5baac7e9b7.js" crossorigin="anonymous"></script>
  103. <link href="{% static 'bootstrap5.0.1/css/bootstrap.min.css' %}" rel="stylesheet">
  104. <link rel="stylesheet" href="{% static 'choices.js/choices.min.css' %}">
  105. <script src="{% static 'htmx/htmx.min.js' %}" type="application/javascript"></script>
  106. <script src="{% static 'jquery3.6.0/js/jquery-3.6.0.min.js' %}" type="application/javascript"></script>
  107. <script src="{% static 'bootstrap5.0.1/js/bootstrap.bundle.min.js' %}" type="application/javascript"></script>
  108. </head>
  109. <body class="text-dark" style="font-family: 'Fredoka One', 'Comfortaa', sans-serif; {% if not user.profile.enable_gradient_bg %}background-color: #FDF4DC;{% endif %}">
  110. {% if user.profile.show_import_page %}
  111. <meta http-equiv="refresh" content="0;url=/import/init" />
  112. {% endif %}
  113. <nav class="navbar navbar-expand-lg navbar-light" id="navbar">
  114. <div class="container-fluid">
  115. <a class="navbar-brand" href="{% url 'home' %}"><h3><kbd>UnTube</kbd></h3></a>
  116. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  117. <span class="navbar-toggler-icon"></span>
  118. </button>
  119. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  120. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  121. <li class="nav-item">
  122. <a class="nav-link" aria-current="page" href="{% url 'home' %}">Dashboard</a>
  123. </li>
  124. <li class="nav-item dropdown">
  125. <a class="nav-link" href="{% url 'library' 'home' %}">
  126. Library
  127. </a>
  128. </li>
  129. <li class="nav-item dropdown">
  130. <a class="nav-link dropdown-toggle" href="#" id="quickViewDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  131. Quick View
  132. </a>
  133. <ul class="dropdown-menu" aria-labelledby="quickViewDropdown" style="z-index: 1021;">
  134. <li><a class="dropdown-item" href="{% url 'library' 'favorites' %}">Favorites</a></li>
  135. <li><a class="dropdown-item" href="{% url 'library' 'watching' %}">Watching</a></li>
  136. <li><a class="dropdown-item" href="{% url 'library' 'plan-to-watch' %}">Plan to Watch</a></li>
  137. <li><a class="dropdown-item" href="{% url 'library' 'user-owned' %}">Your YT Playlists</a></li>
  138. <li><a class="dropdown-item" href="{% url 'library' 'imported' %}">Imported</a></li>
  139. <li><hr class="dropdown-divider"></li>
  140. <li><a class="dropdown-item" href="{% url 'library' 'all' %}">View all</a></li>
  141. </ul>
  142. </li>
  143. <li class="nav-item">
  144. <a class="nav-link" href="{% url 'manage_view_page' 'import' %}">Import</a>
  145. </li>
  146. <li class="nav-item">
  147. <a class="nav-link" target="_blank" href="https://github.com/sleepytaco/UnTube">About</a>
  148. </li>
  149. </ul>
  150. <div class="navbar-nav justify-content-end">
  151. <!--
  152. <input class="form-control border border-secondary bg-dark text-white-50 me-lg-2 bg-dark mb-1" id="unTubeSearchBar" type="text" placeholder="Search UnTube">
  153. -->
  154. <a class="nav-link btn-lg me-1 mt-2" href="{% url 'search' %}" {% if user.profile.open_search_new_tab %}target="_blank"{% endif %}>
  155. <i class="fas fa-search"></i>
  156. </a>
  157. <li class="nav-item dropdown">
  158. <a class="nav-link dropdown-toggle" href="#" id="quickViewDropdown" role="button" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false">
  159. <img src="https://robohash.org/{{ user.username }}.png?set=set{{ user.profile.robohash_set }}" alt="{{ user.username }}" class="border border-3 border-primary rounded-circle" width="42" height="42">
  160. </a>
  161. <ul class="dropdown-menu dropdown-menu-lg-end" aria-labelledby="quickViewDropdown" style="z-index: 1021;">
  162. <li class="dropdown-item overflow-auto">Logged in as <span style="border-bottom: 3px #020000 dashed;">{{ user.username }}</span></li>
  163. <!-- <li><a class="dropdown-item" href="{% url 'profile' %}">Profile</a></li> -->
  164. <li><a class="dropdown-item" href="{% url 'settings' %}">Settings</a></li>
  165. <!-- <li><hr class="dropdown-divider"></li> -->
  166. <li><a class="dropdown-item" href="{% url 'log_out' %}">Log out</a></li>
  167. </ul>
  168. </li>
  169. </div>
  170. </div>
  171. </div>
  172. </nav>
  173. <div class="container-fluid text-dark">
  174. <div class="row">
  175. <main class="ms-lg-auto px-lg-5">
  176. {% if messages %}
  177. {% for message in messages %}
  178. <div class="alert alert-{% if message.tags == "error" %}danger{% else %}{{ message.tags }}{% endif %} alert-dismissible fade show" role="alert">
  179. {{ message }}
  180. <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  181. </div>
  182. {% endfor %}
  183. {% endif %}
  184. {% block content %}
  185. {% endblock %}
  186. </main>
  187. </div>
  188. </div>
  189. <br>
  190. <script src="{% static 'clipboard.js/clipboard.min.js' %}" type="application/javascript"></script>
  191. <script async src="https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous"></script>
  192. <script src="{% static 'choices.js/choices.min.js' %}"></script>
  193. <script type="application/javascript">
  194. // copy functionality
  195. var clipboard = new ClipboardJS('.copy-btn');
  196. // send csrf_token when htmx does a post request
  197. document.body.addEventListener('htmx:configRequest', (event) => {
  198. event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
  199. })
  200. var scrollToTopBtn = document.querySelector(".scrollToTopBtn")
  201. var rootElement = document.documentElement
  202. function handleScroll() {
  203. // Do something on scroll
  204. var scrollTotal = rootElement.scrollHeight - rootElement.clientHeight
  205. if ((rootElement.scrollTop / scrollTotal ) > 0.10) {
  206. // Show button
  207. scrollToTopBtn.classList.add("showBtn")
  208. } else {
  209. // Hide button
  210. scrollToTopBtn.classList.remove("showBtn");
  211. }
  212. }
  213. function scrollToTop() {
  214. // Scroll to top logic
  215. rootElement.scrollTo({
  216. top: 0,
  217. behavior: "smooth"
  218. })
  219. }
  220. scrollToTopBtn.addEventListener("click", scrollToTop)
  221. document.addEventListener("scroll", handleScroll)
  222. // window.onbeforeunload = function() {
  223. //return "Dude, are you sure you want to leave? Think of the kittens!";
  224. //}
  225. </script>
  226. </body>
  227. </html>