Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. <style>
  2. body { font-family: Arial; }
  3. table, th, td {
  4. border: 1px solid black;
  5. border-collapse: collapse;
  6. border-spacing: 5px;
  7. }
  8. #container {
  9. position: relative;
  10. }
  11. #container canvas, #overlay {
  12. position: absolute;
  13. }
  14. canvas {
  15. }
  16. </style>
  17.  
  18. <script>
  19. function load() {
  20. const canvas = document.getElementById('xxx');
  21.  
  22. canvas.width = 1920;
  23. canvas.height = 1080;
  24.  
  25. const c = canvas.getContext('2d');
  26.  
  27. const width = 300;
  28. const height = 300;
  29.  
  30. let angle = Math.random() * Math.PI * 2;
  31. let x = 50;
  32. let y = 100;
  33. function drawIt() {
  34. window.requestAnimationFrame(drawIt);
  35.  
  36. let change =2 ;
  37. x += Math.cos(angle) * change;
  38. y += Math.sin(angle) * change;
  39.  
  40. if (x >= width) {
  41. x = width - 1;
  42. angle = Math.PI - angle;
  43. } else if (x < 0) {
  44. x = 0;
  45. angle = Math.PI - angle;
  46. } else if (y >= height) {
  47. y = height - 1;
  48. angle = (Math.PI * 2) - angle;
  49. } else if (y < 0) {
  50. y = 0;
  51. angle = (Math.PI * 2) - angle;
  52. }
  53.  
  54. c.fillStyle = "rgba(255, 255, 255, 0.05)";
  55. c.fillRect(0, 0, canvas.width, canvas.height);
  56.  
  57. c.fillStyle = "red";
  58. c.beginPath();
  59. c.arc(x,y,10,10, 0, Math.PI * 2);
  60. c.fill();
  61. }
  62.  
  63. drawIt();
  64. }
  65. </script>
  66.  
  67. <body onload="load()">
  68.  
  69. <div id="container">
  70. <canvas id="xxx"></canvas>
  71. <div id="overlay">
  72.  
  73.  
  74. <?php
  75. $connection = new mysqli("localhost", "root", "", "lista_gosci");
  76. if ($connection->connect_error) {
  77. die("Connection failed: " . $connection->connect_error);
  78. }
  79.  
  80. $guest_list = $connection->query("SELECT name, des FROM abc123");
  81. if ($guest_list->num_rows > 0) {
  82. echo("<table>");
  83. echo("<tr><th>Osoba</th><th>Komentarz</th></tr>");
  84. while ($entry = $guest_list->fetch_assoc()) {
  85. echo("<tr><td>" . $entry["name"]. "</td><td>" . $entry["des"]. "</td></tr>");
  86. }
  87. echo("</table>");
  88. } else {
  89. echo("Brak wpisów.");
  90. }
  91. ?>
  92.  
  93. <br><br>
  94.  
  95. <form action="add.php" method="post">
  96. Imię i nazwisko: <input type="text" name="name"><br>
  97. Komentarz: <input type="text" name="comment"><br>
  98. <input type="submit">
  99. </form>
  100.  
  101. </div>
  102. </div>
  103. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement