index.html 7.4 KB

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