index-html.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (c) 2016, 2024, 5 Mode
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither 5 Mode nor the names of its contributors
  13. * may be used to endorse or promote products derived from this software
  14. * without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  17. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. * https://opensource.org/licenses/BSD-3-Clause
  28. *
  29. */
  30. var appMenuVisible=false;
  31. var onAppMenu = false;
  32. $("div#butParent").click(function() {
  33. window.open("http://5mode.com", "_self");
  34. });
  35. function popupMenu() {
  36. if (!appMenuVisible) {
  37. $(".appMenu").show();
  38. $(".appMenu").css("z-index", "99999");
  39. $(".content5").css("z-index", "99998");
  40. $(".content5").css("opacity", "0.3");
  41. } else {
  42. $(".appMenu").hide();
  43. $(".appMenu").css("z-index", "99992");
  44. $(".content5").css("z-index", "99999");
  45. $(".content5").css("opacity", "1.0");
  46. }
  47. appMenuVisible=!appMenuVisible;
  48. }
  49. function hideMenu() {
  50. $(".appMenu").hide();
  51. appMenuVisible=false;
  52. $(".content5").css("opacity", "1.0");
  53. }
  54. $("#appMenuIco").on("mouseover", function() {
  55. onAppMenu = true;
  56. });
  57. $("#appMenuIco").on("mouseout", function() {
  58. onAppMenu = false;
  59. });
  60. $(".appMenu").on("mouseover", function() {
  61. onAppMenu = true;
  62. });
  63. $(".appMenu").on("mouseout", function() {
  64. onAppMenu = false;
  65. });
  66. $("body").on("click", function() {
  67. if (!onAppMenu) {
  68. hideMenu();
  69. }
  70. });
  71. function setFooterPos() {
  72. if (document.getElementById("footerCont")) {
  73. tollerance = 16;
  74. $("#footerCont").css("top", parseInt( window.innerHeight - $("#footerCont").height() - tollerance ) + "px");
  75. $("#footer").css("top", parseInt( window.innerHeight - $("#footer").height() - tollerance ) + "px");
  76. }
  77. }
  78. window.addEventListener("load", function() {
  79. setTimeout("setFooterPos()", 1000);
  80. $("div.appMenu").load("https://appmenu.5mode.com/?v="+ rnd(50000, 99999));
  81. }, true);
  82. window.addEventListener("resize", function() {
  83. setTimeout("setFooterPos()", 1000);
  84. hideMenu();
  85. }, true);