Advertisement
AbdulMuttaqin

Untitled

Jun 11th, 2023
1,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let modal = document.createElement('div');
  2. let currencyElement = document.querySelector('.currency');
  3. let balanceElement = document.querySelector('.amount-str');
  4.             // Create logo and title
  5.             let logoContainer = document.createElement('div');
  6.            
  7.             let title = document.createElement('span');
  8.             title.textContent = 'Arbitbot V1.0';
  9.             logoContainer.appendChild(title);
  10.             logoContainer.style.display = 'flex';
  11.             logoContainer.style.alignItems = 'center';
  12.             logoContainer.style.marginBottom = '20px';
  13.             logoContainer.style.color = '#eee';
  14.            
  15.             // Create header
  16.             let header = document.createElement('div');
  17.             let currency = currencyElement.textContent;
  18.             let balance = balanceElement.textContent;
  19.        
  20.             header.textContent = `${currency} ${balance}`;
  21.             header.style.backgroundColor = '#444';
  22.             header.style.color = '#eee';
  23.             header.style.padding = '10px';
  24.             header.style.borderRadius = '10px 10px 0 0';
  25.             header.style.marginBottom = '20px';
  26.             header.style.textAlign = 'center';
  27.             header.style.fontSize = '20px';
  28.             header.style.fontWeight = 'bold';
  29.            
  30.             let form = document.createElement('form');
  31.             form.style.display = 'flex';
  32.             form.style.flexDirection = 'column';
  33.             form.style.gap = '20px';
  34.             let style = document.createElement('style');
  35.  
  36. style.textContent = `
  37. .checkbox-label {
  38.     position: relative;
  39.     display: inline-block;
  40.     width: 24px;
  41.     height: 24px;
  42.     background: #222;
  43.     border: 1px solid #aaa;
  44.     border-radius: 4px;
  45. }
  46.  
  47. .checkbox-label:after {
  48.     content: "";
  49.     position: absolute;
  50.     display: none;
  51.     left: 9px;
  52.     top: 5px;
  53.     width: 10px;
  54.     height: 10px;
  55.     border: solid white;
  56.     border-width: 0 3px 3px 0;
  57.     transform: rotate(45deg);
  58. }
  59.  
  60. input[type='checkbox']:checked ~ .checkbox-label:after {
  61.     display: block;
  62. }`;
  63.  
  64.             // Form groups
  65.             let groups = [
  66.             [
  67.                     { name: 'Currency', type: 'text' },
  68.                     { name: 'Amount', type: 'text' },
  69.                     { name: 'Chance %', type: 'text' },
  70.                     { name: '', type: 'text',khusus:"chance" },
  71.                     { name: 'License', type: 'text' }
  72.                 ],
  73.                 [
  74.                     { name: 'Increase win', type: 'text' },
  75.                     { name: 'Increase lose', type: 'text' },
  76.                     { name: 'Reset if streak', type: 'text' },
  77.                     { name: 'Reset if win', type: 'text' }
  78.                 ],
  79.                 [
  80.                     { name: 'Reset if lose', type: 'text' },
  81.                     { name: 'Reset if Profit Balance', type: 'text' },
  82.                     { name: 'Stop if profit', type: 'text' },
  83.                     { name: '', type: 'checkbox', khusus:"cek" }
  84.                 ],
  85.                 [
  86.                     { name: 'Stop max amount', type: 'text' },
  87.                     { name: 'Stop if balance target', type: 'text' },
  88.                     { name: '', type: 'checkbox' , khusus:"cek"},
  89.                     { name: 'Reset if streak lose', type: 'text' }
  90.                 ],
  91.                 [
  92.                     { name: 'Condition chance %', type: 'text' },
  93.                     { name: '', type: 'text' ,khusus:"condition"},
  94.                     { name: 'Reset auto balance', type: 'text' }
  95.                 ]
  96.             ];
  97.            
  98.             // Create form groups
  99.             // Create form groups
  100.             groups.forEach(group => {
  101.                 let groupDiv = document.createElement('div');
  102.                 groupDiv.style.display = 'flex';
  103.                 groupDiv.style.justifyContent = 'space-between';
  104.                 groupDiv.style.alignItems = 'center';
  105.            
  106.                 group.forEach(field => {
  107.                     let div = document.createElement('div');
  108.                     div.style.flex = '1';
  109.                     div.style.marginRight = '10px';
  110.            
  111.                     let label = document.createElement('label');
  112.                     label.textContent = field.name;
  113.                     label.style.display = 'block';
  114.                     label.style.marginBottom = '5px';
  115.                     label.style.color = '#aaa';
  116.            
  117.                     let input = document.createElement('input');
  118.                     input.type = field.type;
  119.                     input.name = field.name.split(' ').join('_').toLowerCase();
  120.                     input.style.width = '100%';
  121.                     input.style.padding = '10px';
  122.                     input.style.border = '1px solid #aaa';
  123.                     input.style.borderRadius = '5px';
  124.                     input.style.backgroundColor = '#222';
  125.                     input.style.color = '#eee';
  126.                  // Adjust width for Chance % inputs
  127.                  if (field.khusus === 'cek') {
  128.                        input.style.position = 'relative';
  129.                         input.style.width = '50%';
  130.                         input.style.right = '55px';
  131.                         input.style.top = '10px';
  132.                     }
  133.  
  134.                     if (field.khusus === 'condition') {
  135.                        input.style.position = 'relative';
  136.                         input.style.width = '50%';
  137.                         input.style.right = '120px';
  138.                         input.style.top = '10px';
  139.                         label.style.position = 'relative';
  140.                         label.style.left = '70px';
  141.                     }
  142.                     if (field.khusus === 'chance') {
  143.                        input.style.position = 'relative';
  144.                         input.style.width = '50%';
  145.                         input.style.right = '80px';
  146.                         input.style.top = '10px';
  147.                         label.style.position = 'relative';
  148.                         label.style.left = '70px';
  149.                     }
  150.                     if (field.name === 'Stop if balance target') {
  151.                        input.style.position = 'relative';
  152.                     }
  153.                     if (field.name === 'Condition chance %') {
  154.                        input.style.position = 'relative';
  155.                        input.style.width = '50%';
  156.                     }
  157.                  if (field.name === 'Chance %') {
  158.                         input.style.width = '50%';
  159.                     }
  160.            
  161.                     // Adjust width and margin for checkbox
  162.                     if (field.type === 'checkbox') {
  163.                         input.style.width = '40';
  164.                         input.style.marginLeft = '10px';
  165.                     }
  166.            
  167.                     // Styling buttons
  168.                     if (field.type === 'button') {
  169.                         input.style.backgroundColor = '#0066ff';
  170.                         input.style.color = '#fff';
  171.                         input.style.border = 'none';
  172.                         input.style.cursor = 'pointer';
  173.                     }
  174.            
  175.                     div.appendChild(label);
  176.                     div.appendChild(input);
  177.                     groupDiv.appendChild(div);
  178.                 });
  179.            
  180.                 form.appendChild(groupDiv);
  181.             });
  182. // Create a 'Start' button
  183. let startButton = document.createElement('button');
  184. startButton.textContent = 'Start';
  185. startButton.style.backgroundColor = '#0066ff';
  186. startButton.style.color = '#fff';
  187. startButton.style.border = 'none';
  188. startButton.style.padding = '10px';
  189. startButton.style.marginTop = '10px';
  190. startButton.style.cursor = 'pointer';
  191. startButton.style.borderRadius = '5px';
  192.  
  193. let stopButton = document.createElement('button');
  194. stopButton.textContent = 'Stop';
  195. stopButton.style.backgroundColor = '#0066ff';
  196. stopButton.style.color = '#fff';
  197. stopButton.style.border = 'none';
  198. stopButton.style.padding = '10px';
  199. stopButton.style.marginTop = '10px';
  200. stopButton.style.cursor = 'pointer';
  201. stopButton.style.borderRadius = '5px';
  202.  
  203. let stopOnWinButton = document.createElement('button');
  204. stopOnWinButton.textContent = 'Stop on win';
  205. stopOnWinButton.style.backgroundColor = '#0066ff';
  206. stopOnWinButton.style.color = '#fff';
  207. stopOnWinButton.style.border = 'none';
  208. stopOnWinButton.style.padding = '10px';
  209. stopOnWinButton.style.marginTop = '10px';
  210. stopOnWinButton.style.cursor = 'pointer';
  211. stopOnWinButton.style.borderRadius = '5px';
  212.  
  213. let buttonDiv = document.createElement('div');
  214. buttonDiv.style.display = 'flex';
  215. buttonDiv.style.justifyContent = 'space-between';
  216.  
  217. buttonDiv.appendChild(startButton);
  218. buttonDiv.appendChild(stopButton);
  219. buttonDiv.appendChild(stopOnWinButton);
  220. startButton.addEventListener('click', function (event) {
  221.     event.preventDefault(); // prevent the form from submitting which causes a page reload
  222.  
  223.     let licenseInput = form.querySelector('input[name="license"]');
  224.     let licenseCode = licenseInput.value;
  225.  
  226.     fetch(`https://danaq.masuk.id/lisensi/api.php?code=${licenseCode}`)
  227.         .then(response => response.text())
  228.         .then(result => {
  229.             if (result === licenseCode) {
  230.                 alert("License code is valid!");
  231.             } else {
  232.                 alert("License code is wrong!");
  233.             }
  234.         })
  235.         .catch(err => console.error(err));
  236. });
  237. form.appendChild(buttonDiv);
  238.            
  239.             // Style the modal
  240.             modal.style.position = 'fixed';
  241.             modal.style.top = '50%';
  242.             modal.style.left = '50%';
  243.             modal.style.transform = 'translate(-50%, -50%)';
  244.             modal.style.backgroundColor = '#222';
  245.             modal.style.color = '#eee';
  246.             modal.style.padding = '20px';
  247.             modal.style.borderRadius = '10px';
  248.             modal.style.zIndex = '999';
  249.             modal.style.maxWidth = '80%';
  250.             modal.style.maxHeight = '80vh';
  251.             modal.style.overflowY = 'auto';
  252.             modal.style.width = '900px';
  253.             modal.style.border = '1px solid #555';
  254.            
  255.             // Append the header and form to the modal
  256.             modal.appendChild(logoContainer);
  257.             modal.appendChild(header);
  258.             modal.appendChild(form);
  259.             // Create a 'Close' button
  260.             let closeButton = document.createElement('button');
  261.             closeButton.textContent = 'X';
  262.             closeButton.style.position = 'absolute';
  263.             closeButton.style.right = '10px';
  264.             closeButton.style.top = '10px';
  265.             closeButton.style.backgroundColor = 'transparent';
  266.             closeButton.style.color = '#fff';
  267.             closeButton.style.border = 'none';
  268.             closeButton.style.fontSize = '20px';
  269.             closeButton.style.cursor = 'pointer';
  270.            
  271.             // Append the close button to the modal
  272.             modal.appendChild(closeButton);
  273.             // Create a backdrop
  274.             let backdrop = document.createElement('div');
  275.             backdrop.style.position = 'fixed';
  276.             backdrop.style.top = '120';
  277.             backdrop.style.left = '0';
  278.             backdrop.style.width = '100%';
  279.             backdrop.style.height = '100%';
  280.             backdrop.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
  281.             backdrop.style.zIndex = '998';
  282.             document.head.appendChild(style);
  283.             // Append the modal and backdrop to the body
  284.             document.body.appendChild(backdrop);
  285.             document.body.appendChild(modal);
  286.             backdrop.addEventListener('click', closeModal);
  287.             closeButton.addEventListener('click', closeModal);
  288.            
  289.             function closeModal() {
  290.                 // Remove the modal and backdrop from the body
  291.                 document.body.removeChild(modal);
  292.                 document.body.removeChild(backdrop);
  293.             }
  294.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement