Skip to content

Commit cde6345

Browse files
authored
docs: add URL parameters documentation & remove core view gen (#29)
1 parent be91810 commit cde6345

File tree

2 files changed

+78
-44
lines changed

2 files changed

+78
-44
lines changed

app/pages/results.vue

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ const { results } = useQuizSocket('results')
1212
const route = useRoute()
1313
const isCoreView = computed(() => route.query.core !== undefined)
1414
15-
// State for core view parameters
16-
const padding = ref(route.query.padding ? Number(route.query.padding) : 0)
17-
const scale = ref(route.query.scale ? Number(route.query.scale) : 1)
18-
const hideResults = ref(route.query.hideResults !== undefined)
19-
20-
// Add body class for core view
2115
2216
// Dynamic styles for core view
2317
const coreViewStyles = computed(() => {
@@ -30,17 +24,6 @@ const coreViewStyles = computed(() => {
3024
}
3125
})
3226
33-
// Function to navigate to core view with parameters
34-
async function goToCoreView() {
35-
const query = {
36-
core: '',
37-
padding: padding.value,
38-
scale: scale.value,
39-
hideResults: hideResults.value ? '' : undefined
40-
}
41-
await navigateTo({ path: '/results', query })
42-
}
43-
4427
// Fetch initial results
4528
const { data: fetchedResults, refresh: refreshResults } = await useFetch<Results>('/api/results/current')
4629
@@ -175,33 +158,6 @@ async function pickRandomUser(option: string) {
175158
</UiSection>
176159
</div>
177160

178-
<!-- Navigation -->
179-
<div v-if="!isCoreView" class="flex flex-col items-center gap-5 mt-8">
180-
<div class="flex justify-center gap-5">
181-
</div>
182-
183-
<!-- Core View Controls -->
184-
<div class="p-4 w-full max-w-md flex flex-col items-center gap-4">
185-
<h3 class="text-lg font-bold">Core View Generator</h3>
186-
<div class="grid grid-cols-2 gap-4 w-full">
187-
<div class="flex flex-col gap-1">
188-
<label for="padding" class="text-sm font-bold">Padding (px)</label>
189-
<UiInput id="padding" v-model="padding" type="number" placeholder="e.g., 20" />
190-
</div>
191-
<div class="flex flex-col gap-1">
192-
<label for="scale" class="text-sm font-bold">Scale</label>
193-
<UiInput id="scale" v-model="scale" type="number" step="0.1" placeholder="e.g., 1.0" />
194-
</div>
195-
</div>
196-
<div class="flex items-center gap-2">
197-
<input id="hideResults" v-model="hideResults" type="checkbox" class="w-4 h-4">
198-
<label for="hideResults" class="text-sm font-bold">Hide Results</label>
199-
</div>
200-
<UiButton @click="goToCoreView">
201-
Generate Core View
202-
</UiButton>
203-
</div>
204-
</div>
205161
</div>
206162
</template>
207163

docs/url-parameters.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# URL Parameters for Frontend pages
2+
3+
This document describes the GET parameters available for customizing page views.
4+
5+
## `/results` Page
6+
7+
### `core`
8+
9+
- **Type**: Flag (presence check)
10+
- **Default**: Not set
11+
- **Effect**: Enables core view mode, which removes page padding, removes the page title, and applies bare section styling for embedded display.
12+
13+
### `padding`
14+
15+
- **Type**: Number (pixels)
16+
- **Default**: `0`
17+
- **Effect**: Applies padding around the content when in core view mode. Only active when `core` parameter is present.
18+
19+
### `scale`
20+
21+
- **Type**: Number (decimal)
22+
- **Default**: `1`
23+
- **Effect**: Applies CSS transform scale to the content. Only active when `core` parameter is present.
24+
25+
### `hideResults`
26+
27+
- **Type**: Flag (presence check)
28+
- **Default**: Not set
29+
- **Effect**: Hides vote counts, percentages, and question notes. Displays question marks instead of results. Useful for presentations where results should be revealed later.
30+
31+
### Examples
32+
33+
```text
34+
/results
35+
Standard results view with full UI.
36+
37+
/results?core
38+
Core view with minimal UI, no padding, normal scale.
39+
40+
/results?core&padding=20&scale=0.9
41+
Core view with 20px padding and 90% scale.
42+
43+
/results?core&hideResults
44+
Core view with results hidden (shows "?" instead of numbers).
45+
46+
/results?core&padding=30&scale=1.2&hideResults
47+
Core view with 30px padding, 120% scale, and hidden results.
48+
```
49+
50+
## `/emojis` Page
51+
52+
### `scale`
53+
54+
- **Type**: Number (decimal)
55+
- **Default**: `1`
56+
- **Effect**: Scales emoji size and adjusts spawn padding to prevent emojis from appearing outside viewport.
57+
58+
### `transparency`
59+
60+
- **Type**: Number (decimal, clamped to max 1)
61+
- **Default**: `1`
62+
- **Effect**: Sets emoji opacity. Values are clamped to maximum 1.0 (fully opaque).
63+
64+
### Examples
65+
66+
```text
67+
/emojis
68+
Standard emoji display with normal size and full opacity.
69+
70+
/emojis?scale=2
71+
Emojis rendered at double size.
72+
73+
/emojis?transparency=0.5
74+
Emojis rendered at 50% opacity.
75+
76+
/emojis?scale=1.5&transparency=0.7
77+
Emojis at 150% size with 70% opacity.
78+
```

0 commit comments

Comments
 (0)