|
7 | 7 | Coming Soon
|
8 | 8 | </body>
|
9 | 9 | </html>
|
| 10 | + |
| 11 | +<!DOCTYPE html> |
| 12 | +<html> |
| 13 | + <head> |
| 14 | + <title>Strike Info | Coding Hut Website</title> |
| 15 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 16 | + <style> |
| 17 | + body { |
| 18 | + overflow-x: hidden; |
| 19 | + font-family: Sans-Serif; |
| 20 | + margin: 0; |
| 21 | + } |
| 22 | +<link href='https://fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet'> |
| 23 | +<style> |
| 24 | +body { |
| 25 | + font-family: 'Comfortaa';font-size: 22px; |
| 26 | +} |
| 27 | + |
| 28 | +.dynamic-content { |
| 29 | + display:none; |
| 30 | +} |
| 31 | +</style> |
| 32 | + |
| 33 | +<!-- This is for the coding hut api --> |
| 34 | +<h1>Staff Profile</h1> |
| 35 | + |
| 36 | +<!-- Default Dynamic Section --> |
| 37 | +<div id="default-content" class="dynamic-content"> |
| 38 | +{"status": 400, "error": "Invaild Request - Username does not exist in orders database"} |
| 39 | +</div> |
| 40 | +<!-- MyScratchedAccount's Completed Orders --> |
| 41 | +<div id="myscratchedaccount" class="dynamic-content"> |
| 42 | +{"status": 500, "completed-orders": 6, "pending-orders": 0} |
| 43 | +<br> |
| 44 | +Oops! You currently have 1 Strike at Coding Hut. Look below to see your strikes. |
| 45 | +</div> |
| 46 | +<!-- Dynamic Section 2 --> |
| 47 | +<div id="staff2" class="dynamic-content"> |
| 48 | +<h2>Staff2</h2> |
| 49 | +<br> |
| 50 | +DESCRIPTION HERE |
| 51 | +</div> |
| 52 | +<!-- Dynamic Section 3 --> |
| 53 | +<div id="staff3" class="dynamic-content"> |
| 54 | +<h2>Staff3</h2> |
| 55 | +<br> |
| 56 | +DESCRIPTION HERE |
| 57 | +</div> |
| 58 | + |
| 59 | +<script> |
| 60 | + function toggleMenu() { |
| 61 | + var menu = document.querySelector('.menu'); |
| 62 | + menu.style.display = menu.style.display === 'flex' ? 'none' : 'flex'; |
| 63 | + } |
| 64 | +</script> |
| 65 | + |
| 66 | +<script src="//code.jquery.com/jquery-1.12.0.min.js"></script> |
| 67 | +<script type="text/javascript"> |
| 68 | + // Parse the URL parameter |
| 69 | + function getParameterByName(name, url) { |
| 70 | + if (!url) url = window.location.href; |
| 71 | + name = name.replace(/[\[\]]/g, "\\$&"); |
| 72 | + var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), |
| 73 | + results = regex.exec(url); |
| 74 | + if (!results) return null; |
| 75 | + if (!results[2]) return ''; |
| 76 | + return decodeURIComponent(results[2].replace(/\+/g, " ")); |
| 77 | + } |
| 78 | + // Give the parameter a variable name |
| 79 | + var dynamicContent = getParameterByName('username'); |
| 80 | + |
| 81 | + $(document).ready(function() { |
| 82 | + |
| 83 | + // Check if the URL parameter is apples |
| 84 | + if (dynamicContent == 'myscratchedaccount') { |
| 85 | + $('#myscratchedaccount').show(); |
| 86 | + } |
| 87 | + // Check if the URL parameter is oranges |
| 88 | + else if (dynamicContent == 'staff2') { |
| 89 | + $('#staff2').show(); |
| 90 | + } |
| 91 | + // Check if the URL parameter is bananas |
| 92 | + else if (dynamicContent == 'staff3') { |
| 93 | + $('#staff3').show(); |
| 94 | + } |
| 95 | + // Check if the URL parmeter is empty or not defined, display default content |
| 96 | + else { |
| 97 | + $('#default-content').show(); |
| 98 | + } |
| 99 | + }); |
| 100 | +</script> |
0 commit comments