Comments (1)
Figured it out
Landing.jsx
function Landing() {
const [transparent, setTransparent] = useState(true);
useEffect(() => {
window.addEventListener("scroll", navbarColorChange);
return function cleanup() {
window.removeEventListener("scroll", navbarColorChange);
};
});
const navbarColorChange = () => {
const windowsScrollTop = window.pageYOffset;
if (windowsScrollTop > 100) {
setTransparent(false);
} else {
setTransparent(true);
}
};
return (
<>
<MKBox sx={{ position: "sticky", top: 0, zIndex: 10 }}>
<Navbar
routes={routes}
action={{
type: "external",
route: "/signup",
label: "sign up",
color: "warning",
}}
sticky
transparent={transparent}
/>
</MKBox>
Navbar.jsx
function Navbar({ brand, routes, transparent, light, action, sticky, relative, center }) {
return (
<>
<MKBox
py={{ xs: 1, sm: 2 }}
px={{ xs: 4, sm: transparent ? 3 : 3, lg: transparent ? 6 : 6 }}
my={relative ? 0 : 2}
mx={relative ? 0 : 3}
width={relative ? "100%" : "calc(100% - 48px)"}
borderRadius="xl"
shadow={transparent ? "none" : "md"}
color={light ? "white" : "dark"}
position={relative ? "relative" : "absolute"}
left={0}
zIndex={3}
sx={({ palette: { transparent: transparentColor, white }, functions: { rgba } }) => ({
backgroundColor: transparent ? transparentColor.main : rgba(white.main, 0.8),
backdropFilter: transparent ? "none" : `saturate(200%) blur(6px)`,
})}
>
</MKBox>
</>
);
}
from ct-material-kit-pro-react.
Related Issues (20)
- [Bug] Can't add files to React project. HOT 1
- [Bug] Second Ticket. Cannot Install @material-ui/core in existing project. HOT 1
- Got error on VERCEL HOT 1
- Does this kit support react 18? HOT 1
- Compile error on yarn install: from quick start guide HOT 1
- [Bug] Compile error on first starting the project files downloaded from my Creative Tim account HOT 1
- [Bug] Doesn't compile with npm 1.18 and react-script 5 and swiper 7 HOT 2
- [Bug] npm install is not running to my project which is not working. HOT 2
- [Bug] Problem with ESLint HOT 1
- Component Header crashed HOT 1
- [Bug] Pages become unclickable after file change/recompile until they are manually refreshed in the browser. HOT 3
- Will be good to include documentation for the usage of different folders. e.g. pages vs layouts HOT 1
- [Bug] Rotating Card HOT 1
- [Bug] NPM install not working HOT 1
- Product I purchased doesn't work by default. HOT 2
- [Bug] npm install error HOT 2
- [Bug] material-kit-2-pro-react-v2.0.0 Fails on NPM Install HOT 11
- How to disable CustomDropDown HOT 1
- [Bug] How to disable CustomDropDown HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ct-material-kit-pro-react.