Parallax & Zoom effect

Parallax & Zoom effect is one of the popular effect to add in the homepage or single blog page.

In this post, we will see how we can achieve a simple Parallax & Zoom effect.

Parallax & Zoom effect video

For this, we need a wide image which can serve in the top of page. I’m using jQuery for custom scripts and bootstrap for simple layout view in html.

<pre class="wp-block-syntaxhighlighter-code"><head>
  <link href="<https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css>" rel="stylesheet" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
  <a href="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js">https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js</a>
</head>
</pre>

The image used in the code snippet is grabbed from google image search. And we need tons of text or words to present in the page. So that it will looks like page full of content and also we will get vertical scroll bar.

<div class="header" id="parallex">
    <img class="header-image" src="<https://handluggageonly.co.uk/wp-content/uploads/2015/12/London-1.jpg>" alt="">
  </div>
<p class="container">
		Lorem ipsum dolor sit amet, consectetur adipisicing elit. Recusandae similique perferendis quaerat porro, facilis quidem itaque qui excepturi autem ab iure ea quae vero dolorum fugiat alias accusantium, unde laborum facere pariatur soluta quibusdam
</p>

I’m getting that bunch of text from Lorem Ipsum generator from internet. (there is plenty site to generate random text). If you are familiar with emmet, you can generate using that as well.

Next thing, we need to add some CSS magic to make our html looks decent. I’m adding width of image as 100% and if it leads or overflows the screen – we are hiding it.

body: {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
img {
  width: 100%;
}
.header {
  height: 500px;
  overflow: hidden;
}
p {
  font-family: tahoma;
  font-size: 20px;
  padding: 50px;
}

Next big thing, lets capture the scrolling happening in website using jQuery and zoom the header image to apply Parallax effect.

$(window).scroll(function() {
  var scroll = $(window).scrollTop();
  $("#parallex img").css({
    width: 100 + scroll / 5 + "%"
  });
});

Here, we are adjusting the CSS width property of Parallax image based on scroll happens by 5%. So the image will start scaling or zooming whenever the scroll down or scroll up happens.

Here is the full demo with code.

Happy Coding!

Software Quality Factors & its trade-offs

Common Factors of Software Quality

Modifiability

Efforts needed for modification, fault removal or for environmental change.

Stability

Risk of unexpected effect of modifications.

Testability

Efforts needed for validating the modified software.

Usability

Ability of the software to be easily operated by a given user in a given environment.

Performance

Response time for given throughput.

Availability

Combination of Maturity, Fault tolerance and Recoverability for certain point in time.

Main Factors and Sub Factors of Software Quality

Main FactorsSub FactorsQuality Assurance Method
MaintainabilityChangeabilityModifiability
 StabilityStability
 TestabilityTestability
UsabilityOperabilityUsability
EfficiencyTime BehaviorPerformance
ReliabilityCombination of Maturity, Fault tolerance and RecoverabilityAvailability

Trade-offs between Software Quality Factors

  • Inappropriate use of resources can reduce availability. For example, holding a particular resource for a long time without using it may cause resource starvation and an inability to handle additional concurrent user requests.
  • Lack of documentation may delay management and future upgrades in the software.
  • Increased memory consumption may result in reduced performance.
  • Increased database server processing may result in reduced throughput.
  • Complex applications with many processing permutations are not tested consistently, perhaps because automated or granular testing cannot be performed if the application has a monolithic design. Design systems to be modular to support testing.
  • If the code base is large or complex, the refactoring of the codes will be difficult.
  • Lack of tracing ability will leads to difficulty in modifiability.