Skip to content

Commit 15ed5f4

Browse files
Merge pull request #211 from Pattern-Projector/beta
Beta
2 parents 36e1dd2 + 34dc9bb commit 15ed5f4

6 files changed

Lines changed: 76 additions & 45 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.1] - 2024-04-15
11+
1012
### Added
1113

1214
- Redirect to calibration page when full screen mode is changed or window is moved/resized when projecting
@@ -49,4 +51,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4951
- Press and hold calibration corners to slow down movement
5052

5153
[unreleased]: https://github.com/Pattern-Projector/pattern-projector/compare/main...beta
54+
[1.0.1]: https://github.com/Pattern-Projector/pattern-projector/releases/tag/v1.0.1
5255
[1.0.0]: https://github.com/Pattern-Projector/pattern-projector/releases/tag/v1.0.0

app/[locale]/calibrate/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export default function Page() {
395395
}
396396
layers={layers}
397397
setLayers={setLayers}
398-
className={`${menuStates.stitch ? "top-32" : "top-20"} overflow-scroll`}
398+
className={`${menuStates.stitch ? "top-32" : "top-20"}`}
399399
/>
400400
{layers.size && !menuStates.layers ? (
401401
<Tooltip

app/[locale]/globals.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
@layer components {
6+
.scrollbar::-webkit-scrollbar {
7+
width: 10px;
8+
height: 0px;
9+
}
10+
11+
.scrollbar::-webkit-scrollbar-track {
12+
border-radius: 100vh;
13+
background: rgb(220, 220, 220, 0.2);
14+
}
15+
16+
.scrollbar::-webkit-scrollbar-thumb {
17+
background: #9ca3af;
18+
border-radius: 100vh;
19+
border: 1px solid #9ca3af;
20+
}
21+
22+
.scrollbar::-webkit-scrollbar-thumb:hover {
23+
background: #6b7280;
24+
}
25+
}

app/_components/layer-menu.tsx

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Layer } from "@/_lib/interfaces/layer";
22
import { Dispatch, SetStateAction, useMemo } from "react";
33
import { IconButton } from "@/_components/buttons/icon-button";
4-
import CloseIcon from "@/_icons/close-icon";
4+
import { useTranslations } from "next-intl";
5+
import KeyboardArrowLeftIcon from "@/_icons/keyboard-arrow-left";
56

67
export default function LayerMenu({
78
className,
@@ -16,6 +17,8 @@ export default function LayerMenu({
1617
visible: boolean;
1718
setVisible: (visible: boolean) => void;
1819
}) {
20+
const t = useTranslations("LayerMenu");
21+
1922
function handleOnChange(key: string, layer: Layer) {
2023
layer.visible = !layer.visible;
2124
setLayers(new Map(layers.set(key, layer)));
@@ -36,53 +39,50 @@ export default function LayerMenu({
3639
}
3740

3841
return (
39-
<menu
40-
style={{ height: "calc(100vh - 19rem)" }}
41-
className={`${className} ${visible ? "left-0" : "-left-60"} w-48 text-sm font-medium text-gray-900 dark:text-white bg-white dark:bg-black border border-gray-200 dark:border-gray-700 border-top-0 absolute z-50 transition-all duration-700`}
42+
<div
43+
className={`${className} ${visible ? "left-0" : "-left-60"} w-48 ${layers.size > 0 && layers.size * 40 < 200 ? "h-fit" : "h-[calc(100vh-12rem)]"} text-sm font-medium text-gray-900 dark:text-white bg-white dark:bg-black border border-gray-200 dark:border-gray-700 border-top-0 absolute z-50 transition-all duration-700`}
4244
>
43-
<li
45+
<h1
4446
key="global"
45-
className="w-full border-b border-gray-200 dark:border-gray-700 rounded-t-lg"
47+
className="w-fullrounded-t-lg border-b border-gray-200 dark:border-gray-700"
4648
>
47-
<div className="flex items-center justify-between ps-3">
48-
<div className="flex items-center">
49-
<input
50-
id="global"
51-
type="checkbox"
52-
className="w-4 h-4 accent-purple-600 bg-gray-100 border-gray-300 dark:border-gray-700 rounded focus:ring-blue-500 dark:focus:ring-blue-800"
53-
checked={globalCheck}
54-
style={{ width: 14 }}
55-
onChange={(e) => handleGlobalChange(e.target.checked)}
56-
/>
57-
<h6 className="ml-2">Layers</h6>
58-
</div>
49+
<div className="flex items-center space-between">
5950
<IconButton onClick={() => setVisible(false)}>
60-
<CloseIcon ariaLabel="close" />
51+
<KeyboardArrowLeftIcon ariaLabel="close" />
6152
</IconButton>
53+
<h6 className="ml-2">{t("title")}</h6>
54+
<button
55+
className="text-purple-600 ml-auto px-4 hover:text-purple-800 "
56+
onClick={() => handleGlobalChange(!globalCheck)}
57+
>
58+
{globalCheck ? t("hideAll") : t("showAll")}
59+
</button>
6260
</div>
63-
</li>
64-
{[...layers.entries()].map((e) => (
65-
<li
66-
key={e[0]}
67-
className="w-full border-b border-gray-200 dark:border-gray-700 rounded-t-lg"
68-
>
69-
<div className="flex items-center ps-3">
70-
<input
71-
id={e[0]}
72-
type="checkbox"
73-
className="w-4 h-4 accent-purple-600 bg-gray-100 border-gray-300 dark:border-gray-700 rounded focus:ring-blue-500 dark:focus:ring-blue-800"
74-
checked={e[1].visible}
75-
onChange={() => handleOnChange(e[0], e[1])}
76-
></input>
77-
<label
78-
htmlFor={e[0]}
79-
className="w-full py-3 ms-2 text-sm font-medium text-gray-90"
80-
>
81-
{e[1].name}
82-
</label>
83-
</div>
84-
</li>
85-
))}
86-
</menu>
61+
</h1>
62+
63+
<menu
64+
className={`w-full ${layers.size > 0 && layers.size * 40 > 200 ? "h-[calc(100vh-15rem)] overflow-y-auto scrollbar" : ""}`}
65+
>
66+
{[...layers.entries()].map((e) => (
67+
<li key={e[0]} className="w-full rounded-t-lg">
68+
<div className="flex items-center ps-3">
69+
<input
70+
id={e[0]}
71+
type="checkbox"
72+
className="w-4 h-4 accent-purple-600 rounded focus:ring-blue-500 dark:focus:ring-blue-800"
73+
checked={e[1].visible}
74+
onChange={() => handleOnChange(e[0], e[1])}
75+
></input>
76+
<label
77+
htmlFor={e[0]}
78+
className="w-full py-3 ms-2 text-sm font-medium text-gray-90"
79+
>
80+
{e[1].name}
81+
</label>
82+
</div>
83+
</li>
84+
))}
85+
</menu>
86+
</div>
8787
);
8888
}

messages/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@
189189
"horizontal": "Horizontal",
190190
"vertical": "Vertical"
191191
},
192+
"LayerMenu": {
193+
"title": "Layers",
194+
"showAll": "Show all",
195+
"hideAll": "Hide all"
196+
},
192197
"MovementPad": {
193198
"up": "Up",
194199
"down": "Down",

messages/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@
182182
"measureOn": "Empezar medición",
183183
"measureOff": "Terminar medición",
184184
"showMovement": "Mostrar herramienta mover",
185-
"hideMovement": "Ocultar herramienta mover"
185+
"hideMovement": "Ocultar herramienta mover",
186+
"fullScreenChange": "Por favor, asegúrese de que la calibración es correcta. Debe calibrar en modo de pantalla completa si desea proyectar en pantalla completa."
186187
},
187188
"StitchMenu": {
188189
"columnCount": "Columnas",

0 commit comments

Comments
 (0)