Skip to content

Commit

Permalink
Fixed styling, blur, and drawing tools
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaxuu committed Jan 19, 2024
1 parent 81413bf commit 5df946f
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build/contentScript.bundle.js

Large diffs are not rendered by default.

33 changes: 26 additions & 7 deletions src/pages/Content/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,46 @@ import ContentState from "./context/ContentState";

const Content = () => {
return (
<div className="screenity-shadow-dom" style={{ all: "unset" }}>
<div className="screenity-shadow-dom">
<ContentState>
<Wrapper />
</ContentState>
<style type="text/css">{`
#screenity-ui, #screenity-ui div {
background-color: unset;
padding: unset;
width: unset;
box-shadow: unset;
display: unset;
margin: unset;
border-radius: unset;
}
.screenity-outline {
position: absolute;
z-index: 99999999999;
border: 2px solid #3080F8;
outline-offset: -2px;
pointer-events: none;
border-radius: 5px!important;
}
.screenity-blur {
filter: blur(10px)!important;
}
.screenity-shadow-dom * {
transition: unset;
}
.screenity-shadow-dom .TooltipContent {
border-radius: 30px;
background-color: #29292F;
padding: 10px 15px;
border-radius: 30px!important;
background-color: #29292F!important;
padding: 10px 15px!important;
font-size: 12px;
margin-bottom: 10px;
margin-bottom: 10px!important;
bottom: 100px;
line-height: 1;
font-family: 'Satoshi-Medium', sans-serif;
z-index: 99999999!important;
color: #FFF;
box-shadow: hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
box-shadow: hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px!important;
user-select: none;
transition: opacity 0.3 ease-in-out;
will-change: transform, opacity;
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Content/Wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ const Wrapper = () => {
]);

return (
<div ref={parentRef} style={{ all: "unset" }}>
<div ref={parentRef}>
<iframe
style={{
all: "unset",
// all: "unset",
display: "none",
visibility: "hidden",
}}
Expand All @@ -94,7 +94,7 @@ const Wrapper = () => {
></iframe>
<iframe
style={{
all: "unset",
// all: "unset",
display: "none",
visibility: "hidden",
}}
Expand All @@ -105,13 +105,13 @@ const Wrapper = () => {
{contentState.zoomEnabled && <ZoomContainer />}
<BlurTool />
{contentState.showExtension || contentState.recording ? (
<div style={{ all: "unset" }}>
<div>
{!contentState.recording &&
!contentState.drawingMode &&
!contentState.blurMode && (
<div
style={{
all: "unset",
// all: "unset",
width: "100%",
height: "100%",
zIndex: 999999999,
Expand Down Expand Up @@ -156,7 +156,7 @@ const Wrapper = () => {
className="root-container"
id="screenity-root-container"
style={{
all: "initial",
// all: "initial",
display: "block",
width: "100%",
height: "100%",
Expand Down Expand Up @@ -191,7 +191,7 @@ const Wrapper = () => {
</root.div>
</div>
) : (
<div style={{ all: "unset" }}></div>
<div></div>
)}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Content/canvas/layout/CanvasWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ const CanvasWrap = (props) => {
style={
!contentState.drawingMode ||
(contentState.hideToolbar && contentState.hideUI)
? { pointerEvents: "none", all: "unset" }
: { pointerEvents: "all", all: "unset" }
? { all: "unset", pointerEvents: "none" }
: { all: "unset", pointerEvents: "all" }
}
>
<div
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Content/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ if (existingRoot) {
const root = document.createElement("div");
root.id = "screenity-ui";
document.body.appendChild(root);
// Set style as unset for it and any divs within
root.style.all = "unset";
render(<Content />, root);
4 changes: 3 additions & 1 deletion src/pages/Content/toolbar/components/Toast.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ const Toast = () => {
className="ToastRoot"
open={open}
onOpenChange={setOpen}
onEscapeKeyDown={() => {
onEscapeKeyDown={(e) => {
e.stopPropagation();
e.preventDefault();
triggerRef.current();
setOpen(false);
}}
Expand Down
1 change: 1 addition & 0 deletions src/pages/Content/toolbar/layout/ToolbarWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ const ToolbarWrap = () => {
setContentState((prevContentState) => ({
...prevContentState,
blurMode: true,
drawingMode: false,
}));
} else {
setContentState((prevContentState) => ({
Expand Down
18 changes: 1 addition & 17 deletions src/pages/Content/utils/BlurTool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const BlurTool = () => {
}, []);

return (
<div style={{ all: "unset" }}>
<div>
{showOutline && (
<div
className="screenity-outline"
Expand All @@ -98,22 +98,6 @@ const BlurTool = () => {
}}
></div>
)}
<style>
{`
.screenity-outline {
position: absolute;
z-index: 99999999999;
border: 2px solid #3080F8;
outline-offset: -2px;
pointer-events: none;
border-radius: 5px;
}
.screenity-blur {
filter: blur(10px)!important;
}
`}
</style>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Content/utils/CursorModes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const CursorModes = () => {
}, []);

return (
<div style={{ all: "unset" }}>
<div>
<div
className="cursor-highlight"
style={{
Expand Down
4 changes: 2 additions & 2 deletions utils/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Do this as the first thing so that any code reading it knows the right env.
//process.env.BABEL_ENV = "development";
//process.env.NODE_ENV = "development";
// process.env.BABEL_ENV = "development";
// process.env.NODE_ENV = "development";
process.env.BABEL_ENV = "production";
process.env.NODE_ENV = "production";
process.env.ASSET_PATH = "/";
Expand Down

0 comments on commit 5df946f

Please sign in to comment.