index.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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: 1200px) {
  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: 1200px) {
  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. /*
  49. overflow: hidden;
  50. */
  51. }
  52. .imagecard{
  53. border: 1px solid transparent;
  54. }
  55. .imagecard img{
  56. width: 100%;
  57. }
  58. #viewbox{
  59. margin-left: 0px !important;
  60. margin-top: 0px !important;
  61. position: relative;
  62. }
  63. #fadeplate{
  64. position: absolute;
  65. top: 0px;
  66. left: 0px;
  67. width: 100%;
  68. height: 100%;
  69. background: rgba(20,20,20,0.8);
  70. backdrop-filter: blur(2px);
  71. }
  72. </style>
  73. </head>
  74. <body>
  75. <script src="photo.js"></script>
  76. <div id="main" x-data='photoListObject()'>
  77. <div class="ui left vertical menu" id="menu">
  78. <div class="item" style="background-color: #f76c5d;">
  79. <img class="ui fluid image" src="img/banner.png">
  80. </div>
  81. <div class="item">
  82. Browse Photos
  83. <div class="menu">
  84. <template x-for="vroot in vroots" x-init="getRootInfo()">
  85. <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>
  86. </template>
  87. </div>
  88. </div>
  89. <a id="parentFolderButton" class="item" x-on:click="parentFolder();" style="display:none;">
  90. <i class="reply icon"></i> Parent Folder
  91. </a>
  92. <div class="item">
  93. Sub Folders
  94. <div class="menu">
  95. <div class="item" id="nosubfolder" style="display:none;">No Sub Folders</div>
  96. <template x-for="folder in folders">
  97. <a class="item" x-on:click="updateRenderingPath(folder);" ><i class="ui folder open icon"></i> <span x-text="extractFolderName(folder);"></span></a>
  98. </template>
  99. </div>
  100. </div>
  101. <div class="item">
  102. Tags by AI
  103. <div class="menu">
  104. <a class="active item">#a</a>
  105. <a class="item">#b</a>
  106. <a class="item">#c</a>
  107. <a class="item">See More</a>
  108. </div>
  109. </div>
  110. </div>
  111. <div id="display" x-init="init()">
  112. <div id="noimg" class="ui basic segment" style="display:none;">
  113. <h4 class="ui header">
  114. <i class="red question icon"></i>
  115. <div class="content">
  116. Empty Folder
  117. <div class="sub header">There are no photo stored in <span x-text="currentPath + '/'"></span></div>
  118. </div>
  119. </h4>
  120. </div>
  121. <div id="viewbox" class="ui six cards viewbox">
  122. <template x-for="image in images" :key="image">
  123. <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}))">
  124. <a class="image" x-init="updateImageSizes();">
  125. <img :src="'../system/file_system/loadThumbnail?bytes=true&vpath=' + image">
  126. </a>
  127. </div>
  128. </template>
  129. </div>
  130. </div>
  131. </div>
  132. <button id="showmenuBtn" class="ui basic big icon button" onclick="toggleMenu();"><i class="ui content icon"></i></button>
  133. <!-- Photo Viewing Modal -->
  134. <div class="ui basic small modal">
  135. <i class="close icon" style="margin-top: -2em;"></i>
  136. <div class="image content">
  137. <img id="fullImage" class="ui fluid image" src="" onload="ShowModal();"/>
  138. </div>
  139. </div>
  140. </body>
  141. <script>
  142. //Calculate image size on document ready
  143. $(window).on("resize ", function() {
  144. //check if the menu is opened
  145. if (window.innerWidth < 1200) {
  146. $('#menu').slideUp('fast',function(){
  147. });
  148. }
  149. if (window.innerWidth >= 1200) {
  150. $('#menu').slideDown('fast',function(){
  151. });
  152. }
  153. updateImageSizes();
  154. });
  155. function toggleMenu(){
  156. $('#menu').toggle('fast',function(){
  157. updateImageSizes();
  158. setTimeout(function(){
  159. updateImageSizes();
  160. }, 100);
  161. });
  162. }
  163. </script>
  164. </html>