Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ <h1>Welcome to Geo-Viz</h1>
<button class="menu-button" data-map-type="budget">Trip Budget</button>
</div>
</div>

<div class="selection-controls">
<div class="selection-mode">
<span class="mode-label">Select Country</span>
<div class="button-group">
<button id="source-mode" class="mode-button active">Source Country</button>
<button id="destination-mode" class="mode-button">Destination Country</button>
</div>
</div>
</div>
<div class="map-controls">
<button id="reset-zoom" title="Reset zoom">Reset View</button>
</div>
Expand Down
298 changes: 293 additions & 5 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ body {
justify-content: flex-start;
align-items: flex-start;
border-left: 1px solid #ddd;
padding-top: 15px;
}

.info-panel h2 {
Expand Down Expand Up @@ -168,15 +169,23 @@ body {
display: block;
}

/* Selected country styling */
.selected-country {
stroke: #c629f1;
stroke-width: 6px;
/* Update the source and destination country styles to be more complete */
.source-country {
stroke: #0066cc;
stroke-width: 4px; /* Match the JavaScript value */
stroke-linejoin: round;
stroke-linecap: round;
vector-effect: non-scaling-stroke;
fill-rule: evenodd;
}

.destination-country {
stroke: #cc6600;
stroke-width: 4px; /* Match the JavaScript value */
stroke-linejoin: round;
stroke-linecap: round;
vector-effect: non-scaling-stroke;
}

.data-section {
margin-bottom: 15px;
padding-bottom: 10px;
Expand Down Expand Up @@ -212,4 +221,283 @@ body {

#reset-zoom:hover {
background-color: #f0f0f0;
}

/* Selection mode buttons */
.selection-mode {
display: flex;
align-items: center;
margin-left: 15px;
gap: 10px;
}

.mode-button {
padding: 8px 15px;
margin: 0 5px;
border: 2px solid #ccc;
background-color: #f8f8f8;
border-radius: 5px;
cursor: pointer;
font-weight: 500;
transition: all 0.2s ease-in-out;
}

.mode-button.active {
background: #007bff;
color: white;
border-color: #0056b3;
}

.selection-controls {
margin: 15px 0;
display: flex;
justify-content: center;
}

.selection-mode {
display: flex;
align-items: center;
gap: 10px;
}

.mode-label {
font-weight: 500;
}

.button-group {
display: flex;
}

.mode-button {
padding: 8px 15px;
border: 1px solid #ccc;
background: #f8f9fa;
cursor: pointer;
font-weight: 500;
transition: all 0.2s ease;
}

.mode-button:first-child {
border-radius: 4px 0 0 4px;
border-right: none;
}

.mode-button:last-child {
border-radius: 0 4px 4px 0;
}



/* Default state - subtle styling */
.mode-button:hover {
border-color: #999;
background-color: #eee;
}

/* Source button when active */
.mode-button.source.active {
border-color: #0066cc;
background-color: rgba(0, 102, 204, 0.1);
color: #0066cc;
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Destination button when active */
.mode-button.destination.active {
border-color: #cc6600;
background-color: rgba(204, 102, 0, 0.1);
color: #cc6600;
box-shadow: 0 0 0 2px rgba(204, 102, 0, 0.2);
}

/* Trip details styling */
.trip-details {
margin-top: 20px;
padding: 15px;
background-color: #f8f9fa;
border-radius: 5px;
border-left: 4px solid #007bff;
}

.carbon-data {
font-weight: bold;
color: #28a745;
}

.note {
font-style: italic;
font-size: 0.9em;
color: #6c757d;
}

/* Loading spinner for API calls */
.loading-spinner {
width: 30px;
height: 30px;
margin: 10px auto;
border: 3px solid #f3f3f3;
border-top: 3px solid #007bff;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

/* Carbon visualization styles */
.carbon-visualization {
width: 100%;
height: 15px;
background-color: #f0f0f0;
margin: 10px 0;
border-radius: 10px;
overflow: hidden;
}

.carbon-bar {
height: 100%;
background: linear-gradient(to right, #28a745, #ffc107, #dc3545);
border-radius: 10px 0 0 10px;
transition: width 0.5s ease-in-out;
}

.carbon-context {
font-weight: 500;
margin-top: 15px;
margin-bottom: 5px;
}

.carbon-equivalents {
margin: 0;
padding-left: 20px;
}

.carbon-equivalents li {
margin-bottom: 5px;
color: #555;
}

.carbon-label {
font-weight: bold;
color: #444;
margin-right: 5px;
}

.carbon-value {
font-weight: bold;
color: #28a745;
}

/* Panel selection controls styling */
.panel-controls {
width: 100%;
border-bottom: 1px solid #eee;
padding-bottom: 15px;
margin-bottom: 20px;
}

.panel-controls .button-group {
display: flex;
width: 100%;
}

.panel-controls .mode-button {
flex: 1;
text-align: center;
padding: 10px;
border: 1px solid #ddd;
background-color: #f8f8f8;
transition: all 0.2s ease;
font-weight: 500;
}

.panel-controls .mode-button:first-child {
border-radius: 4px 0 0 4px;
}

.panel-controls .mode-button:last-child {
border-radius: 0 4px 4px 0;
}

/* Keep the specific active styles for source and destination */
.panel-controls .mode-button.source.active {
border-color: #0066cc;
background-color: rgba(0, 102, 204, 0.1);
color: #0066cc;
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.panel-controls .mode-button.destination.active {
border-color: #cc6600;
background-color: rgba(204, 102, 0, 0.1);
color: #cc6600;
box-shadow: 0 0 0 2px rgba(204, 102, 0, 0.2);
}

/* Make the right panel more organized */
.info-panel {
display: flex;
flex-direction: column;
padding-top: 15px;
}

/* Update the title styling */
.panel-controls h3 {
color: #333;
font-size: 1.2rem;
margin-bottom: 12px;
}

/* Add to your CSS file */
.carbon-budget-title {
margin-top: 20px;
margin-bottom: 10px;
font-weight: 600;
}

.carbon-budget-comparison {
margin: 15px 0;
}

.budget-bar-container {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
overflow: hidden;
}

.flight-portion {
transition: width 0.5s ease-in-out;
}

.budget-labels {
color: #555;
font-size: 12px;
}

.max-trips-info {
background-color: #f3f9ff;
padding: 10px;
border-radius: 4px;
margin-top: 12px;
border-left: 3px solid #4dabf7;
}

.carbon-recommendation {
font-weight: 500;
}

.trip-icons {
margin: 10px 0 15px 0;
}

.trip-icon {
animation: bounce 1s ease infinite;
animation-delay: calc(var(--i, 0) * 0.1s);
}

@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-5px); }
}
Loading