Certainly! Below is a revamped version of your Forex Checklist Analyzer with a more visually appealing, complex, and feature-rich interface while maintaining your original color palette. This redesign incorporates modern UI/UX principles, enhanced typography, interactive elements, and responsive design to provide a more engaging user experience.
Updated HTML Structure
The updated HTML includes additional sections for improved navigation, modals for adding criteria, and enhanced layout structures. Here's the complete HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forex Checklist Analyzer</title>
<!-- External Stylesheets -->
<link rel="stylesheet" href="styles.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<!-- External Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script>
<!-- Inline JavaScript (Ensure to include your existing JS logic here or link to an external JS file) -->
<script type="module" src="app.js"></script>
</head>
<body>
<!-- Side Navigation -->
<nav class="side-nav">
<div class="logo">
<h2>Forex Analyzer</h2>
</div>
<ul class="nav-links">
<li><a href="#"><span class="icon">🏠</span> Dashboard</a></li>
<li><a href="#"><span class="icon">✅</span> Checklist</a></li>
<li><a href="#"><span class="icon">📊</span> Reports</a></li>
<li><a href="#"><span class="icon">⚙️</span> Settings</a></li>
</ul>
</nav>
<!-- Main Content -->
<main class="main-container">
<!-- Header -->
<header class="main-header">
<div class="header-left">
<h1 class="editable-title" id="titleSection1" contenteditable="true">Essential Criteria</h1>
<div class="slider-wrapper">
<div class="slider-background">
<div id="sliderFillSection1" class="slider-fill">
<div id="numericalLabelSection1" class="numerical-label">0</div>
</div>
</div>
<div class="progress-info">
<span>Total: <span id="totalItemsSection1">0</span></span>
<span>Active: <span id="activeItemsSection1">0</span></span>
</div>
</div>
</div>
<div class="header-right">
<input type="text" id="searchBoxSection1" class="search-box" placeholder="Search criteria...">
<button class="add-button" id="addButton">➕ Add</button>
<button class="export-button">📤 Export</button>
<button class="import-button">📥 Import</button>
</div>
</header>
<!-- Checklist Section -->
<section class="checklist-section">
<div id="checklistContainerSection1" class="checklist-container"></div>
</section>
<!-- Footer -->
<footer class="main-footer">
<p>© 2023 Forex Checklist Analyzer. All rights reserved.</p>
</footer>
</main>
<!-- Add Criterion Modal -->
<div id="addModal" class="modal">
<div class="modal-content">
<span class="close-button" id="closeModal">×</span>
<h2>Add New Criterion</h2>
<form id="addCriterionForm">
<div class="form-group">
<label for="criterionName">Name:</label>
<input type="text" id="criterionName" name="criterionName" required>
</div>
<div class="form-group">
<label for="criterionPriority">Priority:</label>
<input type="number" id="criterionPriority" name="criterionPriority" min="0" required>
</div>
<div class="form-actions">
<button type="submit" class="submit-button">Add</button>
<button type="button" class="cancel-button" id="cancelAdd">Cancel</button>
</div>
</form>
</div>
</div>
<!-- Import Data Modal -->
<div id="importModal" class="modal">
<div class="modal-content">
<span class="close-button" id="closeImportModal">×</span>
<h2>Import Checklist Data</h2>
<input type="file" id="importFile" accept="application/json">
<button class="submit-button" id="importDataButton">Import</button>
</div>
</div>
</body>
</html>
Enhanced CSS Styling
The following CSS provides a comprehensive and sophisticated design for your application. It includes side navigation, modals, enhanced buttons, improved typography, and responsive design.
/* styles.css */
/* Global Styles */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: linear-gradient(135deg, #1A2634, #323C4F, #424D5C);
color: #F2F2F2;
font-family: 'Roboto', sans-serif;
overflow: hidden;
}
/* Side Navigation */
.side-nav {
position: fixed;
left: 0;
top: 0;
width: 220px;
height: 100%;
background: #1A2634;
box-shadow: 2px 0 5px rgba(0,0,0,0.5);
padding-top: 20px;
transition: width 0.3s;
z-index: 1000;
}
.side-nav .logo {
text-align: center;
margin-bottom: 40px;
}
.side-nav .logo h2 {
color: #D8A7A1;
font-size: 1.8em;
letter-spacing: 1px;
}
.side-nav .nav-links {
list-style: none;
padding: 0;
}
.side-nav .nav-links li {
margin: 20px 0;
}
.side-nav .nav-links a {
color: #F2F2F2;
text-decoration: none;
font-size: 1.1em;
display: flex;
align-items: center;
padding: 10px 20px;
transition: background 0.3s, color 0.3s;
border-radius: 5px;
}
.side-nav .nav-links a:hover {
background: #323C4F;
color: #D8A7A1;
}
.side-nav .nav-links .icon {
margin-right: 10px;
font-size: 1.2em;
}
/* Main Container */
.main-container {
margin-left: 220px;
padding: 20px 30px;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
@media (max-width: 768px) {
.side-nav {
width: 60px;
}
.side-nav .logo h2,
.side-nav .nav-links a span.icon + span {
display: none;
}
.main-container {
margin-left: 60px;
padding: 15px 20px;
}
}
/* Header */
.main-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
flex-wrap: wrap;
}
.header-left {
flex: 1;
min-width: 250px;
}
.editable-title {
font-size: 2em;
font-weight: 700;
color: #F2F2F2;
margin-bottom: 15px;
border-bottom: 2px solid rgba(255, 255, 255, 0.2);
padding-bottom: 10px;
transition: border-bottom 0.3s;
}
.editable-title:focus {
outline: none;
border-bottom: 2px solid #D8A7A1;
}
.slider-wrapper {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.slider-background {
background-color: rgba(255, 255, 255, 0.2);
height: 25px;
border-radius: 15px;
position: relative;
overflow: hidden;
flex: 1;
}
.slider-fill {
background: linear-gradient(to right, #B38184, #D8A7A1);
height: 100%;
border-radius: 15px;
width: 0%;
position: relative;
transition: width 0.5s ease-in-out;
}
.numerical-label {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #F2F2F2;
font-weight: 700;
font-size: 0.9em;
white-space: nowrap;
left: calc(100% + 10px); /* Position outside the slider */
}
.progress-info {
display: flex;
gap: 20px;
font-size: 1em;
}
.progress-info span {
display: flex;
align-items: center;
gap: 5px;
}
/* Header Right */
.header-right {
display: flex;
align-items: center;
gap: 10px;
margin-top: 10px;
}
.search-box {
background-color: rgba(255, 255, 255, 0.1);
border: none;
padding: 10px 15px;
color: #F2F2F2;
width: 250px;
max-width: 100%;
border-radius: 5px;
transition: box-shadow 0.3s;
}
.search-box::placeholder {
color: #F2F2F2;
opacity: 0.7;
}
.search-box:focus {
outline: none;
box-shadow: 0 0 5px #D8A7A1;
}
.header-right button {
background: linear-gradient(to right, #B38184, #D8A7A1);
border: none;
color: #1A2634;
padding: 10px 15px;
font-size: 1em;
cursor: pointer;
border-radius: 5px;
font-weight: 700;
display: flex;
align-items: center;
gap: 5px;
transition: background 0.3s, transform 0.2s;
}
.header-right button:hover {
background: linear-gradient(to right, #D8A7A1, #B38184);
}
.header-right button:active {
transform: scale(0.98);
}
.header-right .add-button {
background: #D8A7A1;
color: #1A2634;
}
.header-right .add-button:hover {
background: #B38184;
}
.header-right .export-button,
.header-right .import-button {
background: rgba(255, 255, 255, 0.1);
color: #D8A7A1;
}
.header-right .export-button:hover,
.header-right .import-button:hover {
background: rgba(255, 255, 255, 0.2);
}
/* Checklist Container */
.checklist-container {
flex: 1;
overflow-y: auto;
padding-right: 10px;
}
/* Checklist Items */
.checklist-item {
display: flex;
align-items: center;
background-color: rgba(255, 255, 255, 0.05);
padding: 15px;
margin-bottom: 15px;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
transition: background-color 0.3s, transform 0.3s;
cursor: grab;
}
.checklist-item:hover {
background-color: rgba(255, 255, 255, 0.1);
transform: translateY(-2px);
}
.checklist-item.dragging {
opacity: 0.6;
transform: rotate(-2deg);
}
.checklist-item input[type="checkbox"] {
width: 20px;
height: 20px;
accent-color: #D8A7A1;
cursor: pointer;
margin-right: 15px;
}
.checklist-item textarea {
background-color: transparent;
color: #F2F2F2;
border: none;
resize: vertical;
width: 100%;
font-family: inherit;
font-size: 1em;
padding: 5px 10px;
border-radius: 5px;
transition: background-color 0.3s, color 0.3s;
}
.checklist-item textarea::placeholder {
color: #F2F2F2;
opacity: 0.7;
}
.checklist-item textarea:focus {
outline: none;
background-color: rgba(255, 255, 255, 0.1);
}
.priority-box {
background-color: #B38184;
padding: 5px 10px;
color: #1A2634;
font-weight: 700;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
margin-right: 10px;
}
.priority-box:hover {
background-color: #D8A7A1;
}
.delete-button {
background: none;
border: none;
color: #F2F2F2;
font-size: 1.2em;
cursor: pointer;
transition: color 0.3s;
}
.delete-button:hover {
color: #D8A7A1;
}
/* Footer */
.main-footer {
text-align: center;
padding: 15px 0;
font-size: 0.9em;
color: rgba(242, 242, 242, 0.7);
}
/* Modals */
.modal {
display: none; /* Hidden by default */
position: fixed;
z-index: 2000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background: rgba(0,0,0,0.6);
justify-content: center;
align-items: center;
}
.modal-content {
background: #263248;
padding: 20px 30px;
border-radius: 10px;
width: 90%;
max-width: 500px;
position: relative;
animation: fadeIn 0.5s;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-50px); }
to { opacity: 1; transform: translateY(0); }
}
.close-button {
position: absolute;
top: 15px;
right: 20px;
color: #F2F2F2;
font-size: 1.5em;
cursor: pointer;
transition: color 0.3s;
}
.close-button:hover {
color: #D8A7A1;
}
.modal h2 {
margin-bottom: 20px;
color: #D8A7A1;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
color: #F2F2F2;
font-weight: 500;
}
.form-group input {
width: 100%;
padding: 10px 15px;
border: none;
border-radius: 5px;
background-color: rgba(255, 255, 255, 0.1);
color: #F2F2F2;
transition: background-color 0.3s;
}
.form-group input:focus {
outline: none;
background-color: rgba(255, 255, 255, 0.2);
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
}
.submit-button,
.cancel-button {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-weight: 700;
transition: background 0.3s;
}
.submit-button {
background: #D8A7A1;
color: #1A2634;
}
.submit-button:hover {
background: #B38184;
}
.cancel-button {
background: #555;
color: #F2F2F2;
}
.cancel-button:hover {
background: #777;
}
/* Scrollbar Styling */
.checklist-container::-webkit-scrollbar {
width: 8px;
}
.checklist-container::-webkit-scrollbar-track {
background: rgba(242, 242, 242, 0.1);
border-radius: 4px;
}
.checklist-container::-webkit-scrollbar-thumb {
background-color: #D8A7A1;
border-radius: 4px;
}
/* Responsive Design */
@media (max-width: 768px) {
.main-header {
flex-direction: column;
align-items: flex-start;
}
.header-right {
width: 100%;
justify-content: space-between;
}
.search-box {
width: 100%;
}
}
Additional JavaScript Enhancements
To complement the enhanced HTML and CSS, it's beneficial to implement JavaScript functionalities for modals and improved interactions. Below is an improved version of your JavaScript code (app.js) to handle the new modal elements and refined interactions.
// app.js
document.addEventListener('DOMContentLoaded', () => {
const STORAGE_KEY = 'criteriaList';
const checklistContainer = document.getElementById('checklistContainerSection1');
const searchBox = document.getElementById('searchBoxSection1');
const sliderFill = document.getElementById('sliderFillSection1');
const numericalLabel = document.getElementById('numericalLabelSection1');
const totalItemsLabel = document.getElementById('totalItemsSection1');
const activeItemsLabel = document.getElementById('activeItemsSection1');
const addButton = document.getElementById('addButton');
const exportButton = document.querySelector('.export-button');
const importButton = document.querySelector('.import-button');
// Modals
const addModal = document.getElementById('addModal');
const closeModal = document.getElementById('closeModal');
const cancelAdd = document.getElementById('cancelAdd');
const addCriterionForm = document.getElementById('addCriterionForm');
const importModal = document.getElementById('importModal');
const closeImportModal = document.getElementById('closeImportModal');
const importDataButton = document.getElementById('importDataButton');
const importFileInput = document.getElementById('importFile');
let criteriaList = [];
// Initialize the application
const init = () => {
loadCriteria();
renderCriteriaList();
updateProgress();
updateItemCounts();
attachEventListeners();
};
// Load criteria from localStorage
const loadCriteria = () => {
const data = localStorage.getItem(STORAGE_KEY);
criteriaList = data ? JSON.parse(data) : [];
};
// Save criteria to localStorage
const saveCriteria = () => {
localStorage.setItem(STORAGE_KEY, JSON.stringify(criteriaList));
};
// Attach event listeners
const attachEventListeners = () => {
addButton.addEventListener('click', openAddModal);
closeModal.addEventListener('click', closeAddModal);
cancelAdd.addEventListener('click', closeAddModal);
addCriterionForm.addEventListener('submit', submitAddCriterion);
exportButton.addEventListener('click', exportData);
importButton.addEventListener('click', openImportModal);
closeImportModal.addEventListener('click', closeImportModalFunc);
importDataButton.addEventListener('click', importData);
searchBox.addEventListener('input', searchCriteria);
};
// Open Add Modal
const openAddModal = () => {
addModal.style.display = 'flex';
};
// Close Add Modal
const closeAddModal = () => {
addModal.style.display = 'none';
addCriterionForm.reset();
};
// Submit Add Criterion
const submitAddCriterion = (e) => {
e.preventDefault();
const name = document.getElementById('criterionName').value.trim();
const priorityInput = document.getElementById('criterionPriority').value.trim();
const priority = parseFloat(priorityInput);
if (!name) {
alert('Criterion name cannot be empty.');
return;
}
if (isNaN(priority) || priority < 0) {
alert('Priority must be a non-negative number.');
return;
}
const criterion = {
id: Date.now(),
name,
priority,
active: false
};
criteriaList.push(criterion);
saveCriteria();
addCriterionToDOM(criterion);
updateProgress();
updateItemCounts();
closeAddModal();
};
// Create and add criterion to DOM
const addCriterionToDOM = (criterion) => {
const itemDiv = createCriterionElement(criterion);
checklistContainer.appendChild(itemDiv);
};
// Create criterion element
const createCriterionElement = (criterion) => {
const itemDiv = document.createElement('div');
itemDiv.className = 'checklist-item';
itemDiv.dataset.id = criterion.id;
itemDiv.draggable = true;
// Checkbox
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.checked = criterion.active;
checkbox.addEventListener('change', () => {
criterion.active = checkbox.checked;
saveCriteria();
updateProgress();
updateItemCounts();
});
// Textarea for criterion name
const textarea = document.createElement('textarea');
textarea.value = criterion.name;
textarea.placeholder = 'Enter criterion name...';
textarea.addEventListener('input', () => {
criterion.name = textarea.value;
saveCriteria();
});
// Priority Box
const priorityBox = document.createElement('div');
priorityBox.className = 'priority-box';
priorityBox.textContent = criterion.priority;
priorityBox.title = 'Click to edit priority';
priorityBox.addEventListener('click', () => {
const newPriorityInput = prompt('Enter new priority:', criterion.priority);
const newPriority = parseFloat(newPriorityInput);
if (isNaN(newPriority) || newPriority < 0) {
alert('Priority must be a non-negative number.');
return;
}
criterion.priority = newPriority;
priorityBox.textContent = newPriority;
saveCriteria();
updateProgress();
});
// Delete Button
const deleteButton = document.createElement('button');
deleteButton.className = 'delete-button';
deleteButton.innerHTML = '🗑️';
deleteButton.title = 'Delete Criterion';
deleteButton.addEventListener('click', () => {
if (confirm('Are you sure you want to delete this criterion?')) {
removeCriterion(criterion.id);
}
});
// Append elements to itemDiv
itemDiv.appendChild(checkbox);
itemDiv.appendChild(textarea);
itemDiv.appendChild(priorityBox);
itemDiv.appendChild(deleteButton);
// Drag and Drop Event Listeners
itemDiv.addEventListener('dragstart', handleDragStart);
itemDiv.addEventListener('dragover', handleDragOver);
itemDiv.addEventListener('drop', handleDrop);
itemDiv.addEventListener('dragend', handleDragEnd);
return itemDiv;
};
// Remove criterion
const removeCriterion = (id) => {
criteriaList = criteriaList.filter(c => c.id !== id);
saveCriteria();
const itemDiv = checklistContainer.querySelector(`[data-id='${id}']`);
if (itemDiv) checklistContainer.removeChild(itemDiv);
updateProgress();
updateItemCounts();
};
// Render criteria list
const renderCriteriaList = () => {
checklistContainer.innerHTML = '';
criteriaList.forEach(criterion => {
addCriterionToDOM(criterion);
});
};
// Update progress bar and numerical label
const updateProgress = () => {
const totalScore = criteriaList.filter(c => c.active).reduce((sum, c) => sum + c.priority, 0);
const cappedScore = Math.min(totalScore, 100);
sliderFill.style.width = `${cappedScore}%`;
numericalLabel.textContent = cappedScore;
// Adjust numerical label position
const labelWidth = numericalLabel.offsetWidth;
numericalLabel.style.left = `calc(${cappedScore}% - ${labelWidth / 2}px)`;
};
// Update total and active item counts
const updateItemCounts = () => {
totalItemsLabel.textContent = criteriaList.length;
activeItemsLabel.textContent = criteriaList.filter(c => c.active).length;
};
// Search criteria
const searchCriteria = () => {
const searchTerm = searchBox.value.toLowerCase();
const items = checklistContainer.querySelectorAll('.checklist-item');
items.forEach(item => {
const text = item.querySelector('textarea').value.toLowerCase();
item.style.display = text.includes(searchTerm) ? 'flex' : 'none';
});
};
// Export data
const exportData = () => {
const dataStr = JSON.stringify(criteriaList, null, 2);
const blob = new Blob([dataStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'criteria.json';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
};
// Import data modal functions
const openImportModal = () => {
importModal.style.display = 'flex';
};
const closeImportModalFunc = () => {
importModal.style.display = 'none';
importFileInput.value = '';
};
const importData = () => {
const file = importFileInput.files[0];
if (!file) {
alert('Please select a file to import.');
return;
}
const reader = new FileReader();
reader.onload = (e) => {
try {
const data = JSON.parse(e.target.result);
if (!Array.isArray(data)) throw new Error('Invalid data format.');
criteriaList = data.map(item => ({
id: item.id || Date.now() + Math.random(),
name: item.name || '',
priority: item.priority >= 0 ? item.priority : 0,
active: !!item.active
}));
saveCriteria();
renderCriteriaList();
updateProgress();
updateItemCounts();
closeImportModalFunc();
} catch (error) {
alert('Error importing data: ' + error.message);
}
};
reader.readAsText(file);
};
// Drag and Drop Handlers
let draggedItem = null;
const handleDragStart = function(e) {
draggedItem = this;
e.dataTransfer.effectAllowed = 'move';
this.classList.add('dragging');
};
const handleDragOver = function(e) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
if (this !== draggedItem) {
this.style.borderTop = '2px solid #D8A7A1';
}
};
const handleDrop = function(e) {
e.stopPropagation();
this.style.borderTop = 'none';
if (draggedItem !== this) {
const draggedId = parseInt(draggedItem.dataset.id);
const targetId = parseInt(this.dataset.id);
const draggedIndex = criteriaList.findIndex(c => c.id === draggedId);
const targetIndex = criteriaList.findIndex(c => c.id === targetId);
if (draggedIndex >= 0 && targetIndex >= 0) {
const [movedItem] = criteriaList.splice(draggedIndex, 1);
criteriaList.splice(targetIndex, 0, movedItem);
saveCriteria();
renderCriteriaList();
}
}
this.style.borderTop = 'none';
};
const handleDragEnd = function(e) {
this.classList.remove('dragging');
const items = checklistContainer.querySelectorAll('.checklist-item');
items.forEach(item => item.style.borderTop = 'none');
draggedItem = null;
};
// Initialize the app
init();
});
Key Enhancements Explained
-
Side Navigation Bar:
- Provides easy access to different sections of your application.
- Incorporates icons for visual appeal and quick recognition.
-
Modals for Adding and Importing Criteria:
- Enhances user experience by providing focused dialogs for adding new criteria and importing data.
- Improves form validation and user feedback.
-
Enhanced Checklist Items:
- Allows inline editing of criteria names.
- Implements draggable checklist items for reordering.
- Includes priority indicators with editable functionality.
- Features visually appealing delete buttons.
-
Progress Slider:
- Displays the cumulative priority of active criteria with smooth transitions.
- Shows real-time updates as criteria are activated/deactivated or reordered.
-
Responsive Design:
- Ensures the application is accessible and user-friendly across various device sizes.
- Adjusts the side navigation and main content layout for smaller screens.
-
Improved Typography and Color Usage:
- Utilizes the Roboto font for better readability.
- Maintains your original color palette while enhancing contrast and visual hierarchy.
-
Interactive Elements:
- Adds hover and active states to buttons and checklist items for better interactivity.
- Incorporates subtle animations to make interactions feel more natural.
-
Accessibility Enhancements:
- Ensures that interactive elements are keyboard navigable.
- Includes placeholder texts and labels for better usability.
Final Thoughts
This redesigned version of your Forex Checklist Analyzer offers a more sophisticated and user-friendly interface while preserving your original aesthetic choices. The enhancements aim to improve usability, visual appeal, and overall user engagement. Feel free to further customize the styles and functionalities to better fit your specific requirements.
Note: Ensure that your JavaScript (app.js) is correctly linked and that the IDs and classes in the HTML match those referenced in your CSS and JS files. Additionally, consider optimizing images and icons for better performance.