index.html 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  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,user-scalable=yes" />
  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. <script src="constants.js"></script>
  16. <script src="histogram.js"></script>
  17. <script src="photo.js"></script>
  18. <style>
  19. #main {
  20. display: flex;
  21. flex-direction: column;
  22. height: 100vh;
  23. }
  24. #menu {
  25. flex: 0 0 auto;
  26. width: 100%;
  27. height: auto;
  28. margin-left: 0.4em;
  29. margin-top: 0.4em;
  30. }
  31. #path-selector {
  32. display: none;
  33. }
  34. #content-area {
  35. flex: 1;
  36. display: flex;
  37. flex-direction: row;
  38. min-height: 0;
  39. overflow: hidden;
  40. }
  41. #sidebar {
  42. width: 210px;
  43. min-width: 210px;
  44. background: #1e1e1e;
  45. border-right: 1px solid #333;
  46. overflow-y: auto;
  47. overflow-x: hidden;
  48. display: flex;
  49. flex-direction: column;
  50. flex-shrink: 0;
  51. padding-top: 3em;
  52. }
  53. /* Hide the top menu bar on desktop — only needed for mobile toggle */
  54. @media (min-width: 769px) {
  55. #menu {
  56. display: none;
  57. }
  58. #sidebar {
  59. padding-top: 0.4em;
  60. }
  61. }
  62. .sidebar-section {
  63. padding: 0.75em 0.5em 0.4em 0.5em;
  64. }
  65. .sidebar-section-title {
  66. font-size: 0.68em;
  67. text-transform: uppercase;
  68. letter-spacing: 0.12em;
  69. color: #555;
  70. padding: 0 0.4em;
  71. margin-bottom: 0.4em;
  72. }
  73. .sidebar-item {
  74. display: flex;
  75. align-items: center;
  76. padding: 0.38em 0.6em;
  77. border-radius: 5px;
  78. cursor: pointer;
  79. color: #aaa;
  80. font-size: 0.87em;
  81. white-space: nowrap;
  82. overflow: hidden;
  83. text-overflow: ellipsis;
  84. text-decoration: none;
  85. margin: 1px 0.3em;
  86. user-select: none;
  87. }
  88. .sidebar-item:hover {
  89. background: #2a2a2a;
  90. color: #fff;
  91. }
  92. .sidebar-item.active {
  93. color: #f76c5d;
  94. background: rgba(247, 108, 93, 0.12);
  95. }
  96. .sidebar-item.disk-root {
  97. color: #888;
  98. cursor: default;
  99. }
  100. .sidebar-item i {
  101. flex-shrink: 0;
  102. margin-right: 0.6em;
  103. margin-top: -8px;
  104. width: 1em;
  105. text-align: center;
  106. }
  107. .sidebar-banner {
  108. margin-top: auto;
  109. padding: 1em 0.8em;
  110. border-top: 1px solid #2a2a2a;
  111. flex-shrink: 0;
  112. }
  113. .sidebar-banner img {
  114. max-width: 100%;
  115. max-height: 42px;
  116. opacity: 1;
  117. }
  118. .sidebar-divider {
  119. height: 1px;
  120. background: #2a2a2a;
  121. margin: 0.3em 0.8em;
  122. }
  123. .sidebar-select {
  124. width: 100%;
  125. background: #252525;
  126. color: #bbb;
  127. border: 1px solid #3a3a3a;
  128. border-radius: 5px;
  129. padding: 0.45em 2em 0.45em 0.7em;
  130. font-size: 0.87em;
  131. cursor: pointer;
  132. outline: none;
  133. appearance: none;
  134. -webkit-appearance: none;
  135. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23777' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  136. background-repeat: no-repeat;
  137. background-position: right 0.7em center;
  138. background-size: 0.65em;
  139. box-sizing: border-box;
  140. transition: border-color 0.15s, color 0.15s;
  141. }
  142. .sidebar-select:hover,
  143. .sidebar-select:focus {
  144. border-color: #f76c5d;
  145. color: #fff;
  146. outline: none;
  147. }
  148. .sidebar-select option {
  149. background: #252525;
  150. color: #bbb;
  151. }
  152. #sidebar-overlay {
  153. display: none;
  154. }
  155. @media (max-width: 768px) {
  156. /* Keep the top menu bar above the sidebar so the toggle button is always clickable */
  157. #menu {
  158. position: relative;
  159. z-index: 201;
  160. }
  161. #sidebar {
  162. position: fixed;
  163. top: 0;
  164. left: 0;
  165. height: 100%;
  166. z-index: 200;
  167. transform: translateX(-100%);
  168. transition: transform 0.25s ease;
  169. box-shadow: 3px 0 12px rgba(0,0,0,0.6);
  170. }
  171. #sidebar.open {
  172. transform: translateX(0);
  173. }
  174. #sidebar-toggle-btn {
  175. display: flex !important;
  176. }
  177. #sidebar-overlay {
  178. position: fixed;
  179. top: 0; left: 0;
  180. width: 100%; height: 100%;
  181. background: rgba(0,0,0,0.5);
  182. z-index: 199;
  183. }
  184. }
  185. #display {
  186. flex: 1;
  187. margin: 0;
  188. overflow: hidden;
  189. background: #1a1a1a;
  190. min-width: 0;
  191. }
  192. body {
  193. overflow: hidden;
  194. background: #1a1a1a;
  195. color: #ffffff;
  196. }
  197. .imagecard{
  198. border: 1px solid #444;
  199. overflow: hidden;
  200. }
  201. .imagecard img{
  202. width: 100%;
  203. height: 100%;
  204. object-fit: cover;
  205. object-position: center;
  206. }
  207. #viewbox{
  208. margin-left: 0px !important;
  209. margin-top: 0px !important;
  210. position: relative;
  211. }
  212. #viewboxContainer{
  213. height: 100%;
  214. overflow-y: auto;
  215. overflow-x: hidden;
  216. }
  217. #fadeplate{
  218. position: absolute;
  219. top: 0px;
  220. left: 0px;
  221. width: 100%;
  222. height: 100%;
  223. background: rgba(20,20,20,0.8);
  224. backdrop-filter: blur(2px);
  225. }
  226. #noimg {
  227. text-align: center;
  228. margin: 2em auto;
  229. max-width: 400px;
  230. color: white;
  231. }
  232. #noimg .sub.header {
  233. color: #cccccc;
  234. }
  235. .photo-viewer {
  236. position: fixed;
  237. top: 0;
  238. left: 0;
  239. width: 100%;
  240. height: 100%;
  241. background: rgba(0, 0, 0, 0.95);
  242. z-index: 1000;
  243. display: none;
  244. }
  245. .viewer-content {
  246. display: flex;
  247. height: 100%;
  248. position: relative;
  249. }
  250. .viewer-bg {
  251. position: absolute;
  252. top: 0;
  253. left: 0;
  254. width: 100%;
  255. height: 100%;
  256. z-index: 1;
  257. }
  258. .viewer-bg img {
  259. width: 100%;
  260. height: 100%;
  261. object-fit: cover;
  262. filter: blur(20px);
  263. }
  264. .viewer-left, .viewer-right {
  265. z-index: 2;
  266. position: relative;
  267. }
  268. .viewer-left {
  269. flex: 1;
  270. display: flex;
  271. align-items: center;
  272. justify-content: center;
  273. padding: 20px;
  274. overflow: hidden;
  275. cursor: grab;
  276. position: relative;
  277. }
  278. .viewer-left img {
  279. max-width: 100%;
  280. max-height: 100%;
  281. object-fit: contain;
  282. transition: transform 0.1s ease-out;
  283. cursor: auto;
  284. user-select: none;
  285. }
  286. #compressedImage {
  287. position: absolute;
  288. top: 50%;
  289. left: 50%;
  290. transform: translate(-50%, -50%);
  291. opacity: 1;
  292. transition: opacity 0.3s ease-out;
  293. z-index: 2;
  294. }
  295. #compressedImage.hidden {
  296. opacity: 0;
  297. pointer-events: none;
  298. }
  299. .viewer-left img.zoomed {
  300. max-width: none;
  301. max-height: none;
  302. cursor: grab;
  303. }
  304. .viewer-left img.dragging {
  305. cursor: grabbing;
  306. }
  307. .viewer-right {
  308. width: 350px;
  309. background: rgba(40, 40, 40,0.6);
  310. padding: 20px;
  311. color: white;
  312. overflow-y: auto;
  313. }
  314. .info-panel h3 {
  315. margin-top: 0;
  316. color: #f76c5d;
  317. }
  318. .info-panel h4 {
  319. margin-top: 20px;
  320. margin-bottom: 10px;
  321. color: #f76c5d;
  322. }
  323. .info-panel h5 {
  324. margin-top: 15px;
  325. margin-bottom: 5px;
  326. color: #cccccc;
  327. font-size: 0.9em;
  328. font-weight: bold;
  329. text-transform: uppercase;
  330. letter-spacing: 0.5px;
  331. }
  332. .info-panel table {
  333. width: 100%;
  334. margin-bottom: 10px;
  335. }
  336. .info-panel .exif-section-table {
  337. margin-bottom: 15px;
  338. }
  339. .info-panel td {
  340. word-wrap: break-word;
  341. overflow-wrap: break-word;
  342. hyphens: auto;
  343. padding: 6px 4px;
  344. font-size: 0.9em;
  345. }
  346. .info-panel td:first-child {
  347. font-weight: bold;
  348. width: 120px;
  349. white-space: nowrap;
  350. color: #cccccc;
  351. }
  352. .info-panel td:last-child {
  353. word-break: break-all;
  354. }
  355. .close-btn {
  356. position: absolute;
  357. top: 1em;
  358. right: 1em;
  359. background: #222222;
  360. color: white;
  361. border: none;
  362. width: 30px;
  363. height: 30px;
  364. border-radius: 50%;
  365. cursor: pointer;
  366. font-size: 18px;
  367. line-height: 1;
  368. z-index: 500;
  369. }
  370. .close-btn.info-panel-close {
  371. display: none;
  372. }
  373. #shooting-params-section .column {
  374. padding: 0.1em !important;
  375. }
  376. #shooting-params-section .propertiesLabel {
  377. border: 1px solid #c0c0c0 !important;
  378. border-radius: 0.4em !important;
  379. margin: 0.1em;
  380. padding: 0.2em 0.4em;
  381. }
  382. #shooting-params-grid{
  383. margin: 0 !important;
  384. }
  385. .show-info-btn {
  386. position: absolute;
  387. top: 1em;
  388. right: 3em;
  389. background: #222222;
  390. color: white;
  391. border: none;
  392. width: 30px;
  393. height: 30px;
  394. border-radius: 50%;
  395. cursor: pointer;
  396. font-size: 18px;
  397. line-height: 1;
  398. z-index: 500;
  399. display:none;
  400. }
  401. @media (max-width: 768px) {
  402. .viewer-right {
  403. position: fixed;
  404. right: 0;
  405. backdrop-filter: blur(10px);
  406. height: 100%;
  407. overflow-y: auto;
  408. background-color: rgba(40, 40, 40,0.8);
  409. display:none;
  410. }
  411. .close-btn {
  412. position: fixed;
  413. right: 1em;
  414. }
  415. .close-btn.info-panel-close {
  416. display: block;
  417. }
  418. .show-info-btn {
  419. display: block;
  420. }
  421. }
  422. /* Zoom Controls Styles */
  423. .zoom-controls {
  424. position: absolute;
  425. bottom: 20px;
  426. left: 20px;
  427. display: flex;
  428. flex-direction: column;
  429. gap: 8px;
  430. z-index: 10;
  431. }
  432. .zoom-btn {
  433. background: rgba(0, 0, 0, 0.7);
  434. color: white;
  435. border: 1px solid rgba(255, 255, 255, 0.2);
  436. width: 40px;
  437. height: 40px;
  438. border-radius: 4px;
  439. cursor: pointer;
  440. font-size: 20px;
  441. font-weight: bold;
  442. transition: all 0.2s;
  443. display: flex;
  444. align-items: center;
  445. justify-content: center;
  446. backdrop-filter: blur(4px);
  447. }
  448. .zoom-btn:hover {
  449. background: rgba(247, 108, 93, 0.9);
  450. border-color: #f76c5d;
  451. }
  452. .zoom-btn:active {
  453. transform: scale(0.95);
  454. }
  455. .zoom-level-indicator {
  456. background: rgba(0, 0, 0, 0.7);
  457. color: white;
  458. padding: 6px 10px;
  459. border-radius: 4px;
  460. font-size: 12px;
  461. text-align: center;
  462. backdrop-filter: blur(4px);
  463. border: 1px solid rgba(255, 255, 255, 0.2);
  464. }
  465. /* Navigation Controls Styles */
  466. .nav-controls {
  467. position: absolute;
  468. bottom: 20px;
  469. right: 20px;
  470. display: flex;
  471. flex-direction: row;
  472. gap: 8px;
  473. z-index: 10;
  474. }
  475. .nav-btn {
  476. background: rgba(0, 0, 0, 0.7);
  477. color: white;
  478. border: 1px solid rgba(255, 255, 255, 0.2);
  479. width: 40px;
  480. height: 40px;
  481. border-radius: 4px;
  482. cursor: pointer;
  483. font-size: 20px;
  484. font-weight: bold;
  485. transition: all 0.2s;
  486. display: flex;
  487. align-items: center;
  488. justify-content: center;
  489. backdrop-filter: blur(4px);
  490. }
  491. .nav-btn:hover:not(:disabled) {
  492. background: rgba(247, 108, 93, 0.9);
  493. border-color: #f76c5d;
  494. }
  495. .nav-btn:active:not(:disabled) {
  496. transform: scale(0.95);
  497. }
  498. .nav-btn:disabled {
  499. opacity: 0.3;
  500. cursor: not-allowed;
  501. }
  502. @media (max-width: 768px) {
  503. .zoom-snackbar {
  504. display: none !important;
  505. }
  506. .zoom-controls {
  507. display: none !important;
  508. }
  509. .viewer-left {
  510. cursor: default;
  511. touch-action: auto;
  512. }
  513. .viewer-left img {
  514. cursor: default;
  515. }
  516. }
  517. /* Loading Progress Indicator */
  518. .loading-progress {
  519. position: absolute;
  520. bottom: 20px;
  521. left: 50%;
  522. transform: translateX(-50%);
  523. background: rgba(0, 0, 0, 0.7);
  524. color: white;
  525. padding: 8px 16px;
  526. border-radius: 4px;
  527. font-size: 14px;
  528. backdrop-filter: blur(4px);
  529. border: 1px solid rgba(255, 255, 255, 0.2);
  530. z-index: 10;
  531. display: none;
  532. }
  533. </style>
  534. </head>
  535. <body>
  536. <div id="main" x-data='photoListObject()' x-init="init()">
  537. <div class="ui inverted secondary small menu" id="menu">
  538. <!-- Mobile sidebar toggle (hidden on desktop via CSS) -->
  539. <a class="icon item" id="sidebar-toggle-btn" x-on:click="sidebarOpen = !sidebarOpen;" style="display:none;">
  540. <i class="ui bars large icon"></i>
  541. </a>
  542. </div>
  543. <!-- Mobile sidebar overlay -->
  544. <div id="sidebar-overlay" x-show="sidebarOpen" x-on:click="sidebarOpen = false;"></div>
  545. <div id="content-area">
  546. <!-- Sidebar folder tree -->
  547. <div id="sidebar" :class="{ 'open': sidebarOpen }">
  548. <div class="sidebar-section">
  549. <div class="sidebar-section-title">Sort By</div>
  550. <div style="padding: 0 0.4em;">
  551. <select class="sidebar-select" x-model="sortOrder" x-on:change="getFolderInfo();">
  552. <option value="smart">Natural Order</option>
  553. <option value="mostRecent">Newest First</option>
  554. <option value="leastRecent">Oldest First</option>
  555. <option value="default">Filename A→Z</option>
  556. <option value="reverse">Filename Z→A</option>
  557. <option value="smallToLarge">Size Small→Large</option>
  558. <option value="largeToSmall">Size Large→Small</option>
  559. <option value="fileTypeAsce">Extension A→Z</option>
  560. <option value="fileTypeDesc">Extension Z→A</option>
  561. </select>
  562. </div>
  563. </div>
  564. <div class="sidebar-divider"></div>
  565. <div class="sidebar-section">
  566. <div class="sidebar-section-title">Library</div>
  567. <template x-for="vroot in vroots">
  568. <a class="sidebar-item" x-on:click="updateRenderingPath(vroot[2]);">
  569. <i class="ui hdd outline icon"></i>
  570. <span x-text="vroot[0]"></span>
  571. </a>
  572. </template>
  573. </div>
  574. <div class="sidebar-divider"></div>
  575. <div class="sidebar-section">
  576. <div class="sidebar-section-title">Current Path</div>
  577. <template x-for="(seg, idx) in getPathSegments()">
  578. <a class="sidebar-item"
  579. :class="{ 'active': seg.path === currentPath, 'disk-root': seg.isDiskRoot }"
  580. :style="{ paddingLeft: (0.6 + seg.depth * 0.75) + 'em' }"
  581. x-on:click="!seg.isDiskRoot && seg.path !== currentPath && updateRenderingPath(seg.path);">
  582. <i :class="seg.isDiskRoot ? 'ui hdd outline icon' : 'ui folder icon'"></i>
  583. <span x-text="seg.name"></span>
  584. </a>
  585. </template>
  586. </div>
  587. <div x-show="folders.length > 0">
  588. <div class="sidebar-divider"></div>
  589. <div class="sidebar-section">
  590. <div class="sidebar-section-title">Subfolders</div>
  591. <template x-for="folder in folders">
  592. <a class="sidebar-item" x-on:click="updateRenderingPath(folder);">
  593. <i class="ui folder open icon"></i>
  594. <span x-text="extractFolderName(folder)"></span>
  595. </a>
  596. </template>
  597. </div>
  598. </div>
  599. <!-- Banner pinned to bottom of sidebar -->
  600. <div class="sidebar-banner">
  601. <img src="img/banner.png" alt="Photo">
  602. </div>
  603. </div><!-- /#sidebar -->
  604. <div id="display">
  605. <div id="noimg" class="ui basic inverted segment" style="display:none;">
  606. <h4 class="ui header">
  607. <div class="content">
  608. Empty Folder
  609. <div class="sub header">There are no photo stored in <span x-text="currentPath + '/'"></span></div>
  610. </div>
  611. </h4>
  612. </div>
  613. <div id="viewboxContainer">
  614. <div id="viewbox" class="ui six cards viewbox">
  615. <template x-for="image in images">
  616. <div class="imagecard" style="cursor: pointer;" x-on:click="showImage($el); ShowModal();" :style="{width: renderSize + 'px', height: renderSize + 'px'}" :filedata="encodeURIComponent(JSON.stringify({'filename':image.filepath.split('/').pop(),'filepath':image.filepath,'filesize':image.filesize}))">
  617. <a class="image" x-init="updateImageSizes();">
  618. <img :src="'../system/file_system/loadThumbnail?bytes=true&vpath=' + image.filepath">
  619. </a>
  620. </div>
  621. </template>
  622. </div>
  623. <!-- Infinite scroll sentinel -->
  624. <div id="load-more-indicator" style="text-align:center; padding: 1em; color: #aaa;" x-show="hasMoreImages">
  625. <i class="loading spinner icon"></i> Loading more photos...
  626. </div>
  627. </div>
  628. </div>
  629. </div><!-- /#content-area -->
  630. </div><!-- /#main -->
  631. <!-- Photo Viewer -->
  632. <div id="photo-viewer" class="photo-viewer">
  633. <div class="viewer-content">
  634. <div class="viewer-bg">
  635. <img id="bg-image" src="" />
  636. </div>
  637. <div class="viewer-left">
  638. <img id="compressedImage" src="" style="display: none;" />
  639. <img id="fullImage" src="img/loading.png" />
  640. <button class="close-btn" onclick="closeViewer()">×</button>
  641. <button class="show-info-btn" onclick="showInfoPanel()">ℹ</button>
  642. <!-- Loading Progress -->
  643. <div id="loading-progress" class="loading-progress"><i class="loading spinner icon"></i> Loading</div>
  644. <!-- Zoom Controls -->
  645. <div id="zoom-controls" class="zoom-controls">
  646. <button class="zoom-btn" onclick="zoomIn()" title="Zoom In">+</button>
  647. <div class="zoom-level-indicator" id="zoom-level-display">100%</div>
  648. <button class="zoom-btn" onclick="zoomOut()" title="Zoom Out">−</button>
  649. </div>
  650. <!-- Navigation Controls -->
  651. <div id="nav-controls" class="nav-controls">
  652. <button id="prev-btn" class="nav-btn" onclick="showPreviousImage()" title="Previous Photo">‹</button>
  653. <button id="next-btn" class="nav-btn" onclick="showNextImage()" title="Next Photo">›</button>
  654. </div>
  655. </div>
  656. <div class="viewer-right">
  657. <div>
  658. <button class="close-btn info-panel-close" onclick="hideInfoPanel()">×</button>
  659. </div>
  660. <div class="info-panel">
  661. <h3>Photo Information</h3>
  662. <table class="ui very basic compact table inverted">
  663. <tbody>
  664. <tr>
  665. <td><strong>Filename:</strong></td>
  666. <td><span id="info-filename"></span></td>
  667. </tr>
  668. <tr>
  669. <td><strong>Filepath:</strong></td>
  670. <td><span id="info-filepath"></span></td>
  671. </tr>
  672. <tr>
  673. <td><strong>Image Dimensions:</strong></td>
  674. <td><span id="info-dimensions">Loading...</span></td>
  675. </tr>
  676. </tbody>
  677. </table>
  678. <h4>EXIF Data</h4>
  679. <div id="exif-data">
  680. <!-- Basic Information -->
  681. <div id="basic-info-section" style="display: none;">
  682. <h5>Basic Information</h5>
  683. <table class="ui very basic compact table inverted exif-section-table">
  684. <tbody>
  685. <tr id="format-row" style="display: none;"><td>Format</td><td id="format-value"></td></tr>
  686. <tr id="dimensions-row" style="display: none;"><td>Dimensions</td><td id="dimensions-value"></td></tr>
  687. <tr id="pixels-row" style="display: none;"><td>Pixels</td><td id="pixels-value"></td></tr>
  688. <tr id="color-space-row" style="display: none;"><td>Color Space</td><td id="color-space-value"></td></tr>
  689. <tr id="shooting-time-row" style="display: none;"><td>Shooting Time</td><td id="shooting-time-value"></td></tr>
  690. <tr id="software-row" style="display: none;"><td>Software</td><td id="software-value"></td></tr>
  691. </tbody>
  692. </table>
  693. </div>
  694. <div class="ui divider" id="basic-info-divider" style="display: none;"></div>
  695. <!-- Shooting Parameters -->
  696. <div id="shooting-params-section" style="display: none;">
  697. <h5>Shooting Parameters</h5>
  698. <div id="shooting-params-grid" class="ui grid">
  699. <div class="eight wide column" id="focal-length-row" style="display: none;">
  700. <div class="propertiesLabel">
  701. <img src="img/focal.svg" alt="Focal Length Icon" style="width: 16px; height: 16px; margin-right: 5px; margin-bottom: -0.2em">
  702. <span id="focal-length-value"></span>
  703. </div>
  704. </div>
  705. <div class="eight wide column" id="aperture-row" style="display: none;">
  706. <div class="propertiesLabel">
  707. <img src="img/aperature.svg" alt="Focal Length Icon" style="width: 16px; height: 16px; margin-right: 5px; margin-bottom: -0.2em">
  708. <span id="aperture-value"></span>
  709. </div>
  710. </div>
  711. <div class="eight wide column" id="shutter-speed-row" style="display: none;">
  712. <div class="propertiesLabel">
  713. <img src="img/shutter_speed.svg" alt="Focal Length Icon" style="width: 16px; height: 16px; margin-right: 5px; margin-bottom: -0.2em">
  714. <span id="shutter-speed-value"></span>
  715. </div>
  716. </div>
  717. <div class="eight wide column" id="iso-row" style="display: none;">
  718. <div class="propertiesLabel">
  719. <img src="img/iso.svg" alt="Focal Length Icon" style="width: 16px; height: 16px; margin-right: 5px; margin-bottom: -0.2em">
  720. <span>ISO </span><span id="iso-value"></span>
  721. </div>
  722. </div>
  723. <div class="eight wide column" id="ev-row" style="display: none;">
  724. <div class="propertiesLabel">
  725. <img src="img/exposure.svg" alt="EV Icon" style="width: 16px; height: 16px; margin-right: 5px; margin-bottom: -0.25em">
  726. <span>EV </span> <span id="ev-value"></span>
  727. </div>
  728. </div>
  729. </div>
  730. </div>
  731. <div class="ui divider" id="shooting-params-divider" style="display: none;"></div>
  732. <!-- Tone Analysis -->
  733. <div id="tone-analysis-section" style="display: none;">
  734. <h5>Tone Analysis</h5>
  735. <table class="ui very basic compact table inverted exif-section-table">
  736. <tbody>
  737. <tr><td>Tone Type</td><td class="tone-type-value">Analyzing...</td></tr>
  738. <tr><td>Brightness</td><td class="brightness-value">Analyzing...</td></tr>
  739. <tr><td>Contrast</td><td class="contrast-value">Analyzing...</td></tr>
  740. <tr><td>Shadow Ratio</td><td class="shadow-ratio-value">Analyzing...</td></tr>
  741. <tr><td>Highlight Ratio</td><td class="highlight-ratio-value">Analyzing...</td></tr>
  742. <tr><td colspan="2"><canvas id="histogram-canvas" width="300" height="120" style="width: 100%; height: 120px; background: #222; margin: 10px 0; border-radius: 4px;"></canvas></td></tr>
  743. </tbody>
  744. </table>
  745. </div>
  746. <div class="ui divider" id="tone-analysis-divider" style="display: none;"></div>
  747. <!-- Device Information -->
  748. <div id="device-info-section" style="display: none;">
  749. <h5>Device Information</h5>
  750. <table class="ui very basic compact table inverted exif-section-table">
  751. <tbody>
  752. <tr id="camera-row" style="display: none;"><td>Camera</td><td id="camera-value"></td></tr>
  753. <tr id="lens-row" style="display: none;"><td>Lens</td><td id="lens-value"></td></tr>
  754. <tr id="focal-length-device-row" style="display: none;"><td>Focal Length</td><td id="focal-length-device-value"></td></tr>
  755. <tr id="max-aperture-row" style="display: none;"><td>Max Aperture</td><td id="max-aperture-value"></td></tr>
  756. </tbody>
  757. </table>
  758. </div>
  759. <div class="ui divider" id="device-info-divider" style="display: none;"></div>
  760. <!-- Shooting Mode -->
  761. <div id="shooting-mode-section" style="display: none;">
  762. <h5>Shooting Mode</h5>
  763. <table class="ui very basic compact table inverted exif-section-table">
  764. <tbody>
  765. <tr id="exposure-program-row" style="display: none;"><td>Exposure Program</td><td id="exposure-program-value"></td></tr>
  766. <tr id="exposure-mode-row" style="display: none;"><td>Exposure Mode</td><td id="exposure-mode-value"></td></tr>
  767. <tr id="metering-mode-row" style="display: none;"><td>Metering Mode</td><td id="metering-mode-value"></td></tr>
  768. <tr id="white-balance-row" style="display: none;"><td>White Balance</td><td id="white-balance-value"></td></tr>
  769. <tr id="flash-row" style="display: none;"><td>Flash</td><td id="flash-value"></td></tr>
  770. <tr id="scene-capture-row" style="display: none;"><td>Scene Capture Type</td><td id="scene-capture-value"></td></tr>
  771. </tbody>
  772. </table>
  773. </div>
  774. <div class="ui divider" id="shooting-mode-divider" style="display: none;"></div>
  775. <!-- Technical Parameters -->
  776. <div id="technical-params-section" style="display: none;">
  777. <h5>Technical Parameters</h5>
  778. <table class="ui very basic compact table inverted exif-section-table">
  779. <tbody>
  780. <tr id="shutter-speed-tech-row" style="display: none;"><td>Shutter Speed</td><td id="shutter-speed-tech-value"></td></tr>
  781. <tr id="aperture-value-row" style="display: none;"><td>Aperture Value</td><td id="aperture-value-value"></td></tr>
  782. <tr id="focal-plane-res-row" style="display: none;"><td>Focal Plane Resolution</td><td id="focal-plane-res-value"></td></tr>
  783. </tbody>
  784. </table>
  785. </div>
  786. <!-- No EXIF data message -->
  787. <div id="no-exif-message" style="display: none;">
  788. <p>No EXIF data available</p>
  789. </div>
  790. </div>
  791. </div>
  792. </div>
  793. </div>
  794. </div>
  795. </body>
  796. <script>
  797. //Calculate image size on document ready
  798. $(window).on("resize ", function() {
  799. updateImageSizes();
  800. // Show info panel when resizing to desktop width (> 768px)
  801. if (window.innerWidth > 768) {
  802. const infoPanel = document.querySelector('.viewer-right');
  803. if (infoPanel && infoPanel.style.display === 'none') {
  804. showInfoPanel();
  805. }
  806. }
  807. });
  808. function hideInfoPanel() {
  809. document.querySelector('.viewer-right').style.display = 'none';
  810. }
  811. function showInfoPanel() {
  812. document.querySelector('.viewer-right').style.display = 'block';
  813. }
  814. // Navigation functionality
  815. function showPreviousImage() {
  816. if (typeof prePhoto !== 'undefined' && prePhoto != null) {
  817. showImage(prePhoto);
  818. }
  819. }
  820. function showNextImage() {
  821. if (typeof nextPhoto !== 'undefined' && nextPhoto != null) {
  822. showImage(nextPhoto);
  823. }
  824. }
  825. function updateNavigationButtons() {
  826. const prevBtn = document.getElementById('prev-btn');
  827. const nextBtn = document.getElementById('next-btn');
  828. if (prevBtn) {
  829. prevBtn.disabled = (typeof prePhoto === 'undefined' || prePhoto == null || !$(prePhoto).hasClass("imagecard"));
  830. }
  831. if (nextBtn) {
  832. nextBtn.disabled = (typeof nextPhoto === 'undefined' || nextPhoto == null || !$(nextPhoto).hasClass("imagecard"));
  833. }
  834. }
  835. // Zoom and Pan functionality
  836. let zoomLevel = 1;
  837. let panX = 0;
  838. let panY = 0;
  839. let isDragging = false;
  840. let lastMouseX = 0;
  841. let lastMouseY = 0;
  842. let initialDistance = 0;
  843. let initialZoom = 1;
  844. function resetZoom() {
  845. zoomLevel = 1;
  846. panX = 0;
  847. panY = 0;
  848. updateImageTransform();
  849. document.getElementById('fullImage').classList.remove('zoomed');
  850. }
  851. function updateImageTransform() {
  852. const img = document.getElementById('fullImage');
  853. const controls = document.getElementById('zoom-controls');
  854. const zoomDisplay = document.getElementById('zoom-level-display');
  855. if (zoomLevel > 1) {
  856. img.style.transform = `scale(${zoomLevel}) translate(${panX}px, ${panY}px)`;
  857. img.classList.add('zoomed');
  858. } else {
  859. img.style.transform = 'none';
  860. img.classList.remove('zoomed');
  861. panX = 0;
  862. panY = 0;
  863. }
  864. // Always show zoom controls and update display
  865. zoomDisplay.textContent = Math.round(zoomLevel * 100) + '%';
  866. controls.style.display = 'flex';
  867. }
  868. function zoomIn() {
  869. const img = document.getElementById('fullImage');
  870. const rect = img.getBoundingClientRect();
  871. const centerX = rect.left + rect.width / 2;
  872. const centerY = rect.top + rect.height / 2;
  873. let newZoom = Math.min(3, zoomLevel + 0.2);
  874. zoomAtPoint(newZoom, centerX, centerY);
  875. }
  876. function zoomOut() {
  877. const img = document.getElementById('fullImage');
  878. const rect = img.getBoundingClientRect();
  879. const centerX = rect.left + rect.width / 2;
  880. const centerY = rect.top + rect.height / 2;
  881. let newZoom = Math.max(1, zoomLevel - 0.2);
  882. zoomAtPoint(newZoom, centerX, centerY);
  883. }
  884. function zoomAtPoint(scale, centerX, centerY) {
  885. const img = document.getElementById('fullImage');
  886. const rect = img.getBoundingClientRect();
  887. const containerRect = img.parentElement.getBoundingClientRect();
  888. // Calculate the point relative to the image center
  889. const x = (centerX - rect.left) / rect.width - 0.5;
  890. const y = (centerY - rect.top) / rect.height - 0.5;
  891. // Calculate the zoom factor
  892. const newZoom = Math.max(1, Math.min(5, scale));
  893. if (newZoom !== zoomLevel) {
  894. // Adjust pan to keep the zoom point fixed
  895. const zoomFactor = newZoom / zoomLevel;
  896. panX = panX * zoomFactor - x * (newZoom - 1) * 50;
  897. panY = panY * zoomFactor - y * (newZoom - 1) * 50;
  898. zoomLevel = newZoom;
  899. constrainPan();
  900. updateImageTransform();
  901. }
  902. }
  903. function constrainPan() {
  904. const img = document.getElementById('fullImage');
  905. const rect = img.getBoundingClientRect();
  906. const containerRect = img.parentElement.getBoundingClientRect();
  907. const maxPanX = Math.max(0, (rect.width * zoomLevel - containerRect.width) / 2 / zoomLevel * 100);
  908. const maxPanY = Math.max(0, (rect.height * zoomLevel - containerRect.height) / 2 / zoomLevel * 100);
  909. panX = Math.max(-maxPanX, Math.min(maxPanX, panX));
  910. panY = Math.max(-maxPanY, Math.min(maxPanY, panY));
  911. }
  912. // Initialize zoom and pan when photo viewer is shown
  913. function initZoomPan() {
  914. const img = document.getElementById('fullImage');
  915. const container = document.querySelector('.viewer-left');
  916. const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  917. // Reset zoom state
  918. resetZoom();
  919. // Only enable custom zoom/pan on desktop
  920. if (!isMobile) {
  921. let handleMouseDown = function(e) {
  922. if (zoomLevel > 1) {
  923. e.preventDefault();
  924. isDragging = true;
  925. lastMouseX = e.clientX;
  926. lastMouseY = e.clientY;
  927. img.classList.add('dragging');
  928. }
  929. };
  930. let handleMouseMove = function(e) {
  931. if (isDragging && zoomLevel > 1) {
  932. const deltaX = e.clientX - lastMouseX;
  933. const deltaY = e.clientY - lastMouseY;
  934. panX += deltaX / zoomLevel;
  935. panY += deltaY / zoomLevel;
  936. constrainPan();
  937. updateImageTransform();
  938. lastMouseX = e.clientX;
  939. lastMouseY = e.clientY;
  940. }
  941. };
  942. let handleMouseUp = function() {
  943. if (isDragging) {
  944. isDragging = false;
  945. img.classList.remove('dragging');
  946. }
  947. };
  948. // Remove existing listeners to prevent double triggering
  949. img.removeEventListener('mousedown', handleMouseDown);
  950. document.removeEventListener('mousemove', handleMouseMove);
  951. document.removeEventListener('mouseup', handleMouseUp);
  952. // Add listeners back
  953. img.addEventListener('mousedown', handleMouseDown);
  954. document.addEventListener('mousemove', handleMouseMove);
  955. document.addEventListener('mouseup', handleMouseUp);
  956. }
  957. }
  958. // Initialize zoom and pan when modal is shown
  959. const originalShowModal = ShowModal;
  960. ShowModal = function() {
  961. originalShowModal();
  962. // Wait a bit for the image to load, then initialize zoom/pan
  963. setTimeout(initZoomPan, 100);
  964. };
  965. </script>
  966. </html>