home.html 19 KB

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