Updated the styles to use Pico-css
This commit is contained in:
parent
d32233a20a
commit
9acde36f50
18 changed files with 691 additions and 2126 deletions
|
|
@ -178,224 +178,91 @@ onUnmounted(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="edit-game">
|
||||
<div v-if="loading" class="loading">Loading...</div>
|
||||
<main class="container">
|
||||
<article v-if="loading">Loading...</article>
|
||||
|
||||
<template v-else-if="game">
|
||||
<header class="page-header">
|
||||
<div>
|
||||
<RouterLink :to="`/games/${game.id}`" class="back-link">← Back to Game</RouterLink>
|
||||
<h1>Edit: {{ game.name }}</h1>
|
||||
</div>
|
||||
</header>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ul>
|
||||
<li><RouterLink :to="`/games/${game.id}`">← Back to Game</RouterLink></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="edit-content">
|
||||
<section class="legs-section">
|
||||
<h1>Edit: {{ game.name }}</h1>
|
||||
|
||||
<div class="grid">
|
||||
<article>
|
||||
<h2>Legs ({{ legs.length }})</h2>
|
||||
<p class="hint">Total route distance: {{ getTotalDistance().toFixed(2) }} km</p>
|
||||
<p><small>Total route distance: {{ getTotalDistance().toFixed(2) }} km</small></p>
|
||||
|
||||
<div v-if="legs.length" class="legs-list">
|
||||
<div v-for="(leg, index) in legs" :key="leg.id" class="leg-item">
|
||||
<div class="leg-number">{{ index + 1 }}</div>
|
||||
<div class="leg-info">
|
||||
<p>{{ leg.description }}</p>
|
||||
<div class="leg-meta">
|
||||
<span>Type: {{ leg.conditionType }}</span>
|
||||
<span v-if="leg.timeLimit">{{ leg.timeLimit }} min</span>
|
||||
<span v-if="leg.locationLat && leg.locationLng">
|
||||
{{ leg.locationLat.toFixed(4) }}, {{ leg.locationLng.toFixed(4) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<button @click="deleteLeg(leg.id)" class="btn btn-danger">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty">No legs added yet</div>
|
||||
</section>
|
||||
<article v-if="legs.length" v-for="(leg, index) in legs" :key="leg.id">
|
||||
<h3>Leg {{ index + 1 }}</h3>
|
||||
<p>{{ leg.description }}</p>
|
||||
<footer>
|
||||
<small>
|
||||
Type: {{ leg.conditionType }}
|
||||
<span v-if="leg.timeLimit"> · {{ leg.timeLimit }} min</span>
|
||||
<span v-if="leg.locationLat && leg.locationLng">
|
||||
· {{ leg.locationLat.toFixed(4) }}, {{ leg.locationLng.toFixed(4) }}
|
||||
</span>
|
||||
</small>
|
||||
</footer>
|
||||
<button @click="deleteLeg(leg.id)" class="secondary">Delete</button>
|
||||
</article>
|
||||
<p v-else>No legs added yet</p>
|
||||
</article>
|
||||
|
||||
<section class="add-leg-section">
|
||||
<article>
|
||||
<h2>Add New Leg</h2>
|
||||
|
||||
<div ref="mapContainer" class="map-container"></div>
|
||||
<p class="hint">Click on map to set location</p>
|
||||
<p><small>Click on map to set location</small></p>
|
||||
|
||||
<form @submit.prevent="addLeg" class="leg-form">
|
||||
<div class="form-group">
|
||||
<label>Description / Clue</label>
|
||||
<textarea v-model="newLeg.description" rows="2" required></textarea>
|
||||
</div>
|
||||
<form @submit.prevent="addLeg">
|
||||
<label>Description / Clue</label>
|
||||
<textarea v-model="newLeg.description" rows="2" required></textarea>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Condition Type</label>
|
||||
<div class="grid">
|
||||
<label>
|
||||
Condition Type
|
||||
<select v-model="newLeg.conditionType">
|
||||
<option value="photo">Photo Proof</option>
|
||||
<option value="purchase">Purchase</option>
|
||||
<option value="text">Text Answer</option>
|
||||
</select>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Time Limit (minutes)</label>
|
||||
<label>
|
||||
Time Limit (minutes)
|
||||
<input v-model.number="newLeg.timeLimit" type="number" min="1" />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Latitude</label>
|
||||
<div class="grid">
|
||||
<label>
|
||||
Latitude
|
||||
<input v-model.number="newLeg.locationLat" type="number" step="any" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Longitude</label>
|
||||
</label>
|
||||
<label>
|
||||
Longitude
|
||||
<input v-model.number="newLeg.locationLng" type="number" step="any" readonly />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" :disabled="saving">
|
||||
<button type="submit" :disabled="saving">
|
||||
{{ saving ? 'Adding...' : 'Add Leg' }}
|
||||
</button>
|
||||
</form>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.edit-game {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
color: #667eea;
|
||||
text-decoration: none;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.edit-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.legs-section, .add-leg-section {
|
||||
background: white;
|
||||
padding: 1.5rem;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.legs-section h2, .add-leg-section h2 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.legs-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.leg-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
background: #f9f9f9;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.leg-number {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.leg-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.leg-info p {
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
|
||||
.leg-meta {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.map-container {
|
||||
height: 250px;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--pico-border-radius);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.leg-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea,
|
||||
.form-group select {
|
||||
padding: 0.5rem;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.btn-primary { background: #667eea; color: white; }
|
||||
.btn-danger { background: #dc3545; color: white; }
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue