Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.24 KB | None | 0 0
  1. <html>
  2. <style>
  3. body {
  4. background-color: white;
  5. }
  6.  
  7. .menuBar {
  8. background-color: #fcd8a1;
  9. border-color: #fcd8a1;
  10. position: fixed;
  11. top: 0px;
  12. left: 0px;
  13. width: 100%;
  14. }
  15.  
  16. .menuBar a {
  17. float: right;
  18. color: black;
  19. text-align: center;
  20. padding: 16px 16px;
  21. text-decoration: none;
  22. font-size: 32;
  23. font-family: Tahoma;
  24. }
  25.  
  26. .menuBar a:hover, .dropBtn:hover {
  27. background-color: #ffcd11;
  28. color: white;
  29. }
  30.  
  31. .menuBar b {
  32. float: left;
  33. color: black;
  34. text-align: center;
  35. padding: 16px 16px;
  36. text-decoration: none;
  37. font-size: 32;
  38. font-family: Tahoma;
  39. }
  40.  
  41. .dropBtn {
  42. background-color: #fcd8a1;
  43. border:none;
  44. color: black;
  45. text-align: center;
  46. font-family: Tahoma;
  47. font-size: 32px;
  48. padding: 16px;
  49. }
  50.  
  51.  
  52. .dropBtn:hover, .dropBtn:focus {
  53. background-color: #ffcd11;
  54. }
  55.  
  56. .dropdown {
  57. position: relative;
  58. display: inline-block;
  59. float: right;
  60. }
  61.  
  62. .dropdownContent {
  63. display: none;
  64. position: absolute;
  65. background-color: #fcd8a1;
  66. min-width: 100px;
  67. overflow: auto;
  68. box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  69. background-color: #ffcd11;
  70. z-index: 1;
  71. }
  72.  
  73. .dropdownContent a {
  74. color: black;
  75. text-decoration: none;
  76. background-color: #fcd8a1;
  77. display: block;
  78. }
  79.  
  80. .dropdown a:hover {
  81. background-color: #ffcd11;
  82. }
  83.  
  84. .box {
  85. height: 240px;
  86. width: 33%;
  87. background-color: #FFFFFF;
  88. border:1px solid black;
  89. font-family: Tahoma;
  90. position: absolute;
  91. left: 33%;
  92. top: 20%;
  93. border-radius: 12px;
  94. }
  95.  
  96. .gap {
  97. height: 20px;
  98. }
  99.  
  100. .gap2 {
  101. height: 10px;
  102. }
  103.  
  104. .createBtn {
  105. position: absolute;
  106. right: -0px;
  107. bottom: -30px;
  108. padding-bottom: 0px;
  109. height = 20px;
  110. width = 80px;
  111. font-family: Tahoma;
  112. background: rgba(0,0,0,0);
  113. color: black;
  114. padding: 5px 15px;
  115. text-align: center;
  116. font-size: 10pt;
  117. cursor: pointer;
  118. background-color: #FFFFFF;
  119. border:1px solid black;
  120. border-radius: 12px;
  121. }
  122.  
  123. .button2:hover {
  124. color: white;
  125. }
  126.  
  127. #createOperator label {
  128. margin-left: 3%;
  129. display: inline-block;
  130. width: 150px;
  131. }
  132.  
  133. #firstName, #lastName, #username, #password, #confirm {
  134. width: 58%;
  135. margin-left: 5px;
  136. box-sizing: border-box;
  137. border: none;
  138. border-bottom: 2px solid #fcd8a1;
  139. font-family: Tahoma;
  140. }
  141.  
  142. .show {display: block;}
  143.  
  144. .timestamp {
  145. text-align: right;
  146. font-size: 32;
  147. position: fixed;
  148. right: 5px;
  149. top: 5px;
  150. font-family: Tahoma;
  151. }
  152.  
  153. .fontSizeButton {
  154.  
  155. background-color: #fcd8a1;
  156. border:none;
  157. color: black;
  158. text-align: center;
  159. font-family: Tahoma;
  160. font-size: 32px;
  161. padding: 16px;
  162.  
  163. }
  164. .fontSizeButton:hover {
  165. background-color: #ffcd11;
  166. }
  167.  
  168. </style>
  169.  
  170. <script>
  171.  
  172. var increasetrue = true;
  173.  
  174. function startTime() {
  175. var today = new Date();
  176. var h = today.getHours();
  177. var m = today.getMinutes();
  178. h = checkTime(h);
  179. m = checkTime(m);
  180. document.getElementById('timestamp').innerHTML =
  181. "Operator Name - " + h + ":" + m ;
  182. var t = setTimeout(startTime, 500);
  183. }
  184.  
  185. function checkTime(i) {
  186. if (i < 10) {i = "0" + i}
  187. return i;
  188. }
  189.  
  190. //Function that ensures that passwords match, the username does not already exist and that a password has been entered
  191. function operatorSubmit(){
  192.  
  193. var alreadyExists = false;
  194. var username = document.getElementById('username').value;
  195. var password = document.getElementById('password').value;
  196. var confirm = document.getElementById('confirm').value;
  197. var firstName = document.getElementById('firstName').value;
  198. var lastName = document.getElementById('lastName').value;
  199.  
  200. @foreach($operators as $key => $data)
  201. if("{{$data->username}}"==username){
  202. alreadyExists = true;
  203. }
  204. @endforeach
  205.  
  206. if((password === confirm) && alreadyExists===false && !(password === "" || confirm === "") && !(firstName === "" || lastName === "")){
  207. document.getElementById('createOperator').submit();
  208. }
  209. else if(firstName === "" || lastName === ""){
  210. alert('Please enter a first and last name');
  211. }
  212. else if(alreadyExists===true){
  213. alert('This username already exists');
  214. }
  215. else if(password === "" || confirm === ""){
  216. alert('Please ensure the new password has been entered twice');
  217. }
  218. else{
  219. alert('Passwords do not match');
  220. }
  221. }
  222.  
  223. function increaseFontSize() {
  224.  
  225. if (increasetrue == true) {
  226. document.getElementById("fontSizeButton").innerHTML = "aA&#818";
  227. document.getElementById("boxDiv").style.height = "300px";
  228.  
  229.  
  230. document.getElementById("firstNameLabel").style.fontSize = "18pt";
  231. document.getElementById("lastNameLabel").style.fontSize = "18pt";
  232. document.getElementById("usernameLabel").style.fontSize = "18pt";
  233. document.getElementById("passwordLabel").style.fontSize = "18pt";
  234. document.getElementById("confirmPasswordLabel").style.fontSize = "18pt";
  235.  
  236. document.getElementById("firstName").style.fontSize = "18pt";
  237. document.getElementById("lastName").style.fontSize = "18pt";
  238. document.getElementById("username").style.fontSize = "18pt";
  239. document.getElementById("password").style.fontSize = "18pt";
  240. document.getElementById("confirm").style.fontSize = "18pt";
  241.  
  242. document.getElementById("submitButton").style.fontSize = "16pt";
  243. document.getElementById("submitButton").style.bottom = "-40px";
  244.  
  245. increasetrue = false;
  246.  
  247.  
  248. } else if (increasetrue == false) {
  249. document.getElementById("fontSizeButton").innerHTML = "a&#818A";
  250.  
  251. document.getElementById("boxDiv").style.height = "240px";
  252.  
  253.  
  254. document.getElementById("firstNameLabel").style.fontSize = "12pt";
  255. document.getElementById("lastNameLabel").style.fontSize = "12pt";
  256. document.getElementById("usernameLabel").style.fontSize = "12pt";
  257. document.getElementById("passwordLabel").style.fontSize = "12pt";
  258. document.getElementById("confirmPasswordLabel").style.fontSize = "12pt";
  259.  
  260. document.getElementById("firstName").style.fontSize = "12pt";
  261. document.getElementById("lastName").style.fontSize = "12pt";
  262. document.getElementById("username").style.fontSize = "12pt";
  263. document.getElementById("password").style.fontSize = "12pt";
  264. document.getElementById("confirm").style.fontSize = "12pt";
  265.  
  266. document.getElementById("submitButton").style.fontSize = "10pt";
  267. document.getElementById("submitButton").style.bottom = "-30px";
  268. increasetrue = true;
  269.  
  270.  
  271. }
  272. }
  273. </script>
  274.  
  275. <head>
  276. <title>Create Account</title>
  277. </head>
  278.  
  279. <body onload="startTime()">
  280.  
  281. <div id="menuBar" class="menuBar">
  282. <b style="float: left;">Make-It-All</b>
  283. <div class="dropdown">
  284. <b style="font-weight:normal" id="timestamp"></b>
  285. </div>
  286. <div class="dropdown">
  287. <button onclick="problemDropdown()" class="dropBtn">Menu</button>
  288. <div id="problemDropdown" class="dropdownContent">
  289. <a href="/addproblem">New Problem</a>
  290. <a href="/loadproblem">Load Problem</a>
  291. <a href="/createaccount">Create Account</a>
  292. <a href="/login">Logout</a>
  293. </div>
  294. </div>
  295. <div>
  296. <button id="fontSizeButton" type="submit" class="fontSizeButton" onclick="increaseFontSize()" >a&#818A</button>
  297. </div>
  298. </div>
  299.  
  300. <div id="boxDiv"class="box">
  301. <form id="createOperator" action="" method="POST">
  302. @csrf
  303. <div class="gap"></div>
  304. <label id="firstNameLabel" for="firstName">First Name:</label>
  305. <input type="text" id="firstName" name="firstName">
  306. <div class="gap"></div>
  307. <label id="lastNameLabel" for="lastName">Last Name:</label>
  308. <input type="text" id="lastName" name="lastName">
  309. <div class="gap"></div>
  310. <label id="usernameLabel" for="username">Username:</label>
  311. <input type="text" id="username" name="username">
  312. <div class="gap"></div>
  313. <label id="passwordLabel" for="password">Password:</label>
  314. <input type="password" id="password" name="password">
  315. <div class="gap"></div>
  316. <label id="confirmPasswordLabel" for="confirm">Confirm Password:</label>
  317. <input type="password" id="confirm" name="confirm">
  318. </form>
  319. <button id="submitButton" onclick="operatorSubmit()" class="createBtn">Create</button>
  320. </div>
  321.  
  322. <script>
  323. /* When the user clicks on the button,
  324. toggle between hiding and showing the dropdown content */
  325. function problemDropdown() {
  326. document.getElementById("problemDropdown").classList.toggle("show");
  327. }
  328.  
  329. function userDropdown() {
  330. document.getElementById("userDropdown").classList.toggle("show");
  331. }
  332.  
  333. // Close the dropdown if the user clicks outside of it
  334. window.onclick = function(event) {
  335. if (!event.target.matches('.dropBtn')) {
  336. var dropdowns = document.getElementsByClassName("dropdownContent");
  337. var i;
  338. for (i = 0; i < dropdowns.length; i++) {
  339. var openDropdown = dropdowns[i];
  340. if (openDropdown.classList.contains('show')) {
  341. openDropdown.classList.remove('show');
  342. }
  343. }
  344. }
  345. }
  346. </script>
  347.  
  348. </body>
  349. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement