home copy.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>中科在线(长春)</title>
  6. <!-- layui -->
  7. <link rel="stylesheet" href="static/home/lib/layui/css/layui.css">
  8. <link rel="stylesheet" href="static/home/css/lib.css">
  9. <link rel="stylesheet" href="static/home/css/road.css">
  10. <link rel="stylesheet" href="static/home/css/index.css">
  11. <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
  12. <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
  13. <style>
  14. .canvas-stats {
  15. display: none;
  16. }
  17. #a{
  18. position: absolute;
  19. bottom: -20px;
  20. color: #fff;
  21. right: 0;
  22. }
  23. #a:hover{
  24. cursor: pointer;
  25. }
  26. .floating{
  27. width: 350px;
  28. height: 170px;
  29. background-image: url(./static/images/fuchuang.jpg);
  30. background-repeat: no-repeat;
  31. background-size: 100% 100%;
  32. }
  33. .floating p:nth-child(1){
  34. text-align: center;
  35. font-size: 20px;
  36. font-family: cursive;
  37. font-weight: bold;
  38. /* -webkit-text-stroke: 1px #ffffff; */
  39. padding: 10px 0;
  40. color: #ffffff;
  41. }
  42. .floating p:nth-child(2){
  43. text-align: center;
  44. font-size: 32px;
  45. font-family: cursive;
  46. font-weight: bold;
  47. -webkit-text-stroke: 1px #ffc900;
  48. padding: 0px 20px 10px 20px;
  49. color: #409eff;
  50. }
  51. .floating p:nth-child(3){
  52. text-align: center;
  53. }
  54. .floating p:nth-child(3) button{
  55. border: none;
  56. padding: 5px 10px;
  57. border-radius: 25px;
  58. color: #fff;
  59. background: #409eff;
  60. }
  61. .floating p:nth-child(3) button:hover{
  62. cursor: pointer;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <div class="header">
  68. <div class='left'>
  69. <img class='image' src="static/images/logo.png" alt="">
  70. <p class='title'>中科在线(长春)</p>
  71. </div>
  72. <div class='right'>
  73. <button onclick="window.open('http://broadcast.waityou24.cn/platlive/login')">平台登录</button>
  74. <button onclick="window.open('http://broadcast.waityou24.cn/liveadmin/login')">管理登录</button>
  75. </div>
  76. </div>
  77. <img class="sci-wheel" src="static/home/images/sci.gif" alt="">
  78. <!-- 导航 -->
  79. <div class="center">
  80. <a class="list fn_1 moveUpDownFla1" href="/platlive/market/index">
  81. <p>科技超市</p>
  82. </a>
  83. <a class="list fn_2 moveUpDownFla2" href="/platlive/live/index">
  84. <p>直播大厅</p>
  85. </a>
  86. <a class="list fn_3 moveUpDownFla1" href="/platlive/dynamic/index">
  87. <p>数据动态</p>
  88. </a>
  89. <a class="list fn_4 moveUpDownFla2" href="/platlive/news/index">
  90. <p>新闻资讯</p>
  91. </a>
  92. <a class="list fn_5 moveUpDownFla2" href="/platlive/techolchat/index">
  93. <p>技术交流</p>
  94. </a>
  95. </div>
  96. <!-- 浮窗 -->
  97. <div id="floatingDiv" style="position:absolute;left:50px;top:60px;z-index: 9999;">
  98. <div id="a" onClick="javascript:this.parentNode.style.display='none';">关闭窗口</div>
  99. <div id="app" class='floating'>
  100. <p>科技引领新发展 校地合作赢未来</p>
  101. <p>{{info.title}}</p>
  102. <p><button v-on:click="noticeBtn">展会入口</button></p>
  103. </div>
  104. </div>
  105. <!--流星-->
  106. <div class="liuxing liuxing1 liuxingFla"></div>
  107. <div class="liuxing liuxing2 liuxingFla2"></div>
  108. <div class="liuxing liuxing3 liuxingFla3"></div>
  109. <div class="liuxing liuxing4 liuxingFla4"></div>
  110. <div id="canvas-container-1" class="canvas-container">
  111. <canvas id="canvas-1"></canvas>
  112. </div>
  113. <script src="static/home/js/stats.min.js"></script>
  114. <script src="static/home/js/three.min.js"></script>
  115. <script src="static/js/jquery-1.8.3.min.js"></script>
  116. <script type="text/javascript">
  117. new Vue({
  118. el: '#app',
  119. data: {
  120. info:{}
  121. },
  122. created() {
  123. this.search();
  124. },
  125. computed: {},
  126. methods: {
  127. search(){
  128. $.ajax({
  129. url: '/api/live/v0/dock/dock',
  130. type: "GET",
  131. contentType: 'application/json',
  132. success: (res)=> {
  133. if (res.errcode == '0') {
  134. let data=res.data.find(i=>i.room_id=='1008');
  135. if (data) {
  136. this.$set(this, `info`, data);
  137. }
  138. }
  139. },
  140. error: function (e) {
  141. console.error(e)
  142. }
  143. })
  144. },
  145. noticeBtn(){
  146. if (this.info.status=='1') {
  147. window.location.href = `/platlive/achieveLive/detail?dock_id=${this.info.id}`
  148. }else{
  149. alert(`展会尚未开启,展会开始时间:${this.info.start_time}!`)
  150. }
  151. }
  152. },
  153. })
  154. </script>
  155. <script>
  156. function ThreeJSCanvas(CANVAS_ID) {
  157. var SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
  158. var SCREEN_WIDTH = SCREEN_HEIGHT;
  159. var SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
  160. var canvas, container;
  161. var container, loader, stats;
  162. var renderer, camera, scene;
  163. var raycaster, controls;
  164. var ANIMATION_FRAME_LENGTH = 30,
  165. INTERACT_DISTANCE = 2.5;
  166. var objetArray = [],
  167. animationQueue = [];
  168. var color1 = [0 / 255, 110 / 255, 255 / 255],
  169. color2 = [0 / 255, 255 / 255, 140 / 255];
  170. var bitmap = [];
  171. var BITMAP_SKIP = 1;
  172. var fov = 90;
  173. var cameraPos = [0, 0, 30];
  174. var cameraLookAt = [0, 0, 0];
  175. var viewHeight = 2 * Math.tan(THREE.Math.degToRad(fov / 2)) * cameraPos[2],
  176. viewWidth = viewHeight * SCREEN_ASPECT_RATIO;
  177. var mouse = new THREE.Vector3(10000, 10000, -1),
  178. mouseScaled = new THREE.Vector3(10000, 10000, -1);
  179. var frame = 0;
  180. function init() {
  181. // Global Variables
  182. container = document.getElementById("canvas-container-" + CANVAS_ID);
  183. canvas = document.getElementById("canvas-" + CANVAS_ID);
  184. canvas.addEventListener('mousemove', onDocumentMouseMove, false);
  185. loader = new THREE.JSONLoader();
  186. stats = new Stats();
  187. stats.domElement.classList.add("canvas-stats");
  188. stats.domElement.id = "canvas-stats-" + CANVAS_ID;
  189. /* If you are familiar with python and opencv
  190. you can use this python script to generate custom bitmaps
  191. --------------------
  192. https://git.io/vdBAu
  193. --------------------
  194. */
  195. var data = '#000000000000000000011110000000000000000000' +
  196. '#000000000000000011111111110000000000000000' +
  197. '#000000000000001111111111111100000000000000' +
  198. '#000000000000011111111111111110000000000000' +
  199. '#000000000000111111111111111111000000000000' +
  200. '#000000000001111111111111111111100000000000' +
  201. '#000000000011111111111111111111110000000000' +
  202. '#000000000011111111111111111111110000000000' +
  203. '#000000000111111111111111111111111000000000' +
  204. '#000000000111111111111111111111111000000000' +
  205. '#000000001111111111111111111111111100000000' +
  206. '#000000001111111111111111111111111100000000' +
  207. '#000000001111111111111111111111111100000000' +
  208. '#000000001111111111111111111111111100000000' +
  209. '#000000001111111111111111111111111100000000' +
  210. '#000000000111111111111111111111111000000000' +
  211. '#000000000111111111111111111111111000000000' +
  212. '#000000000111111111111111111111111000000000' +
  213. '#000000000011111111111111111111110000000000' +
  214. '#000000000011111111111111111111110000000000' +
  215. '#000000000001111111111111111111100000000000' +
  216. '#000000000001111111111111111111100000000000' +
  217. '#000000000000111111111111111111000000000000' +
  218. '#000000000000111111111111111110000000000000' +
  219. '#000000000000011111111111111110000000000000' +
  220. '#000000000000001111111111111100000000000000' +
  221. '#000000000000001111111111111100000000000000' +
  222. '#000000000000001111111111111000000000000000' +
  223. '#000000000000000111111111111000000000000000' +
  224. '#000000000000000111111111111000000000000000' +
  225. '#000000000000000111111111111000000000000000' +
  226. '#000000000000000111111111111000000000000000' +
  227. '#000000000000000011111111110000000000000000' +
  228. '#000000000000000010000000010000000000000000' +
  229. '#000000000000000011111111110000000000000000' +
  230. '#000000000000000010000000010000000000000000' +
  231. '#000000000000000011111111110000000000000000' +
  232. '#000000000000000010000000010000000000000000' +
  233. '#000000000000000011111111110000000000000000' +
  234. '#000000000000000000100001000000000000000000' +
  235. '#000000000000000000110011000000000000000000' +
  236. '#000000000000000000011110000000000000000000';
  237. for (var i = 0; i < data.length; i++) {
  238. if (data[i] == '#') {
  239. bitmap.push([]);
  240. } else {
  241. bitmap[bitmap.length - 1].push(data[i] - '0');
  242. }
  243. }
  244. container.appendChild(stats.domElement);
  245. // Renderer
  246. renderer = new THREE.WebGLRenderer({
  247. alpha: true,
  248. antialias: true,
  249. canvas: canvas,
  250. });
  251. renderer.setClearColor(0x212121, 0);
  252. renderer.setPixelRatio(window.devicePixelRatio);
  253. renderer.shadowMap.enabled = true;
  254. renderer.shadowMap.type = THREE.PCFSoftShadowMap;
  255. renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
  256. // Camera and Controls
  257. camera = new THREE.PerspectiveCamera(fov, SCREEN_ASPECT_RATIO, 0.1, 1000);
  258. // camera = new THREE.OrthographicCamera(-viewWidth, viewWidth, viewHeight, -viewHeight, 1, 300);
  259. camera.position.set(cameraPos[0], cameraPos[1], cameraPos[2]);
  260. camera.lookAt(new THREE.Vector3(cameraLookAt[0], cameraLookAt[1], cameraLookAt[2]));
  261. raycaster = new THREE.Raycaster();
  262. // controls = new THREE.OrbitControls(camera);
  263. // controls.rotateSpeed = 2.0;
  264. // controls.zoomSpeed = 2.0;
  265. // controls.enableZoom = true;
  266. // controls.enablePan = true;
  267. // controls.dampingFactor = 0.2;
  268. // controls.addEventListener('change', render);
  269. //Scene
  270. scene = new THREE.Scene();
  271. //Lights
  272. // Making Object Array
  273. var xOffset = -bitmap[0].length / (BITMAP_SKIP * 2);
  274. var yOffset = bitmap.length / (BITMAP_SKIP * 2);
  275. for (var i = 0; i < bitmap.length; i += BITMAP_SKIP) {
  276. for (var j = 0; j < bitmap[i].length; j += BITMAP_SKIP) {
  277. if (bitmap[i][j] == 1) {
  278. planeGeometry = new THREE.PlaneGeometry(1, 1);
  279. var circleGeometry = new THREE.CircleGeometry(1, 5);
  280. var frac = i / bitmap.length;
  281. // Materials
  282. planeMaterial = new THREE.MeshBasicMaterial({
  283. color: new THREE.Color(
  284. color1[0] * frac + color2[0] * (1 - frac),
  285. color1[1] * frac + color2[1] * (1 - frac),
  286. color1[2] * frac + color2[2] * (1 - frac)
  287. ),
  288. transparent: true,
  289. opacity: THREE.Math.randFloat(0.4, 0.6),
  290. side: THREE.DoubleSide
  291. });
  292. var circleMaterial = new THREE.MeshBasicMaterial({
  293. color: new THREE.Color(1, 1, 1),
  294. transparent: true,
  295. opacity: THREE.Math.randFloat(0.8, 1),
  296. side: THREE.DoubleSide
  297. });
  298. // Mesh
  299. planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
  300. planeMesh.position.set(xOffset + j / BITMAP_SKIP, yOffset - i / BITMAP_SKIP, 0);
  301. var randWidth = THREE.Math.randFloat(0.6, 1.2);
  302. var randHeight = randWidth
  303. planeMesh.scale.set(randWidth, randHeight, 1);
  304. scene.add(planeMesh);
  305. objetArray.push([planeMesh, false]);
  306. circleMesh = new THREE.Mesh(circleGeometry, circleMaterial);
  307. circleMesh.position.set(xOffset + j / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), yOffset - i / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), 0.1);
  308. var randRadius = THREE.Math.randFloat(0.05, 0.1);
  309. circleMesh.scale.set(randRadius, randRadius, 1);
  310. scene.add(circleMesh);
  311. objetArray.push([circleMesh, false]);
  312. }
  313. }
  314. }
  315. //Geometry
  316. // Materials
  317. // Mesh
  318. // Helpers
  319. //Add Stuff to Scene
  320. }
  321. function animate() {
  322. requestAnimationFrame(animate);
  323. render();
  324. stats.update();
  325. // controls.update();
  326. frame++;
  327. }
  328. function render() {
  329. while (animationQueue.length > 0) {
  330. var obj_index = animationQueue[0][0];
  331. var ani_frame = animationQueue[0][1];
  332. if (ani_frame > ANIMATION_FRAME_LENGTH) {
  333. objetArray[obj_index][1] = false;
  334. animationQueue.shift();
  335. } else {
  336. break;
  337. }
  338. }
  339. for (var i = 0; i < objetArray.length; i++) {
  340. var obj = objetArray[i][0];
  341. var isAnimating = objetArray[i][1];
  342. if (isAnimating == false) {
  343. var px = obj.position.x;
  344. var py = obj.position.y;
  345. var dist = Math.sqrt(Math.pow(px - mouseScaled.x, 2) + Math.pow(py - mouseScaled.y, 2));
  346. if (dist < INTERACT_DISTANCE) {
  347. var startPosVector = obj.position.clone();
  348. var mouseRepelVector = new THREE.Vector3().subVectors(startPosVector, mouseScaled).multiplyScalar(THREE.Math.randFloat(INTERACT_DISTANCE + 0.5, INTERACT_DISTANCE + 2) - dist);
  349. var endPosVector = new THREE.Vector3().addVectors(startPosVector, mouseRepelVector);
  350. animationQueue.push([i, 0, startPosVector, endPosVector]);
  351. objetArray[i][1] = true;
  352. }
  353. }
  354. }
  355. for (var i = 0; i < animationQueue.length; i++) {
  356. var obj = objetArray[animationQueue[i][0]][0];
  357. var ani_frame = animationQueue[i][1];
  358. var startPosVector = animationQueue[i][2];
  359. var endPosVector = animationQueue[i][3];
  360. var curPosVector = new THREE.Vector3();
  361. var frac = 1 - Math.abs(ani_frame - (ANIMATION_FRAME_LENGTH / 2)) / (ANIMATION_FRAME_LENGTH / 2);
  362. frac = easeOutQuad(frac);
  363. curPosVector.lerpVectors(startPosVector, endPosVector, frac);
  364. obj.position.x = curPosVector.x;
  365. obj.position.y = curPosVector.y;
  366. obj.position.z = curPosVector.z;
  367. animationQueue[i][1] += 1;
  368. }
  369. mouse = new THREE.Vector3(10000, 10000, -2);
  370. mouseScaled = new THREE.Vector3(10000, 10000, -2);
  371. renderer.render(scene, camera);
  372. }
  373. function onWindowResize() {
  374. SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
  375. SCREEN_WIDTH = SCREEN_HEIGHT;
  376. SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
  377. camera.aspect = SCREEN_ASPECT_RATIO;
  378. camera.updateProjectionMatrix();
  379. renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
  380. console.log(SCREEN_WIDTH + "x" + SCREEN_HEIGHT)
  381. }
  382. function onDocumentMouseMove(event) {
  383. var rect = canvas.getBoundingClientRect();
  384. mouse.x = event.clientX - rect.left;
  385. mouse.y = event.clientY - rect.top;
  386. mouseScaled.x = mouse.x * viewWidth / SCREEN_WIDTH - viewWidth / 2;
  387. mouseScaled.y = -mouse.y * viewHeight / SCREEN_HEIGHT + viewHeight / 2;
  388. }
  389. function sigmoid(t) {
  390. return 1 / (1 + Math.pow(Math.E, -t));
  391. }
  392. // no easing, no acceleration
  393. function linear(t) {
  394. return t;
  395. }
  396. // accelerating from zero velocity
  397. function easeInQuad(t) {
  398. return t * t;
  399. }
  400. // decelerating to zero velocity
  401. function easeOutQuad(t) {
  402. return t * (2 - t);
  403. }
  404. // acceleration until halfway, then deceleration
  405. function easeInOutQuad(t) {
  406. return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  407. }
  408. // accelerating from zero velocity
  409. function easeInCubic(t) {
  410. return t * t * t;
  411. }
  412. // decelerating to zero velocity
  413. function easeOutCubic(t) {
  414. return (--t) * t * t + 1;
  415. }
  416. // acceleration until halfway, then deceleration
  417. function easeInOutCubic(t) {
  418. return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  419. }
  420. // accelerating from zero velocity
  421. function easeInQuart(t) {
  422. return t * t * t * t;
  423. }
  424. // decelerating to zero velocity
  425. function easeOutQuart(t) {
  426. return 1 - (--t) * t * t * t;
  427. }
  428. // acceleration until halfway, then deceleration
  429. function easeInOutQuart(t) {
  430. return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;
  431. }
  432. // accelerating from zero velocity
  433. function easeInQuint(t) {
  434. return t * t * t * t * t;
  435. }
  436. // decelerating to zero velocity
  437. function easeOutQuint(t) {
  438. return 1 + (--t) * t * t * t * t;
  439. }
  440. // acceleration until halfway, then deceleration
  441. function easeInOutQuint(t) {
  442. return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t;
  443. }
  444. //Event Handlers
  445. window.addEventListener("resize", onWindowResize);
  446. init();
  447. animate();
  448. }
  449. ThreeJSCanvas(1);
  450. </script>
  451. <script>
  452. var xin = true,
  453. yin = true;
  454. var step = 2;
  455. var delay = 10;
  456. var $obj;
  457. $(function () {
  458. $obj = $('#floatingDiv');
  459. var time = window.setInterval('move()', delay);
  460. $obj.mouseover(function () {
  461. clearInterval(time);
  462. });
  463. $obj.mouseout(function () {
  464. time = window.setInterval('move()', delay);
  465. });
  466. });
  467. function move() {
  468. var left = $obj.offset().left;
  469. // console.log(left);
  470. var top = $obj.offset().top;
  471. var L = (T = 0); //左边界和顶部边界
  472. var R = $(window).width() - $obj.width(); // 右边界
  473. var B = $(window).height() - $obj.height(); //下边界
  474. //难点:怎样判断广告的4个边框有没有超出可视化范围!
  475. if (left < L) {
  476. xin = true; // 水平向右移动
  477. }
  478. if (left > R) {
  479. xin = false;
  480. }
  481. if (top < T) {
  482. yin = true;
  483. }
  484. if (top > B) {
  485. yin = false;
  486. }
  487. //根据有没有超出范围来确定广告的移动方向
  488. left += step * (xin == true ? 1 : -1);
  489. top += step * (yin == true ? 1 : -1);
  490. // 给div 元素重新定位
  491. $obj.offset({
  492. top: top,
  493. left: left,
  494. });
  495. }
  496. </script>
  497. </body>
  498. <script type="text/javascript" src="static/home/lib/layui/layui.all.js"></script>
  499. </html>