diff --git a/aocsync.py b/aocsync.py index e287076..dc10cee 100755 --- a/aocsync.py +++ b/aocsync.py @@ -1052,21 +1052,66 @@ class HTMLGenerator: text-decoration: underline; }} - .history-data {{ + .modal {{ display: none; - margin-top: 5px; - padding: 5px; - background: #f0f0f0; - border-radius: 4px; - font-size: 0.8em; + position: fixed; + z-index: 1000; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0,0,0,0.5); }} - .history-data.show {{ + .modal.show {{ display: block; }} + .modal-content {{ + background-color: #fefefe; + margin: 5% auto; + padding: 20px; + border: 1px solid #888; + border-radius: 8px; + width: 80%; + max-width: 600px; + max-height: 80vh; + overflow-y: auto; + position: relative; + }} + + .modal-header {{ + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; + padding-bottom: 10px; + border-bottom: 2px solid #667eea; + }} + + .modal-title {{ + font-size: 1.2em; + font-weight: bold; + color: #333; + }} + + .modal-close {{ + color: #aaa; + font-size: 28px; + font-weight: bold; + cursor: pointer; + line-height: 20px; + }} + + .modal-close:hover, + .modal-close:focus {{ + color: #000; + text-decoration: none; + }} + .history-item {{ - padding: 2px 0; + padding: 8px 0; border-bottom: 1px solid #ddd; }} @@ -1115,11 +1160,26 @@ class HTMLGenerator: }} @@ -1182,8 +1242,10 @@ class HTMLGenerator: if not user_info[user]['repo_url']: user_info[user]['repo_url'] = time_data.get('repo_url', '') - # Find fastest times per day/part for highlighting + # Find fastest and slowest times per day/part for highlighting and speed multiple fastest_times = {} + slowest_times = {} + speed_multiples = {} for day, part in day_part_combos: part_data = data[year][day][part] times = [] @@ -1196,6 +1258,11 @@ class HTMLGenerator: times.append(total_time) if times: fastest_times[(day, part)] = min(times) + slowest_times[(day, part)] = max(times) + if fastest_times[(day, part)] > 0: + speed_multiples[(day, part)] = slowest_times[(day, part)] / fastest_times[(day, part)] + else: + speed_multiples[(day, part)] = 0 # Create table with transposed structure html += """ @@ -1220,7 +1287,8 @@ class HTMLGenerator: html += f'