From c820a07a4d92ebc341e01d96ddc07d43ab953d21 Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Mon, 1 Jun 2026 23:22:59 -0500 Subject: [PATCH] map color updates --- blueprints/api.py | 2 +- models/notepad.py | 1 + static/assets/css/map.css | 5 +++++ static/assets/js/actions.js | 6 ++---- static/assets/js/map.js | 10 ++++++---- static/index.html | 4 ++++ 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/blueprints/api.py b/blueprints/api.py index 9a30aab..30c4080 100644 --- a/blueprints/api.py +++ b/blueprints/api.py @@ -103,7 +103,7 @@ def create_notepad(): return jsonify({'error': 'Unauthorized'}), 401 data = request.get_json() - new_pad = Notepad(name=data['name'], is_public=data.get('is_public', False), user_id=user_id) + new_pad = Notepad(name=data['name'], is_public=data.get('is_public', False), user_id=user_id, color=data.get('color', '#3388ff')) db.session.add(new_pad) db.session.commit() return jsonify(new_pad.to_dict()), 201 diff --git a/models/notepad.py b/models/notepad.py index 0e44f3d..08dea8f 100644 --- a/models/notepad.py +++ b/models/notepad.py @@ -18,5 +18,6 @@ class Notepad(db.Model): 'name': self.name, 'is_public': self.is_public, 'owner_id': self.user_id, + 'color': self.color, 'note_count': self.notes.filter_by(is_hidden=False).count() } \ No newline at end of file diff --git a/static/assets/css/map.css b/static/assets/css/map.css index b696f4d..952e4aa 100644 --- a/static/assets/css/map.css +++ b/static/assets/css/map.css @@ -96,4 +96,9 @@ cursor: pointer; margin-top: 5px; margin-right: 5px; +} + +.custom-div-icon { + background: transparent; + border: none; } \ No newline at end of file diff --git a/static/assets/js/actions.js b/static/assets/js/actions.js index 7f46515..fac380a 100644 --- a/static/assets/js/actions.js +++ b/static/assets/js/actions.js @@ -116,9 +116,7 @@ window.openEditNoteModal = function(id, currentTitle, currentContent) { }; // Helper to open note modal (called from index.js) -function openCreateNoteModal(notepadId) { +window.openCreateNoteModal = function(notepadId) { activeNotepadId = notepadId; document.getElementById('modal-create-note').classList.remove('hidden'); -} -en'); -} +}; diff --git a/static/assets/js/map.js b/static/assets/js/map.js index 47f523e..f804591 100644 --- a/static/assets/js/map.js +++ b/static/assets/js/map.js @@ -132,12 +132,14 @@ window.SpotNotes.renderMapMarkers = function() { }); marker = L.marker([note.lat, note.lng], { icon: icon }); } else { + const teardropSvg = ``; + const svgIcon = L.divIcon({ className: 'custom-div-icon', - html: `
`, - iconSize: [20, 20], - iconAnchor: [10, 10], - popupAnchor: [0, -10] + html: teardropSvg, + iconSize: [24, 36], + iconAnchor: [12, 36], + popupAnchor: [0, -36] }); marker = L.marker([note.lat, note.lng], { icon: svgIcon }); marker.bindPopup(`${window.SpotNotes.escapeHtml(note.title)}
${window.SpotNotes.escapeHtml(note.content)}
${dateStr}
${directionsBtn} ${shareBtn} ${actionBtns}`); diff --git a/static/index.html b/static/index.html index 9be3d5e..1ea7dfd 100644 --- a/static/index.html +++ b/static/index.html @@ -82,6 +82,10 @@ Make Public +
+ + +