Started: 07/03/2023 - 17/03/2023 and 5 minutes to read
⭐ This is a project that I made to practice and apply bootstrap in building responsive website with multiple pages. Cloning from a pattern which was on wix.com combining with some ideas of myself. The project uses Bootstrap as CSS framework, with a little basic javascript. Check the website at this link.
All webpages are responsive, stretch properly on multiple resolutions
The animation of elements on webpage will be played when you first scroll down
- for my study throughtout this project
- Easy modal js:
- Add attribute for open/close btn:
onclick="show/closeMenu"
- Add the following js
var el1 = document.GetElementById(""); function showMenu(){ el1.style.display="block"; }
- Add attribute for open/close btn:
- height:100% doesn't work in cols -> the parents tag must have a declared height
- To create a class for col-2-4 in the @media:
.col-lg-2-4 { flex: 0 0 auto; width: 20%; }
- Responsive written alongside boostrap:
/* Mobile and Table t */ @media (max-width: 991px){} /* Mobile */ @media (max-width: 767px){} /* Tablet */ @media (min-width: 768px) and (max-width: 991px){} /* PC and low resolution PC */ @media (min-width: 992px){} /* Low resolution PC */ @media (min-width: 992px) and (max-width: 1199px){} /* Tablet and PC */ @media (min-width: 768px){}
- A good background traslucent film:
background-image: line-gradient(rgba(4,9,30,.7), rgba(4,9,30,.7)), url("link")
- !! Reveal on Scrolling !!
- Add class
.reveal
to els:animation-play-state: paused;
and create class.reveal.active{}
withanimation-play-state: running;
- Add the following javascript
// Review on Scroll window.addEventListener('scroll', reveal); // Every time scrolling, the funcion will be triggered function reveal(){ // Call varibles on of the scrolling animation els var reveals = document.querySelectorAll('.reveal'); // Call each of them for (var i=0; i<reveals.length; i++){ var windowHeight = window.innerHeight; var revealtop = reveals[i].getBoundingClientRect().top; var revealpoint = 10; /*The less the value is, the faster it will play when scrolling down*/ // The top of the reveal lies below the (fullpageheight - revealpoint) if (revealtop < windowHeight - revealpoint){ reveals[i].classList.add('active'); } else{ // In case you want to make the animation replay after scroll it again // reveals[i].classList.remove('active'); } } }
- Add class