static_page.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!doctype html>
  2. <title>Teamspeak Server Status</title>
  3. <style>
  4. body {
  5. margin: 0px 0px 0px 0px;
  6. padding: 0px 0px 0px 0px;
  7. font-family: verdana, arial, helvetica, sans-serif;
  8. color: #ccc;
  9. background-color: #333;
  10. }
  11. #bounceBox {
  12. position: absolute;
  13. top: 0;
  14. right: 0;
  15. bottom: 0;
  16. left: 0;
  17. }
  18. #bouncer {
  19. position: absolute;
  20. }
  21. </style>
  22. <script>
  23. // JS adapted from
  24. // https://stackoverflow.com/questions/6152522/how-can-i-make-a-paragraph-bounce-around-in-a-div
  25. let vx = 3;
  26. let vy = 2;
  27. const buffer = 5;
  28. const hitLR = (el, bounding) => {
  29. if (el.offsetLeft <= buffer && vx < 0) {
  30. vx = -1 * vx;
  31. }
  32. if ((el.offsetLeft + el.offsetWidth) >= (bounding.offsetWidth - buffer)) {
  33. vx = -1 * vx;
  34. }
  35. if (el.offsetTop <= buffer && vy < 0) {
  36. vy = -1 * vy;
  37. }
  38. if ((el.offsetTop + el.offsetHeight) >= (bounding.offsetHeight - buffer)) {
  39. vy = -1 * vy;
  40. }
  41. }
  42. const mover = (el, bounding) => {
  43. hitLR(el, bounding);
  44. el.style.left = el.offsetLeft + vx + 'px';
  45. el.style.top = el.offsetTop + vy + 'px';
  46. setTimeout(function() {
  47. mover(el, bounding);
  48. }, 30);
  49. }
  50. setTimeout(() => mover(
  51. document.getElementById("bouncer"),
  52. document.getElementById("bounceBox")
  53. ), 30);
  54. // makes the iframe have the appropriate height
  55. const resizeIframe = (obj) => {
  56. obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
  57. obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
  58. }
  59. </script>
  60. <body>
  61. <div id="bounceBox">
  62. <iframe id="bouncer" frameborder="0" src="https://kirkleon.ddns.net/teamspeak/page" scrolling="no" onload="resizeIframe(this)"></iframe>
  63. </div>
  64. </body>