index.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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.0"> -->
  6. <meta name="renderer" content="webkit">
  7. <meta name="viewport" content="width=device-width" />
  8. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  9. <title>Document</title>
  10. <style>
  11. *,
  12. *::before,
  13. *::after {
  14. margin: 0;
  15. padding: 0;
  16. box-sizing: border-box;
  17. /* -webkit-backface-visibility: hidden;
  18. -moz-backface-visibility: hidden;
  19. -ms-backface-visibility: hidden;
  20. backface-visibility: hidden; */
  21. }
  22. html,
  23. body {
  24. width: 100%;
  25. height: 100%;
  26. overflow: hidden;
  27. }
  28. html {
  29. font-size: 36px;
  30. }
  31. body {
  32. background-color: #292929;
  33. }
  34. li {
  35. left: -9999px;
  36. position: fixed;
  37. cursor: pointer;
  38. list-style: none;
  39. background-image: -webkit-linear-gradient(top, #555a5f, #efeeed);
  40. background-image: -ms-linear-gradient(top, #555a5f, #efeeed);
  41. user-select: none;
  42. z-index: 5;
  43. text-align: center;
  44. }
  45. li img {
  46. transform: scale(0.5);
  47. pointer-events: none;
  48. vertical-align: middle;
  49. transition: all .4s ease-in;
  50. }
  51. li div {
  52. display: none;
  53. width: 100%;
  54. height: 100%;
  55. }
  56. li.focus {
  57. z-index: 10 !important;
  58. }
  59. li.focus img {
  60. transform: scale(1.2);
  61. }
  62. li.l-4 {
  63. opacity: 0.3;
  64. z-index: 1;
  65. transform: scale(0.4);
  66. }
  67. li.l-3 {
  68. opacity: 0.3;
  69. z-index: 2;
  70. transform: scale(0.6);
  71. }
  72. li.l-2 {
  73. opacity: 0.9;
  74. z-index: 3;
  75. transform: scale(0.8);
  76. }
  77. li.l-1 {
  78. opacity: 1;
  79. z-index: 4;
  80. transform: scale(0.9);
  81. }
  82. li:hover {
  83. opacity: 1;
  84. transform: scale(1.4);
  85. z-index: 20;
  86. }
  87. li.click {
  88. left: 50% !important;
  89. top: 50% !important;
  90. opacity: 1;
  91. transform: translate(-50%, -50%) scale(1);
  92. z-index: 30 !important;
  93. width: 500px !important;
  94. height: 460px !important;
  95. line-height: 260px !important;
  96. border: solid 2px #fff;
  97. }
  98. li.click div {
  99. position: absolute;
  100. left: 0;
  101. top: 0;
  102. width: 100%;
  103. height: 100%;
  104. z-index: 10;
  105. display: block;
  106. }
  107. li.click img {
  108. transform: scale(0);
  109. }
  110. .panel {
  111. display: none;
  112. position: fixed;
  113. padding: 10px;
  114. left: 0;
  115. bottom: 0;
  116. width: 100%;
  117. height: 100px;
  118. background-color: #efefef;
  119. border-top: solid 1px #ccc;
  120. }
  121. iframe {
  122. width: 100%;
  123. height: 100%;
  124. }
  125. .mobile ul {
  126. transform: scale(0.3) translate(-200%)
  127. }
  128. .mobile li img {
  129. transition: none;
  130. }
  131. .mobile li:hover {
  132. opacity: 1;
  133. transform: unset;
  134. z-index: 20;
  135. }
  136. .mobile li.bigger {
  137. left: 170% !important;
  138. top: 5rem !important;
  139. opacity: 1;
  140. z-index: 30 !important;
  141. border: solid 2px #fff;
  142. width: 15rem !important;
  143. height: 15rem !important;
  144. line-height: 15rem !important;
  145. }
  146. .mobile li.bigger img {
  147. width: 80%;
  148. height: 80%;
  149. ;
  150. transform: scale(1) !important;
  151. }
  152. </style>
  153. </head>
  154. <body>
  155. <ul></ul>
  156. <script src="js/detect.mobile.js"></script>
  157. <script src="js/jquery.min.js"></script>
  158. <script src="js/jquery.easing.min.js"></script>
  159. <script src="js/model-data.js"></script>
  160. <script>
  161. var list = ModelData;
  162. var html = [];
  163. if (IsMobile()) {
  164. list = list.slice(0, 55)
  165. $('body').addClass('mobile')
  166. }
  167. list.forEach(function (item, i) {
  168. var clazz = item.clazz || '';
  169. clazz += (item.focus ? ' focus' : '')
  170. html.push('<li data-index="' + i + '" data-url="' + item.url + '" class="' + clazz +
  171. '" style="line-height:' + item.height + 'px;top:' + (item.top / 36 || 0) + 'rem;left:' + (
  172. item.left / 36 || 0) + 'rem;width:' + item.width / 36 + 'rem;height:' + item.height /
  173. 36 + 'rem">');
  174. html.push(' <img src="photos/' + item.image_small +
  175. '">');
  176. html.push(' <div></div>')
  177. html.push('</li>');
  178. })
  179. $(html.join('')).appendTo('ul');
  180. $("li").css('value', 0).css('opacity', 0).each(function (i) {
  181. var time = Math.random() * 1000;
  182. $(this).delay(time).animate({
  183. value: 1
  184. }, {
  185. step: function (n) {
  186. ry = (1 - n) * 360;
  187. tz = (1 - n) * 1000;
  188. $(this).css("transform", "rotateY(" + ry + "deg) translateZ(" + tz +
  189. "px)").css('opacity', n);
  190. if (n > .98) {
  191. $(this).css("transform", "").css("opacity", "").css("transition",
  192. "all .4s ease-in")
  193. }
  194. },
  195. duration: 3000,
  196. //some easing fun. Comes from the jquery easing plugin.
  197. easing: 'easeOutQuint',
  198. done: function () {
  199. }
  200. })
  201. })
  202. if (IsMobile()) {
  203. // $('li').click(function (e) {
  204. // $('li.click').removeClass('click')
  205. // $(this).addClass('click');
  206. // return false;
  207. // })
  208. $('li').on('touchstart', function () {
  209. $('li.bigger').removeClass('bigger')
  210. $(this).addClass('bigger');
  211. return false;
  212. })
  213. $(document).on('touchstart', function () {
  214. $('li.bigger').removeClass('bigger')
  215. })
  216. } else {
  217. $('li').click(function (e) {
  218. $('li.click').removeClass('click').find('iframe').remove();
  219. $(this).addClass('click');
  220. var $iframe = $('<iframe style="display:none" frameborder="0" src="' + $(this).data('url') +
  221. '"></iframe>').appendTo($(this).find('div'));
  222. setTimeout(function () {
  223. $iframe.css('display', 'block')
  224. }, 400);
  225. return false;
  226. })
  227. $(document).click(function () {
  228. $('li.click').removeClass('click').find('iframe').remove()
  229. })
  230. }
  231. </script>
  232. </body>
  233. </html>