Add economic calendar feature with n8n integration
All checks were successful
Deploy to Server / deploy (push) Successful in 36s

- Add economic calendar tab with monthly view
- Display today's events in header
- Add weekly summary section
- Integrate with Forex Factory via n8n webhook
- Add Header Auth API authentication
- Add KST timezone conversion
- Add country filter (US, JP, CN)
- Add importance-based event styling
- Add more events modal for days with many events
- Update calendar grid to show up to 4 events per day
- Add n8n workflow configuration files
This commit is contained in:
kihong.kim
2025-12-31 15:24:30 +09:00
parent 4c351196b7
commit 022fddec9c
7 changed files with 1850 additions and 13 deletions

View File

@@ -34,8 +34,53 @@ body {
}
.header h1 {
font-size: 1.5rem;
font-size: 1.3rem;
color: #f0b90b;
white-space: nowrap;
}
/* Tab Navigation */
.tab-nav {
display: flex;
gap: 5px;
background: #2a2e39;
padding: 4px;
border-radius: 8px;
}
.tab-btn {
padding: 8px 16px;
background: transparent;
border: none;
color: #848e9c;
font-size: 14px;
font-weight: 500;
cursor: pointer;
border-radius: 6px;
transition: all 0.2s;
}
.tab-btn:hover {
color: #d1d4dc;
}
.tab-btn.active {
background: #f0b90b;
color: #131722;
}
/* Tab Content */
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Hide chart-only elements in calendar tab */
.chart-only {
transition: opacity 0.2s;
}
.controls {
@@ -58,6 +103,71 @@ select:hover {
border-color: #f0b90b;
}
/* Header Events (Today's Schedule) */
.header-events {
display: flex;
flex-wrap: wrap;
gap: 8px;
flex: 1;
justify-content: flex-start;
padding-left: 15px;
}
.header-events-loading {
color: #848e9c;
font-size: 12px;
}
.header-event-item {
display: flex;
align-items: center;
gap: 6px;
background: #2a2e39;
padding: 6px 10px;
border-radius: 6px;
font-size: 12px;
white-space: nowrap;
}
.header-event-item.importance-3 {
border-left: 3px solid #f0b90b;
}
.header-event-item.importance-2 {
border-left: 3px solid #848e9c;
}
.header-event-item.importance-1 {
border-left: 3px solid #4a4e59;
}
.header-event-time {
color: #848e9c;
font-size: 11px;
min-width: 35px;
}
.header-event-country {
font-size: 14px;
}
.header-event-name {
color: #d1d4dc;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
.header-event-stars {
color: #f0b90b;
font-size: 10px;
}
.header-events-empty {
color: #6c7284;
font-size: 12px;
}
.price-info {
display: flex;
flex-direction: column;
@@ -495,6 +605,555 @@ select:hover {
to { transform: rotate(360deg); }
}
/* Weekly Summary Bar */
.weekly-summary {
background: #1e222d;
border-radius: 8px;
padding: 12px 15px;
margin-top: 10px;
}
.weekly-summary-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
}
.weekly-icon {
font-size: 16px;
}
.weekly-title {
font-size: 14px;
font-weight: 600;
color: #f0b90b;
flex: 1;
}
.weekly-more-btn {
background: transparent;
border: 1px solid #363a45;
color: #848e9c;
padding: 4px 10px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
}
.weekly-more-btn:hover {
border-color: #f0b90b;
color: #f0b90b;
}
.weekly-events {
display: flex;
gap: 15px;
overflow-x: auto;
padding-bottom: 5px;
}
.weekly-event-item {
display: flex;
align-items: center;
gap: 8px;
background: #2a2e39;
padding: 8px 12px;
border-radius: 6px;
white-space: nowrap;
flex-shrink: 0;
}
.weekly-event-date {
font-size: 12px;
color: #848e9c;
}
.weekly-event-country {
font-size: 14px;
}
.weekly-event-name {
font-size: 13px;
color: #d1d4dc;
}
.weekly-event-importance {
color: #f0b90b;
font-size: 10px;
}
/* Economic Calendar Tab */
.calendar-container {
padding: 10px 0;
}
.calendar-filters {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
flex-wrap: wrap;
gap: 10px;
}
.country-filters {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.country-btn {
padding: 8px 14px;
background: #2a2e39;
border: 1px solid #363a45;
color: #848e9c;
font-size: 13px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}
.country-btn:hover {
border-color: #f0b90b;
color: #d1d4dc;
}
.country-btn.active {
background: #f0b90b;
border-color: #f0b90b;
color: #131722;
}
.period-filter select {
padding: 8px 15px;
background: #2a2e39;
border: 1px solid #363a45;
border-radius: 6px;
color: #d1d4dc;
font-size: 13px;
cursor: pointer;
}
/* Calendar List */
.calendar-list {
background: #1e222d;
border-radius: 8px;
overflow: hidden;
}
.calendar-date-group {
border-bottom: 1px solid #2a2e39;
}
.calendar-date-group:last-child {
border-bottom: none;
}
.calendar-date-header {
background: #2a2e39;
padding: 10px 15px;
font-size: 14px;
font-weight: 600;
color: #f0b90b;
}
.calendar-event {
display: flex;
align-items: center;
padding: 12px 15px;
border-bottom: 1px solid #2a2e39;
gap: 12px;
}
.calendar-event:last-child {
border-bottom: none;
}
.calendar-event:hover {
background: #252930;
}
.event-time {
font-size: 13px;
color: #848e9c;
min-width: 50px;
}
.event-country {
font-size: 18px;
min-width: 30px;
}
.event-info {
flex: 1;
}
.event-name {
font-size: 14px;
color: #d1d4dc;
margin-bottom: 3px;
}
.event-detail {
font-size: 12px;
color: #6c7284;
}
.event-importance {
display: flex;
gap: 2px;
}
.importance-star {
color: #363a45;
font-size: 12px;
}
.importance-star.active {
color: #f0b90b;
}
.event-values {
display: flex;
gap: 15px;
min-width: 200px;
justify-content: flex-end;
}
.event-value {
text-align: right;
}
.event-value-label {
font-size: 10px;
color: #6c7284;
text-transform: uppercase;
}
.event-value-number {
font-size: 13px;
color: #d1d4dc;
font-weight: 500;
}
.event-value-number.positive {
color: #26a69a;
}
.event-value-number.negative {
color: #ef5350;
}
.loading-text {
padding: 30px;
text-align: center;
color: #848e9c;
}
/* Monthly Calendar Grid */
.calendar-grid {
background: #1e222d;
border-radius: 8px;
overflow: hidden;
}
.calendar-grid-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background: #2a2e39;
}
.calendar-month-title {
font-size: 16px;
font-weight: 600;
color: #f0b90b;
}
.calendar-nav {
display: flex;
gap: 10px;
}
.calendar-nav-btn {
background: #363a45;
border: none;
color: #d1d4dc;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.calendar-nav-btn:hover {
background: #4a4e59;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
background: #252930;
border-bottom: 1px solid #363a45;
}
.calendar-weekday {
padding: 10px;
text-align: center;
font-size: 12px;
font-weight: 600;
color: #848e9c;
}
.calendar-weekday:first-child {
color: #ef5350;
}
.calendar-weekday:last-child {
color: #2196f3;
}
.calendar-days {
display: grid;
grid-template-columns: repeat(7, 1fr);
}
.calendar-day {
min-height: 120px;
padding: 8px;
border-right: 1px solid #2a2e39;
border-bottom: 1px solid #2a2e39;
background: #1e222d;
overflow: hidden;
}
.calendar-day:nth-child(7n) {
border-right: none;
}
.calendar-day.other-month {
background: #171b24;
}
.calendar-day.other-month .day-number {
color: #4a4e59;
}
.calendar-day.today {
background: #252930;
}
.calendar-day.today .day-number {
background: #f0b90b;
color: #131722;
border-radius: 50%;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.day-number {
font-size: 12px;
color: #d1d4dc;
margin-bottom: 5px;
}
.calendar-day:nth-child(7n+1) .day-number {
color: #ef5350;
}
.calendar-day:nth-child(7n) .day-number {
color: #2196f3;
}
.calendar-day.other-month:nth-child(7n+1) .day-number,
.calendar-day.other-month:nth-child(7n) .day-number {
color: #4a4e59;
}
.day-events {
display: flex;
flex-direction: column;
gap: 2px;
width: 100%;
overflow: hidden;
}
.day-event {
display: flex;
align-items: center;
gap: 4px;
padding: 2px 4px;
background: #2a2e39;
border-radius: 3px;
font-size: 10px;
color: #d1d4dc;
overflow: hidden;
min-width: 0;
cursor: pointer;
}
.day-event:hover {
background: #363a45;
}
.day-event.importance-3 {
border-left: 2px solid #f0b90b;
}
.day-event.importance-2 {
border-left: 2px solid #848e9c;
}
.day-event.importance-1 {
border-left: 2px solid #4a4e59;
}
.day-event-time {
font-size: 9px;
color: #848e9c;
min-width: 32px;
}
.day-event-country {
font-size: 11px;
}
.day-event-name {
flex: 1;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.day-event-stars {
font-size: 8px;
color: #f0b90b;
margin-left: 2px;
}
.day-event-more {
font-size: 10px;
color: #848e9c;
padding: 2px 4px;
cursor: pointer;
}
.day-event-more:hover {
color: #f0b90b;
}
/* Events Modal */
.events-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.events-modal {
background: #1e222d;
border-radius: 12px;
min-width: 320px;
max-width: 90vw;
max-height: 80vh;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
border: 1px solid #2a2e39;
}
.events-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
background: #252930;
border-bottom: 1px solid #2a2e39;
}
.events-modal-header h3 {
margin: 0;
font-size: 16px;
color: #d1d4dc;
}
.events-modal-close {
background: none;
border: none;
color: #848e9c;
font-size: 24px;
cursor: pointer;
padding: 0;
line-height: 1;
}
.events-modal-close:hover {
color: #f0b90b;
}
.events-modal-body {
padding: 16px 20px;
max-height: 60vh;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 8px;
}
.modal-event {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
background: #2a2e39;
border-radius: 6px;
font-size: 13px;
color: #d1d4dc;
}
.modal-event.importance-3 {
border-left: 3px solid #f0b90b;
}
.modal-event.importance-2 {
border-left: 3px solid #848e9c;
}
.modal-event.importance-1 {
border-left: 3px solid #4a4e59;
}
.modal-event-time {
color: #848e9c;
font-size: 12px;
min-width: 40px;
}
.modal-event-country {
font-size: 16px;
}
.modal-event-name {
flex: 1;
color: #d1d4dc;
}
.modal-event-stars {
color: #f0b90b;
font-size: 11px;
}
/* Responsive */
@media (max-width: 768px) {
.header {
@@ -502,10 +1161,26 @@ select:hover {
gap: 10px;
}
.title-section {
flex-direction: column;
gap: 10px;
width: 100%;
}
.header h1 {
font-size: 1.2rem;
}
.header-events {
max-width: 100%;
justify-content: flex-start;
padding: 0;
}
.header-event-name {
max-width: 80px;
}
#main-chart {
height: 350px;
}
@@ -520,4 +1195,14 @@ select:hover {
flex-wrap: wrap;
gap: 8px;
}
.calendar-event {
flex-wrap: wrap;
}
.event-values {
width: 100%;
justify-content: flex-start;
margin-top: 8px;
}
}