Advertisement
NewBestPastebins

Gigachad calculator V3.2

Sep 13th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. // Create a div element for the loading screen
  2. var loadingScreen = document.createElement("div");
  3. loadingScreen.id = "loadingScreen";
  4. loadingScreen.style.position = "fixed";
  5. loadingScreen.style.top = "0";
  6. loadingScreen.style.left = "0";
  7. loadingScreen.style.width = "100%";
  8. loadingScreen.style.height = "100%";
  9. loadingScreen.style.backgroundColor = "black";
  10. loadingScreen.style.color = "white";
  11. loadingScreen.style.fontFamily = "Arial, sans-serif";
  12. loadingScreen.style.fontSize = "48px";
  13. loadingScreen.style.textAlign = "center";
  14. loadingScreen.style.lineHeight = "100vh";
  15.  
  16. // Create a span element for the loading text
  17. var loadingText = document.createElement("span");
  18. loadingText.id = "loadingText";
  19. loadingText.innerHTML = "Loading script"; // Set the initial text to "Loading script"
  20.  
  21. // Append the loading text to the loading screen
  22. loadingScreen.appendChild(loadingText);
  23.  
  24. // Append the loading screen to the document body
  25. document.body.appendChild(loadingScreen);
  26.  
  27. // Create a variable to store the current step of the loading process
  28. var step = 0;
  29.  
  30. // Create a function to update the loading text and screen
  31. function updateLoading() {
  32. // Increment the step by one
  33. step++;
  34.  
  35. // If the step is 1, change the text to "loaded" and wait for 0.5 seconds
  36. if (step === 1) {
  37. loadingText.innerHTML = "loaded";
  38. setTimeout(updateLoading, 500);
  39. } else if (step === 2) {
  40. // If the step is 2, change the text to "Brug koden på eget ansvar!" and wait for 2 seconds
  41. loadingText.innerHTML = "Brug koden på eget ansvar!";
  42. setTimeout(updateLoading, 2000);
  43. } else if (step === 3) {
  44. // If the step is 3, fade out the loading screen and remove it from the document
  45. loadingScreen.style.transition = "opacity 1s"; // Set the transition property to animate the opacity
  46. loadingScreen.style.opacity = "0"; // Set the opacity to zero
  47. setTimeout(function() {
  48. // After one second, remove the loading screen from the document
  49. document.body.removeChild(loadingScreen);
  50. }, 1000);
  51. }
  52. }
  53.  
  54. // Call the updateLoading function after one second
  55. setTimeout(updateLoading, 1000);
  56. var button = document.createElement("Button");
  57. button.innerHTML = "Procent af et givent tal (fx. 20% af 100 = 20)";
  58. button.style = "top:60px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  59. document.body.appendChild(button);
  60. button.onclick = function(){
  61. var number = prompt("Skriv tallet du vil tage en procent af:");
  62. var percentage = prompt("Skriv den procentdel, der skal tages af tallet:");
  63. var answer = number * (percentage / 100);
  64. alert(percentage + "% af " + number + " er: " + answer + ".");
  65. };
  66. var button = document.createElement("Button");
  67. button.innerHTML = "Find originale tal efter en stigning";
  68. button.style = "top:120px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  69. document.body.appendChild(button);
  70. button.onclick = function(){
  71. var rise = prompt("Skriv stigningen i procent (uden % tegn):");
  72. var number = prompt("Skriv tallet:");
  73. var original = number / (1 + rise / 100);
  74. alert("Det originale tal er: " + original);
  75. };
  76. var button = document.createElement("Button");
  77. button.innerHTML = "Hvor meget har jeg sparet?";
  78. button.style = "top:180px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  79. document.body.appendChild(button);
  80. button.onclick = function(){
  81. var currentPrice = prompt("Skriv den nuværende pris på varen:");
  82. var offerPercentage = prompt("Skriv hvor stort tilbudet er i procent (uden % tegn):");
  83. var originalPrice = currentPrice / (1 - offerPercentage / 100);
  84. var moneySaved = originalPrice - currentPrice;
  85. alert("Du sparer: " + moneySaved + " på produktet");
  86. };
  87. var button = document.createElement("Button");
  88. button.innerHTML = "Next update soon";
  89. button.style = "top:240px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  90. document.body.appendChild(button);
  91. button.onclick = function(){
  92. alert("comming soon!")};
  93. var button = document.createElement("Button");
  94. button.innerHTML = "Next update soon";
  95. button.style = "top:300px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  96. document.body.appendChild(button);
  97. button.onclick = function(){
  98. alert("comming soon!")};
  99. var button = document.createElement("Button");
  100. button.innerHTML = "Next update soon";
  101. button.style = "top:360px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  102. document.body.appendChild(button);
  103. button.onclick = function(){
  104. alert("comming soon!")};
  105. var button = document.createElement("Button");
  106. button.innerHTML = "Next update soon";
  107. button.style = "top:420px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  108. document.body.appendChild(button);
  109. button.onclick = function(){
  110. alert("comming soon!")};
  111. var button = document.createElement("Button");
  112. button.innerHTML = "Next update soon";
  113. button.style = "top:480px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  114. document.body.appendChild(button);
  115. button.onclick = function(){
  116. alert("comming soon!")};
  117. var button = document.createElement("Button");
  118. button.innerHTML = "Next update soon";
  119. button.style = "top:540px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  120. document.body.appendChild(button);
  121. button.onclick = function(){
  122. alert("comming soon!")};
  123. var button = document.createElement("Button");
  124. button.innerHTML = "Next update soon";
  125. button.style = "top:600px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
  126. document.body.appendChild(button);
  127. button.onclick = function(){
  128. alert("comming soon!")};
  129. var button = document.createElement("Button");
  130. /////////////////////////////////////////////////////////////////////////////////////////////////
  131. var searchField = document.createElement("input");
  132. searchField.type = "text";
  133. searchField.placeholder = "Skriv dit regnestykke her!";
  134. searchField.style.border = "2px solid black";
  135. searchField.style.borderRadius = "10px";
  136. searchField.style.padding = "5px";
  137. var searchButton = document.createElement("button");
  138. searchButton.textContent = "Udregn";
  139. searchButton.onclick = function() {
  140. var query = searchField.value;
  141. query = query.replace(/\s/g, "+");
  142. query = encodeURIComponent(query);
  143. var googleWindow = window.open("https://www.google.com/search?q=" + query, "Google", "width=800, height=600");
  144. };
  145. searchButton.style.border = "2px solid black";
  146. searchButton.style.borderRadius = "10px";
  147. searchButton.style.padding = "5px";
  148. searchButton.style.marginLeft = "10px";
  149. var searchDiv = document.createElement("div");
  150. searchDiv.style.position = "fixed";
  151. searchDiv.style.top = "70px";
  152. searchDiv.style.right = "675px";
  153. searchDiv.appendChild(searchField);
  154. searchDiv.appendChild(searchButton);
  155. document.body.appendChild(searchDiv);
  156. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  157. var mathField = document.createElement("input");
  158. mathField.type = "text";
  159. mathField.style.border = "2px solid black";
  160. mathField.style.borderRadius = "10px";
  161. mathField.style.padding = "5px";
  162. mathField.placeholder = "Skriv en ligning her";
  163. var mathButton = document.createElement("button");
  164. mathButton.textContent = "Regn";
  165. mathButton.onclick = function() {
  166. var problem = mathField.value;
  167. var link = window.open("https://www.symbolab.com/solver/step-by-step/" + problem, "?or=input", "width=800, height=600");
  168. window.open.href = link;
  169. };
  170. var mathDiv = document.createElement("div");
  171. mathDiv.style.position = "fixed";
  172. mathDiv.style.top = "70px";
  173. mathDiv.style.right = "450px";
  174. mathButton.style.border = "2px solid black";
  175. mathButton.style.borderRadius = "10px";
  176. mathButton.style.padding = "5px";
  177. mathDiv.appendChild(mathField);
  178. mathDiv.appendChild(mathButton);
  179. document.body.appendChild(mathDiv);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement