brighter-trading/src/templates/signals_hud.html

363 lines
9.8 KiB
HTML

<div class="content" id="signal_content">
<div style="display: grid; grid-template-columns: 1fr 1fr;">
<div class="section" style="grid-column: 1;">
<button class="btn" id="new_signal" onclick="UI.signals.open_signal_Form()">New Signal</button>
</div>
<div class="section" style="grid-column: 2;">
<button class="btn" id="new_external_source" onclick="UI.signals.openSignalTypeForm()">+ External Source</button>
</div>
</div>
<hr>
<!-- External Sources Section (Real-time only) -->
<div id="external_sources_section" style="display: none; margin-bottom: 15px;">
<h3>External Sources <span style="font-size: 11px; color: #888;">(Real-time only - no backtesting)</span></h3>
<div class="external-sources-container" id="external_sources_list"></div>
<hr>
</div>
<h3>Signals</h3>
<div class="signals-container" id="signal_list"></div>
</div>
<style>
/* Signals container - flex grid for cards */
.signals-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
padding: 10px;
}
/* Individual signal card */
.signal-item {
position: relative;
width: 100px;
height: 100px;
border-radius: 10px;
background: linear-gradient(145deg, #f0f0f0, #cacaca);
box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
cursor: pointer;
transition: all 0.3s ease;
overflow: visible;
}
.signal-item:hover {
transform: translateY(-3px);
box-shadow: 8px 8px 15px #bebebe, -8px -8px 15px #ffffff;
}
/* State-based border colors */
.signal-item.signal-true {
border: 3px solid #28a745;
animation: pulse-green 2s infinite;
}
.signal-item.signal-false {
border: 3px solid #dc3545;
}
@keyframes pulse-green {
0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}
/* Signal icon area */
.signal-icon {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
position: relative;
}
/* CSS-based signal icon */
.signal-icon::before {
content: '';
position: absolute;
top: 10px;
width: 40px;
height: 40px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.signal-icon::after {
content: '\2248'; /* Approximately equal symbol */
position: absolute;
top: 15px;
font-size: 28px;
color: white;
font-weight: bold;
}
/* Signal name */
.signal-name {
font-size: 11px;
font-weight: bold;
text-align: center;
color: #333;
margin-top: 50px;
word-wrap: break-word;
max-width: 90px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* State indicator */
.signal-state {
font-size: 10px;
font-weight: bold;
padding: 2px 6px;
border-radius: 3px;
margin-top: 3px;
}
.signal-true .signal-state {
background: #28a745;
color: white;
}
.signal-false .signal-state {
background: #dc3545;
color: white;
}
/* Delete button */
.signal-item .delete-button {
position: absolute;
top: -8px;
right: -8px;
width: 22px;
height: 22px;
border-radius: 50%;
background: #dc3545;
color: white;
border: 2px solid white;
font-size: 12px;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
z-index: 10;
transition: transform 0.2s;
}
.signal-item:hover .delete-button {
display: flex;
}
.signal-item .delete-button:hover {
transform: scale(1.2);
}
/* Hover details panel */
.signal-hover {
position: absolute;
top: 110px;
left: 50%;
transform: translateX(-50%);
width: 200px;
padding: 10px;
background: white;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
z-index: 100;
display: none;
font-size: 11px;
}
.signal-item:hover .signal-hover {
display: block;
}
.signal-hover strong {
display: block;
margin-bottom: 8px;
font-size: 13px;
color: #333;
border-bottom: 1px solid #eee;
padding-bottom: 5px;
}
.signal-details {
display: flex;
flex-direction: column;
gap: 4px;
}
.signal-details span {
color: #666;
}
.signal-details .state-true {
color: #28a745;
font-weight: bold;
}
.signal-details .state-false {
color: #dc3545;
font-weight: bold;
}
.signal-public-badge {
display: inline-block;
background: #17a2b8;
color: white;
padding: 2px 6px;
border-radius: 3px;
font-size: 9px;
margin-top: 5px;
}
/* External Sources Styles */
.external-sources-container {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 10px;
}
.external-source-item {
position: relative;
padding: 10px 15px;
background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
border: 1px solid #444;
border-radius: 8px;
min-width: 150px;
cursor: pointer;
transition: all 0.2s ease;
}
.external-source-item:hover {
border-color: #17a2b8;
transform: translateY(-2px);
}
.external-source-item .source-name {
font-weight: bold;
color: #e0e0e0;
font-size: 13px;
margin-bottom: 5px;
}
.external-source-item .source-value {
font-size: 20px;
font-weight: bold;
color: #17a2b8;
}
.external-source-item .source-time {
font-size: 10px;
color: #888;
margin-top: 5px;
}
.external-source-item .delete-source-btn {
position: absolute;
top: 5px;
right: 5px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #dc3545;
color: white;
border: none;
font-size: 10px;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
}
.external-source-item:hover .delete-source-btn {
display: flex;
}
.external-source-item .refresh-btn {
position: absolute;
top: 5px;
right: 28px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #28a745;
color: white;
border: none;
font-size: 10px;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
}
.external-source-item:hover .refresh-btn {
display: flex;
}
/* External Indicators Styles */
.external-indicators-container {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 10px;
}
.external-indicator-item {
position: relative;
padding: 10px 15px;
background: linear-gradient(145deg, #3d2a5a, #2a1e3e);
border: 1px solid #6f42c1;
border-radius: 8px;
min-width: 150px;
cursor: pointer;
transition: all 0.2s ease;
}
.external-indicator-item:hover {
border-color: #9f7aea;
transform: translateY(-2px);
}
.external-indicator-item .indicator-name {
font-weight: bold;
color: #e0e0e0;
font-size: 13px;
margin-bottom: 5px;
}
.external-indicator-item .indicator-type {
font-size: 11px;
color: #9f7aea;
}
.external-indicator-item .delete-indicator-btn {
position: absolute;
top: 5px;
right: 5px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #dc3545;
color: white;
border: none;
font-size: 10px;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
}
.external-indicator-item:hover .delete-indicator-btn {
display: flex;
}
</style>