openguessr-ui 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/base.css +2 -2
- package/components/ExperimentSign.svelte +59 -0
- package/components/RoomCodeInput.svelte +0 -1
- package/images/experiment_stars.png +0 -0
- package/index.js +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -400,6 +400,14 @@ The title separator component is used to separate content inside popups or conta
|
|
|
400
400
|
- `noMargin`: Removes the default top and bottom margin (`--layout-margin`)
|
|
401
401
|
- `class`: Class passthrough
|
|
402
402
|
|
|
403
|
+
### ExperimentSign
|
|
404
|
+
|
|
405
|
+
The experiment sign is a sign that should be placed on the main page of an experimental OpenGuessr project. For the "Learn more" to work, the ConfirmPopup has to be mounted. The sign takes the following props:
|
|
406
|
+
|
|
407
|
+
- `class`: Class passthrough
|
|
408
|
+
|
|
409
|
+
It's typically placed in the lower left-hand corner with spacing of `--layout-margin` towards the edges.
|
|
410
|
+
|
|
403
411
|
## Attachments
|
|
404
412
|
|
|
405
413
|
Attachments utilize Svelte's `{@attach...}` syntax.
|
|
@@ -446,6 +454,8 @@ new Audio(sounds.basic_button).play();
|
|
|
446
454
|
| item_select | Selecting an item (e.g. a pin, badge, or flag) |
|
|
447
455
|
| item_locked | Trying to select a locked item |
|
|
448
456
|
|
|
457
|
+
No sound should be played for lightweight actions such as clicks on links or tiny "X" buttons that lack standard button styling (like the one used in the persistent tooltip).
|
|
458
|
+
|
|
449
459
|
The components don't play sounds themselves. Instead, they should be played via callbacks:
|
|
450
460
|
|
|
451
461
|
- Collapsible `ontoggle`: `toggle_button`
|
package/base.css
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*,
|
|
9
9
|
*::before,
|
|
10
10
|
*::after {
|
|
11
|
-
|
|
11
|
+
box-sizing: border-box;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/* This UI library is for games, not sites, double-tap to zoom or drag down to refresh are not wanted */
|
|
15
14
|
html {
|
|
15
|
+
/* This UI library is for games, not sites, double-tap to zoom or drag down to refresh are not wanted */
|
|
16
16
|
overscroll-behavior: none;
|
|
17
17
|
touch-action: none;
|
|
18
18
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { showConfirmPopup } from "../confirmPopup.svelte.js";
|
|
3
|
+
import experimentStars from "../images/experiment_stars.png";
|
|
4
|
+
|
|
5
|
+
let { class: classes } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="sign {classes}">
|
|
9
|
+
<img alt="stars" src={experimentStars} class="stars" />
|
|
10
|
+
<h3>Experiment</h3>
|
|
11
|
+
<p class="subtitle">
|
|
12
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
13
|
+
An OpenGuessr experiment.
|
|
14
|
+
<span
|
|
15
|
+
role="button"
|
|
16
|
+
class="learn-more"
|
|
17
|
+
tabindex="0"
|
|
18
|
+
onclick={() =>
|
|
19
|
+
showConfirmPopup(
|
|
20
|
+
"Experiments",
|
|
21
|
+
"Experiments are new ideas brought to life with help from artificial intelligence and built upon the robust foundations of OpenGuessr.",
|
|
22
|
+
)}>Learn more</span
|
|
23
|
+
>.
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
.sign {
|
|
29
|
+
background-color: var(--panel-color);
|
|
30
|
+
box-shadow: var(--panel-shadow);
|
|
31
|
+
border-radius: var(--layout-margin);
|
|
32
|
+
padding: var(--layout-margin);
|
|
33
|
+
contain: layout;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: var(--content-margin);
|
|
37
|
+
backdrop-filter: blur(var(--normal-blur));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.stars {
|
|
41
|
+
position: absolute;
|
|
42
|
+
width: 150px;
|
|
43
|
+
height: 150px;
|
|
44
|
+
top: -73px;
|
|
45
|
+
right: -35px;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
user-select: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.subtitle {
|
|
51
|
+
opacity: 0.5;
|
|
52
|
+
padding-right: var(--box-margin);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.learn-more {
|
|
56
|
+
text-decoration: underline;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as RoomCodeInput } from "./components/RoomCodeInput.svelte";
|
|
|
10
10
|
export { default as Tabs } from "./components/Tabs.svelte";
|
|
11
11
|
export { default as Ticker } from "./components/Ticker.svelte";
|
|
12
12
|
export { default as TitleSeparator } from "./components/TitleSeparator.svelte";
|
|
13
|
+
export { default as ExperimentSign } from "./components/ExperimentSign.svelte";
|
|
13
14
|
export { tooltip } from "./tooltip.svelte.js";
|
|
14
15
|
export { showNotification } from "./notifications.svelte.js";
|
|
15
16
|
export { showConfirmPopup } from "./confirmPopup.svelte.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openguessr-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite example"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"components",
|
|
15
15
|
"fonts",
|
|
16
16
|
"vector-graphics",
|
|
17
|
+
"images",
|
|
17
18
|
"sound-effects",
|
|
18
19
|
"variables.css",
|
|
19
20
|
"base.css",
|