ISSUE-018 - Added pixel size indicator for overlay images.
Added new global rule for touch-action so that I don't need to keep setting it up for elements that utilize use-gesture.
This commit is contained in:
1 parent
32d92de2d5
commit
bf121aa032
4 files changed
+37
-6
No files matched your search
@@ -5,7 +5,12 @@ import useMeasure from "react-use-measure";
|
||||
|
||||
import { overlayToolSelector } from "../../../features/overlayTool/overlayToolSelector";
|
||||
import { setPosition } from "../../../features/overlayTool/overlayToolSlice";
|
||||
import { OverlayImage, OverlayImageContainer, OverlayImageSubContainer } from "./styles";
|
||||
import {
|
||||
OverlayImage,
|
||||
OverlayImageContainer,
|
||||
OverlayImageSize,
|
||||
OverlayImageSubContainer,
|
||||
} from "./styles";
|
||||
|
||||
const overlayImages = require.context("../../../public/images/overlays", true);
|
||||
|
||||
@@ -60,7 +65,6 @@ export function OverlayDisplay({
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return transition((style, visible) =>
|
||||
visible ? (
|
||||
<animated.div
|
||||
@@ -69,12 +73,17 @@ export function OverlayDisplay({
|
||||
left: xPos,
|
||||
top: yPos,
|
||||
position: "absolute",
|
||||
touchAction: "none",
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<animated.div style={{ ...style, position: "absolute" }}>
|
||||
<animated.div style={{
|
||||
...style,
|
||||
position: "absolute",
|
||||
}}>
|
||||
<OverlayImageContainer opacity={currentOverlayItem?.opacity ?? 1}>
|
||||
<OverlayImageSize>
|
||||
{overlayItemWidth} x {overlayItemHeight}
|
||||
</OverlayImageSize>
|
||||
<OverlayImageSubContainer>
|
||||
<OverlayImage
|
||||
ref={overlayItemImageRef}
|
||||
|
||||
@@ -14,6 +14,7 @@ export const OverlayImage = styled.img.attrs<OverlayImageProps>(({
|
||||
src,
|
||||
}))<OverlayImageProps>`
|
||||
width: ${({ scale = 100 }) => `${scale}%`};
|
||||
|
||||
&:active {
|
||||
outline: 2px solid red;
|
||||
outline-offset: -2px;
|
||||
@@ -32,6 +33,13 @@ export const OverlayImageContainer = styled.div.attrs<OverlayImageContainerProps
|
||||
},
|
||||
}))<OverlayImageContainerProps>`
|
||||
display: flex;
|
||||
|
||||
&:hover {
|
||||
> span {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
`;
|
||||
OverlayImageContainer.displayName = "OverlayImageContainer";
|
||||
|
||||
@@ -39,3 +47,18 @@ export const OverlayImageSubContainer = styled.div`
|
||||
flex-shrink: 0;
|
||||
`;
|
||||
OverlayImageSubContainer.displayName = "OverlayImageSubContainer";
|
||||
|
||||
export const OverlayImageSize = styled.span`
|
||||
position: absolute;
|
||||
display: none;
|
||||
|
||||
left: 0;
|
||||
bottom: -1.5em;
|
||||
width: 15ch;
|
||||
|
||||
color: red;
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: 1em;
|
||||
text-shadow: -1px -1px 1px rgba(255,255,255,.1), 1px 1px 1px rgba(0,0,0,.5);
|
||||
`;
|
||||
OverlayImageSize.displayName = "OverlayImageSize";
|
||||
@@ -9,7 +9,6 @@ import "./clear.css";
|
||||
import App from "./App";
|
||||
import Broadcast from "./components/Broadcast/BroadcastRoute";
|
||||
import Workspaces from "./components/Workspaces/WorkspacesRoute";
|
||||
import { Workspace } from "./components/Workspaces/Workspace";
|
||||
|
||||
import { GlobalStyle, theme } from "./shared/theme";
|
||||
import { GlobalFonts } from "./fonts";
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ export const GlobalStyle = createGlobalStyle<MainThemeProps>`
|
||||
|
||||
*,
|
||||
*::after,
|
||||
*::before { box-sizing: border-box; }
|
||||
*::before { box-sizing: border-box; touch-action: none; }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 { margin: 0; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user