Search function, declaudification
This commit is contained in:
parent
6e7d52f827
commit
612d67ccda
17 changed files with 668 additions and 3061 deletions
|
|
@ -605,10 +605,10 @@
|
|||
}
|
||||
|
||||
// Render map or indoor placeholder
|
||||
if (hasGpsTrack && activity.simplifiedTrack) {
|
||||
if (hasGpsTrack && activity.trackPoints.length > 0) {
|
||||
document.getElementById('mapSection').style.display = 'block';
|
||||
document.getElementById('indoorPlaceholder').style.display = 'none';
|
||||
renderMap(activity.simplifiedTrack, activity);
|
||||
renderMap(activity.trackPoints, activity);
|
||||
} else {
|
||||
// Show indoor activity placeholder
|
||||
document.getElementById('mapSection').style.display = 'none';
|
||||
|
|
@ -749,11 +749,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
function renderMap(simplifiedTrack, activity) {
|
||||
function flattenTrackPoints(trackPoints) {
|
||||
return trackPoints.map(coordinates => ([coordinates.longitude, coordinates.latitude]));
|
||||
}
|
||||
|
||||
function renderMap(trackPoints, activity) {
|
||||
// Parse GeoJSON from simplifiedTrack
|
||||
const geoJson = {
|
||||
type: 'LineString',
|
||||
coordinates: simplifiedTrack.coordinates
|
||||
coordinates: flattenTrackPoints(trackPoints)
|
||||
};
|
||||
|
||||
// Create map (needs to be done after container is visible)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,34 @@
|
|||
Activities from athletes you follow
|
||||
</p>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<div class="card mb-4" id="searchCard">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<i class="bi bi-search"></i>
|
||||
</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="searchInput"
|
||||
placeholder="Search activities by title or description..."
|
||||
autocomplete="off"
|
||||
>
|
||||
</div>
|
||||
<small class="form-text text-muted mt-1 d-block" id="searchHint"></small>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline-secondary w-100" id="clearSearchBtn">
|
||||
<i class="bi bi-x-circle"></i> Clear
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading Indicator -->
|
||||
<div id="loadingIndicator" class="text-center py-5">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
|
|
|
|||
|
|
@ -34,6 +34,34 @@
|
|||
Discover public fitness activities from the FitPub community
|
||||
</p>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<div class="card mb-4" id="searchCard">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<i class="bi bi-search"></i>
|
||||
</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="searchInput"
|
||||
placeholder="Search activities by title or description..."
|
||||
autocomplete="off"
|
||||
>
|
||||
</div>
|
||||
<small class="form-text text-muted mt-1 d-block" id="searchHint"></small>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline-secondary w-100" id="clearSearchBtn">
|
||||
<i class="bi bi-x-circle"></i> Clear
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading Indicator -->
|
||||
<div id="loadingIndicator" class="text-center py-5">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
|
|
|
|||
|
|
@ -34,6 +34,34 @@
|
|||
Your fitness activities
|
||||
</p>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<div class="card mb-4" id="searchCard">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<i class="bi bi-search"></i>
|
||||
</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="searchInput"
|
||||
placeholder="Search activities by title or description..."
|
||||
autocomplete="off"
|
||||
>
|
||||
</div>
|
||||
<small class="form-text text-muted mt-1 d-block" id="searchHint"></small>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline-secondary w-100" id="clearSearchBtn">
|
||||
<i class="bi bi-x-circle"></i> Clear
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading Indicator -->
|
||||
<div id="loadingIndicator" class="text-center py-5">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue