|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>API Endpoints</title> |
| 7 | + <style> |
| 8 | + /* General styling for dark theme */ |
| 9 | + body { |
| 10 | + background-color: #121212; |
| 11 | + color: #e0e0e0; |
| 12 | + font-family: Arial, sans-serif; |
| 13 | + margin: 0; |
| 14 | + padding: 0; |
| 15 | + } |
| 16 | + .container { |
| 17 | + max-width: 800px; |
| 18 | + margin: 0 auto; |
| 19 | + padding: 20px; |
| 20 | + } |
| 21 | +
|
| 22 | + /* Search box styling */ |
| 23 | + .search-container { |
| 24 | + margin-bottom: 20px; |
| 25 | + } |
| 26 | + .search-input { |
| 27 | + width: 100%; |
| 28 | + padding: 10px; |
| 29 | + font-size: 16px; |
| 30 | + background-color: #1e1e1e; |
| 31 | + color: #e0e0e0; |
| 32 | + border: 1px solid #333; |
| 33 | + border-radius: 4px; |
| 34 | + } |
| 35 | +
|
| 36 | + /* Card styling */ |
| 37 | + .card { |
| 38 | + background-color: #1e1e1e; |
| 39 | + border: 1px solid #333; |
| 40 | + border-radius: 8px; |
| 41 | + padding: 20px; |
| 42 | + } |
| 43 | + .card-header { |
| 44 | + font-size: 22px; |
| 45 | + font-weight: bold; |
| 46 | + color: #ffffff; |
| 47 | + margin-bottom: 15px; |
| 48 | + } |
| 49 | +
|
| 50 | + /* Endpoint list styling */ |
| 51 | + .endpoint-list { |
| 52 | + list-style-type: none; |
| 53 | + padding: 0; |
| 54 | + margin: 0; |
| 55 | + } |
| 56 | + .endpoint-item { |
| 57 | + border-bottom: 1px solid #333; |
| 58 | + padding: 10px 0; |
| 59 | + } |
| 60 | + .endpoint-info { |
| 61 | + display: flex; |
| 62 | + align-items: center; |
| 63 | + margin-bottom: 5px; |
| 64 | + } |
| 65 | +
|
| 66 | + /* Method badge styles */ |
| 67 | + .endpoint-method { |
| 68 | + padding: 6px 10px; |
| 69 | + border-radius: 4px; |
| 70 | + font-weight: bold; |
| 71 | + color: #ffffff; |
| 72 | + margin-right: 10px; |
| 73 | + text-transform: uppercase; |
| 74 | + } |
| 75 | + .get { background-color: #4caf50; } |
| 76 | + .post { background-color: #2196f3; } |
| 77 | + .put { background-color: #ff9800; } |
| 78 | + .delete { background-color: #f44336; } |
| 79 | +
|
| 80 | +
|
| 81 | + /* URL and description styles */ |
| 82 | + .endpoint-url { |
| 83 | + font-weight: bold; |
| 84 | + color: #e0e0e0; |
| 85 | + } |
| 86 | + .endpoint-description { |
| 87 | + color: #b0b0b0; |
| 88 | + } |
| 89 | + </style> |
| 90 | +</head> |
| 91 | +<body> |
| 92 | +<div class="container"> |
| 93 | + <div class="search-container"> |
| 94 | + <input type="text" class="search-input" placeholder="Search endpoints..." /> |
| 95 | + </div> |
| 96 | + |
| 97 | + <div class="card"> |
| 98 | + <div class="card-header">API Endpoints</div> |
| 99 | + <ul class="endpoint-list"> |
| 100 | + @foreach ($routeData as $route) |
| 101 | + <li class="endpoint-item"> |
| 102 | + <div class="endpoint-info"> |
| 103 | + <div class="endpoint-method {{ strtolower($route['method']) }}">{{ $route['method'] }}</div> |
| 104 | + <div class="endpoint-url">{{ $route['url'] }}</div> |
| 105 | + </div> |
| 106 | + <div class="endpoint-description">{{ $route['name'] }} - {{ $route['action'] }}</div> |
| 107 | + </li> |
| 108 | + @endforeach |
| 109 | + </ul> |
| 110 | + </div> |
| 111 | +</div> |
| 112 | + |
| 113 | +<script> |
| 114 | + const searchInput = document.querySelector('.search-input'); |
| 115 | + const endpointItems = document.querySelectorAll('.endpoint-item'); |
| 116 | +
|
| 117 | + searchInput.addEventListener('input', () => { |
| 118 | + const searchTerm = searchInput.value.toLowerCase(); |
| 119 | + endpointItems.forEach(item => { |
| 120 | + const url = item.querySelector('.endpoint-url').textContent.toLowerCase(); |
| 121 | + const description = item.querySelector('.endpoint-description').textContent.toLowerCase(); |
| 122 | + if (url.includes(searchTerm) || description.includes(searchTerm)) { |
| 123 | + item.style.display = 'block'; |
| 124 | + } else { |
| 125 | + item.style.display = 'none'; |
| 126 | + } |
| 127 | + }); |
| 128 | + }); |
| 129 | +</script> |
| 130 | +</body> |
| 131 | +</html> |
0 commit comments