Last active
August 30, 2021 09:22
-
-
Save drecali/405d1acded0d3ea7dea2abe7783a1a0e to your computer and use it in GitHub Desktop.
This helps visualize differences between the final design and the website/app you're working on. It's faster and requires less code than setting up a visual diff tool. It eliminates the need to constantly switch to the design file to check dimensions and other parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check first comment for instructions and assumptions. | |
import design from "img/design.png"; | |
const Homepage = () => { | |
return ( | |
<> | |
<otherHomepageComponents /> | |
<img | |
src={design} | |
alt="design image that should be removed after Design QA" | |
style={{ | |
zIndex: 99999999999999, // This is probably excessive, but at least it's over 9000! | |
position: "absolute", | |
// match design image dimensions and make sure the browser viewport is the same | |
width: 1370, | |
height: 768, | |
opacity: 0.2, | |
pointerEvents: "none", // Pass mouse events (hover, click, etc) through this image to elements under it | |
border: "1px solid red", // This is only to help you confirm the image is aligned well. Comment/delete this as soon as you can so the border doesn't affect the layout. | |
filter: "invert(100%)", // This makes the differences between the design and the current page more obvious | |
}} | |
></img> | |
</> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@deminoth
Wow, thanks! That's much more obvious! 🎉