brighter-trading/src/templates/strategies_hud.html

200 lines
4.2 KiB
HTML

<div class="content" id="strats_content">
<button class="btn" id="new_strats_btn" onclick="UI.strats.uiManager.displayForm('new')">New Strategy</button>
<hr>
<h3>Strategies</h3>
<div class="strategies-container" id="strats_display"></div>
</div>
<style>
.strategies-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
position: relative;
}
.strategy-item {
position: relative;
width: 100px;
height: 100px;
text-align: center;
transition: transform 0.3s ease;
z-index: 1; /* Set default z-index */
}
.strategy-item:hover {
transform: scale(1.05);
z-index: 10; /* Bring the hovered item to the front */
}
.strategy-icon {
width: 100px;
height: 100px;
background-image: url('/static/trading_strategy_icon.webp'); /* Path to your icon */
background-size: cover;
background-position: center;
border-radius: 10px;
position: relative;
}
.strategy-name {
position: absolute;
top: 60px;
left: 50%;
transform: translateX(-50%);
background-color: white;
padding: 5px 10px;
border-radius: 20px;
font-size: 12px;
color: black;
text-align: center;
width: 80px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.delete-button {
z-index: 20;
position: absolute;
top: 5px;
left: 5px;
background-color: red;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 14px;
cursor: pointer;
transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.delete-button:hover {
transform: scale(1.2); /* Increase size slightly on hover */
background-color: darkred; /* Darken background on hover */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow effect */
}
.strategy-hover {
display: none;
position: absolute;
top: 0;
left: 110px;
width: 200px;
padding: 10px;
background-color: #f0f0f0;
border-radius: 8px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
font-size: 12px;
color: #333;
z-index: 50; /* Make sure it hovers above all other elements */
}
.strategy-item:hover .strategy-hover {
display: block;
}
/* Run button styling */
.run-button {
z-index: 20;
position: absolute;
top: 5px;
right: 5px;
background-color: #28a745;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 10px;
cursor: pointer;
transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.run-button:hover {
transform: scale(1.2);
background-color: #218838;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.run-button.running {
background-color: #dc3545;
}
.run-button.running:hover {
background-color: #c82333;
}
/* Strategy hover panel controls */
.strategy-controls {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #ddd;
}
.strategy-controls select {
width: 100%;
padding: 5px;
margin-bottom: 8px;
border-radius: 4px;
border: 1px solid #ccc;
font-size: 12px;
}
.strategy-controls .btn-run {
width: 100%;
padding: 6px;
background-color: #28a745;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.2s;
}
.strategy-controls .btn-run:hover {
background-color: #218838;
}
.strategy-controls .btn-run.running {
background-color: #dc3545;
}
.strategy-controls .btn-run.running:hover {
background-color: #c82333;
}
.strategy-status {
margin-top: 8px;
padding: 5px;
background-color: #e9ecef;
border-radius: 4px;
font-size: 11px;
}
.strategy-status.running {
background-color: #d4edda;
color: #155724;
}
/* Running indicator on strategy icon */
.strategy-icon.running {
border: 3px solid #28a745;
animation: pulse 2s infinite;
}
@keyframes pulse {
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); }
}
</style>