index.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1" />
  6. <meta name="theme-color" content="#f76c5d" />
  7. <meta name="description" content="ArozOS Photo" />
  8. <link rel="manifest" crossorigin="use-credentials" href="manifest.json">
  9. <title>Photo</title>
  10. <link rel="stylesheet" href="../script/semantic/semantic.min.css">
  11. <script src="../script/alpine.min.js"></script>
  12. <script src="../script/jquery.min.js"></script>
  13. <script src="../script/semantic/semantic.min.js"></script>
  14. <script src="../script/ao_module.js"></script>
  15. <style>
  16. @media only screen and (min-width: 850px) {
  17. #menu {
  18. flex: 1;
  19. max-width: 200px;
  20. min-width: 200px;
  21. height: 100vh;
  22. display: block;
  23. }
  24. #showmenuBtn {
  25. display: none;
  26. }
  27. }
  28. @media only screen and (max-width: 850px) {
  29. #menu {
  30. display: none;
  31. height: 100vh;
  32. }
  33. #showmenuBtn {
  34. position: fixed;
  35. bottom: 1.8em;
  36. left: 1em;
  37. }
  38. }
  39. #display {
  40. flex: 1;
  41. margin: 0 0;
  42. height: 100vh;
  43. }
  44. #main {
  45. display: flex;
  46. }
  47. body {
  48. overflow: hidden;
  49. }
  50. .imagecard{
  51. border: 1px solid transparent;
  52. }
  53. .imagecard img{
  54. width: 100%;
  55. }
  56. #viewbox{
  57. margin-left: 0px !important;
  58. margin-top: 0px !important;
  59. position: relative;
  60. }
  61. #viewboxContainer{
  62. height: 100%;
  63. overflow-y: auto;
  64. overflow-x: hidden;
  65. }
  66. #fadeplate{
  67. position: absolute;
  68. top: 0px;
  69. left: 0px;
  70. width: 100%;
  71. height: 100%;
  72. background: rgba(20,20,20,0.8);
  73. backdrop-filter: blur(2px);
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <script src="photo.js"></script>
  79. <div id="main" x-data='photoListObject()'>
  80. <div class="ui left vertical menu" id="menu">
  81. <div class="item" style="background-color: #f76c5d;">
  82. <img class="ui fluid image" src="img/banner.png">
  83. </div>
  84. <div class="item">
  85. Browse Photos
  86. <div class="menu">
  87. <template x-for="vroot in vroots" x-init="getRootInfo()">
  88. <a class="item" :rootpath="vroot[1]" x-on:click="updateRenderingPath(vroot[2]);"><i class="ui disk icon"></i> <span x-text="vroot[0] + ' (' + vroot[1] + ')'"></span></a>
  89. </template>
  90. </div>
  91. </div>
  92. <a id="parentFolderButton" class="item" x-on:click="parentFolder();" style="display:none;">
  93. <i class="reply icon"></i> Parent Folder
  94. </a>
  95. <div class="item">
  96. Sub Folders
  97. <div class="menu" style="max-height: 200px; overflow-y: auto;">
  98. <div class="item" id="nosubfolder" style="display:none;">No Sub Folders</div>
  99. <template x-for="folder in folders">
  100. <a class="item" x-on:click="updateRenderingPath(folder);" ><i class="ui folder open icon"></i> <span x-text="extractFolderName(folder);"></span></a>
  101. </template>
  102. </div>
  103. </div>
  104. <div class="item">
  105. Tags
  106. <div class="menu" >
  107. <div style="max-height: 200px; overflow-y: auto;">
  108. <template x-for="key in Object.keys(tags)">
  109. <a class="item" x-on:click="console.log( tags[key][0],tags[key][1]); images = tags[key];" :filedata="encodeURIComponent(JSON.stringify(tags[key]));" ><i class="ui hashtag icon"></i> <span x-text="key"></span></a>
  110. </template>
  111. </div>
  112. <a class="item" onclick="rescan(this);">Rescan <i class="ui search icon"></i></a>
  113. </div>
  114. </div>
  115. </div>
  116. <div id="display" x-init="init()">
  117. <div id="noimg" class="ui basic segment" style="display:none;">
  118. <h4 class="ui header">
  119. <i class="red question icon"></i>
  120. <div class="content">
  121. Empty Folder
  122. <div class="sub header">There are no photo stored in <span x-text="currentPath + '/'"></span></div>
  123. </div>
  124. </h4>
  125. </div>
  126. <div id="viewboxContainer">
  127. <div id="viewbox" class="ui six cards viewbox">
  128. <template x-for="image in images">
  129. <div class="imagecard" style="cursor: pointer;" x-on:click="showImage($el);" :style="{width: renderSize + 'px', height: renderSize + 'px'}" :filedata="encodeURIComponent(JSON.stringify({'filename':image.split('/').pop(),'filepath':image}))">
  130. <a class="image" x-init="updateImageSizes();">
  131. <img :src="'../system/file_system/loadThumbnail?bytes=true&vpath=' + image">
  132. </a>
  133. </div>
  134. </template>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <button id="showmenuBtn" class="ui basic big icon button" onclick="toggleMenu();"><i class="ui content icon"></i></button>
  140. <!-- Photo Viewing Modal -->
  141. <div class="ui basic small modal">
  142. <i class="close icon" style="margin-top: -2em;"></i>
  143. <div class="image content">
  144. <img id="fullImage" class="ui fluid image" src="" onload="ShowModal();"/>
  145. </div>
  146. </div>
  147. </body>
  148. <script>
  149. //Calculate image size on document ready
  150. $(window).on("resize ", function() {
  151. //check if the menu is opened
  152. if (window.innerWidth < 850) {
  153. $('#menu').slideUp('fast',function(){
  154. });
  155. }
  156. if (window.innerWidth >= 850) {
  157. $('#menu').slideDown('fast',function(){
  158. });
  159. }
  160. updateImageSizes();
  161. });
  162. function toggleMenu(){
  163. $('#menu').toggle('fast',function(){
  164. updateImageSizes();
  165. setTimeout(function(){
  166. updateImageSizes();
  167. }, 100);
  168. });
  169. }
  170. </script>
  171. </html>