feat: updated bottom menu toggle logic and hurst bands color
This commit is contained in:
23
index.html
23
index.html
@ -158,7 +158,7 @@
|
|||||||
<span class="material-symbols-outlined group-hover:text-blue-400">show_chart</span>
|
<span class="material-symbols-outlined group-hover:text-blue-400">show_chart</span>
|
||||||
<span class="text-[10px] font-medium mt-1">Markets</span>
|
<span class="text-[10px] font-medium mt-1">Markets</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col items-center justify-center text-[#b6c4ff] bg-[#2962ff]/10 rounded-xl px-4 py-1.5 transition-transform duration-200 cursor-pointer border border-[#2962ff]/20">
|
<div class="flex flex-col items-center justify-center text-[#b6c4ff] bg-[#2962ff]/10 rounded-xl px-4 py-1.5 transition-transform duration-200 cursor-pointer border border-[#2962ff]/20" onclick="window.hideAllPanels()">
|
||||||
<span class="material-symbols-outlined">candlestick_chart</span>
|
<span class="material-symbols-outlined">candlestick_chart</span>
|
||||||
<span class="text-[10px] font-bold mt-1">Chart</span>
|
<span class="text-[10px] font-bold mt-1">Chart</span>
|
||||||
</div>
|
</div>
|
||||||
@ -184,7 +184,7 @@
|
|||||||
<button class="sidebar-tab active text-xs uppercase tracking-wider font-bold" data-tab="indicators">Indicators</button>
|
<button class="sidebar-tab active text-xs uppercase tracking-wider font-bold" data-tab="indicators">Indicators</button>
|
||||||
<button class="sidebar-tab text-xs uppercase tracking-wider font-bold" data-tab="strategy">Strategy</button>
|
<button class="sidebar-tab text-xs uppercase tracking-wider font-bold" data-tab="strategy">Strategy</button>
|
||||||
</div>
|
</div>
|
||||||
<button class="text-gray-400 hover:text-white p-1 hover:bg-[#2d3a4f] rounded" onclick="document.getElementById('rightSidebar').classList.add('collapsed')">
|
<button class="text-gray-400 hover:text-white p-1 hover:bg-[#2d3a4f] rounded" onclick="window.hideAllPanels()">
|
||||||
<span class="material-symbols-outlined">close</span>
|
<span class="material-symbols-outlined">close</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -226,7 +226,17 @@
|
|||||||
const sidebar = document.getElementById('rightSidebar');
|
const sidebar = document.getElementById('rightSidebar');
|
||||||
if (!sidebar) return;
|
if (!sidebar) return;
|
||||||
|
|
||||||
// Remove collapsed class to show
|
const isOpen = !sidebar.classList.contains('collapsed');
|
||||||
|
const activeTab = document.querySelector('.sidebar-tab.active');
|
||||||
|
const currentTabName = activeTab ? activeTab.dataset.tab : null;
|
||||||
|
|
||||||
|
// If sidebar is open AND the clicked tab is already active, CLOSE IT.
|
||||||
|
if (isOpen && currentTabName === tabName) {
|
||||||
|
sidebar.classList.add('collapsed');
|
||||||
|
return; // Done
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, OPEN it (remove collapsed) and switch tab
|
||||||
sidebar.classList.remove('collapsed');
|
sidebar.classList.remove('collapsed');
|
||||||
|
|
||||||
if (tabName) {
|
if (tabName) {
|
||||||
@ -237,6 +247,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.hideAllPanels = function() {
|
||||||
|
const sidebar = document.getElementById('rightSidebar');
|
||||||
|
if (sidebar) {
|
||||||
|
sidebar.classList.add('collapsed');
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="./config.js"></script>
|
<script src="./config.js"></script>
|
||||||
|
|||||||
@ -773,18 +773,25 @@ function addIndicator(type) {
|
|||||||
|
|
||||||
// Override with Hurst-specific defaults
|
// Override with Hurst-specific defaults
|
||||||
if (type === 'hurst') {
|
if (type === 'hurst') {
|
||||||
|
const hurstCount = activeIndicators.filter(ind => ind.type === 'hurst').length;
|
||||||
|
const color = hurstCount > 0 ? '#ff9800' : '#9e9e9e';
|
||||||
|
|
||||||
params._lineWidth = 1;
|
params._lineWidth = 1;
|
||||||
params.timeframe = 'chart';
|
params.timeframe = 'chart';
|
||||||
params.markerBuyShape = 'custom';
|
params.markerBuyShape = 'custom';
|
||||||
params.markerSellShape = 'custom';
|
params.markerSellShape = 'custom';
|
||||||
params.markerBuyColor = '#9e9e9e';
|
params.markerBuyColor = color;
|
||||||
params.markerSellColor = '#9e9e9e';
|
params.markerSellColor = color;
|
||||||
params.markerBuyCustom = '▲';
|
params.markerBuyCustom = '▲';
|
||||||
params.markerSellCustom = '▼';
|
params.markerSellCustom = '▼';
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata.plots.forEach((plot, idx) => {
|
metadata.plots.forEach((plot, idx) => {
|
||||||
|
if (type === 'hurst' && activeIndicators.filter(ind => ind.type === 'hurst').length > 0) {
|
||||||
|
params[`_color_${idx}`] = '#ff9800';
|
||||||
|
} else {
|
||||||
params[`_color_${idx}`] = plot.color || getDefaultColor(activeIndicators.length + idx);
|
params[`_color_${idx}`] = plot.color || getDefaultColor(activeIndicators.length + idx);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
metadata.inputs.forEach(input => {
|
metadata.inputs.forEach(input => {
|
||||||
params[input.name] = input.default;
|
params[input.name] = input.default;
|
||||||
|
|||||||
Reference in New Issue
Block a user