Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a div element for the loading screen
- var loadingScreen = document.createElement("div");
- loadingScreen.id = "loadingScreen";
- loadingScreen.style.position = "fixed";
- loadingScreen.style.top = "0";
- loadingScreen.style.left = "0";
- loadingScreen.style.width = "100%";
- loadingScreen.style.height = "100%";
- loadingScreen.style.backgroundColor = "black";
- loadingScreen.style.color = "white";
- loadingScreen.style.fontFamily = "Arial, sans-serif";
- loadingScreen.style.fontSize = "48px";
- loadingScreen.style.textAlign = "center";
- loadingScreen.style.lineHeight = "100vh";
- // Create a span element for the loading text
- var loadingText = document.createElement("span");
- loadingText.id = "loadingText";
- loadingText.innerHTML = "Loading script"; // Set the initial text to "Loading script"
- // Append the loading text to the loading screen
- loadingScreen.appendChild(loadingText);
- // Append the loading screen to the document body
- document.body.appendChild(loadingScreen);
- // Create a variable to store the current step of the loading process
- var step = 0;
- // Create a function to update the loading text and screen
- function updateLoading() {
- // Increment the step by one
- step++;
- // If the step is 1, change the text to "loaded" and wait for 0.5 seconds
- if (step === 1) {
- loadingText.innerHTML = "loaded";
- setTimeout(updateLoading, 500);
- } else if (step === 2) {
- // If the step is 2, change the text to "Brug koden på eget ansvar!" and wait for 2 seconds
- loadingText.innerHTML = "Brug koden på eget ansvar!";
- setTimeout(updateLoading, 2000);
- } else if (step === 3) {
- // If the step is 3, fade out the loading screen and remove it from the document
- loadingScreen.style.transition = "opacity 1s"; // Set the transition property to animate the opacity
- loadingScreen.style.opacity = "0"; // Set the opacity to zero
- setTimeout(function() {
- // After one second, remove the loading screen from the document
- document.body.removeChild(loadingScreen);
- }, 1000);
- }
- }
- // Call the updateLoading function after one second
- setTimeout(updateLoading, 1000);
- var button = document.createElement("Button");
- button.innerHTML = "Procent af et givent tal (fx. 20% af 100 = 20)";
- button.style = "top:60px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- var number = prompt("Skriv tallet du vil tage en procent af:");
- var percentage = prompt("Skriv den procentdel, der skal tages af tallet:");
- var answer = number * (percentage / 100);
- alert(percentage + "% af " + number + " er: " + answer + ".");
- };
- var button = document.createElement("Button");
- button.innerHTML = "Find originale tal efter en stigning";
- button.style = "top:120px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- var rise = prompt("Skriv stigningen i procent (uden % tegn):");
- var number = prompt("Skriv tallet:");
- var original = number / (1 + rise / 100);
- alert("Det originale tal er: " + original);
- };
- var button = document.createElement("Button");
- button.innerHTML = "Hvor meget har jeg sparet?";
- button.style = "top:180px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- var currentPrice = prompt("Skriv den nuværende pris på varen:");
- var offerPercentage = prompt("Skriv hvor stort tilbudet er i procent (uden % tegn):");
- var originalPrice = currentPrice / (1 - offerPercentage / 100);
- var moneySaved = originalPrice - currentPrice;
- alert("Du sparer: " + moneySaved + " på produktet");
- };
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:240px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:300px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:360px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:420px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:480px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:540px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- button.innerHTML = "Next update soon";
- button.style = "top:600px;left:5px;position:absolute;z-index:99999;padding:15px;width:400px;";
- document.body.appendChild(button);
- button.onclick = function(){
- alert("comming soon!")};
- var button = document.createElement("Button");
- /////////////////////////////////////////////////////////////////////////////////////////////////
- var searchField = document.createElement("input");
- searchField.type = "text";
- searchField.placeholder = "Skriv dit regnestykke her!";
- searchField.style.border = "2px solid black";
- searchField.style.borderRadius = "10px";
- searchField.style.padding = "5px";
- var searchButton = document.createElement("button");
- searchButton.textContent = "Udregn";
- searchButton.onclick = function() {
- var query = searchField.value;
- query = query.replace(/\s/g, "+");
- query = encodeURIComponent(query);
- var googleWindow = window.open("https://www.google.com/search?q=" + query, "Google", "width=800, height=600");
- };
- searchButton.style.border = "2px solid black";
- searchButton.style.borderRadius = "10px";
- searchButton.style.padding = "5px";
- searchButton.style.marginLeft = "10px";
- var searchDiv = document.createElement("div");
- searchDiv.style.position = "fixed";
- searchDiv.style.top = "70px";
- searchDiv.style.right = "675px";
- searchDiv.appendChild(searchField);
- searchDiv.appendChild(searchButton);
- document.body.appendChild(searchDiv);
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- var mathField = document.createElement("input");
- mathField.type = "text";
- mathField.style.border = "2px solid black";
- mathField.style.borderRadius = "10px";
- mathField.style.padding = "5px";
- mathField.placeholder = "Skriv en ligning her";
- var mathButton = document.createElement("button");
- mathButton.textContent = "Regn";
- mathButton.onclick = function() {
- var problem = mathField.value;
- var link = window.open("https://www.symbolab.com/solver/step-by-step/" + problem, "?or=input", "width=800, height=600");
- window.open.href = link;
- };
- var mathDiv = document.createElement("div");
- mathDiv.style.position = "fixed";
- mathDiv.style.top = "70px";
- mathDiv.style.right = "450px";
- mathButton.style.border = "2px solid black";
- mathButton.style.borderRadius = "10px";
- mathButton.style.padding = "5px";
- mathDiv.appendChild(mathField);
- mathDiv.appendChild(mathButton);
- document.body.appendChild(mathDiv);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement