Once the tracking process has finished, I would like to blur the image

Currently, I am in the process of developing a website feature where users can track their packages. The tracking screen displays the real-time status of the package, with completed processes appearing blurred while the current status glows. Below is the HTML and CSS code snippet I've implemented for this feature:

li {
  list-style-type: none;
  float: left;
  margin: 10px;
}

.imgage {
  margin-top: 150px;
}

body h2 {
  font-family: sans-serif, 'Montserrat';
}
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
<ul>
  <li>
    <div class="imgage">
      <img src="images/fil_1.jpg" width="202px" height="100px">
  </li>
</ul>
<ul>
  <li>
    <div class="imgage">
      <img src="images/export1.jpg" width="202px" height="100px">
      <h2>IMPORT</h2>
  </li>
</ul>
<ul>
  <li>
    <div class="imgage">
      <img src="images/UKimport.jpg" width="202px" height="100px">
      <h2>CARRIER</h2>
  </li>
</ul>
<ul>
  <li>
    <div class="imgage">
      <img src="images/DHL.jpg" width="202px" height="100px">
      <h2>DHL</h2>
  </li>
</ul>
<ul>
  <li>
    <div class="imgage">
      <img src="images/HMRC_logo.jpg" width="202px" height="100px">
      <h2>HMRC</h2>
  </li>
</ul>
<ul>
  <li>
    <div class="imgage">
      <img src="images/Importt.jpg" width="202px" height="100px">
  </li>
</ul>

Answer №1

It was my endeavor to comprehend your desired outcome.

To my understanding, you intended to implement a blur effect on the page during loading and then reveal the fully loaded content.

I have incorporated the necessary code to achieve this functionality, along with additional code to simulate the loading of photos that were missing due to incomplete URIs.

If this does not align with your expectations, I kindly ask you to modify your inquiry so that I may adjust my response accordingly.

// Emulating loading the photos
$(window).on('load', function() {
    $("#cover").fadeOut(200);
});

function callLoad(){
    $(window).load();
}
setTimeout(callLoad, 1000);

$(function() {
  
  $('.image').each(function(){
    let randomNumber = (Math.floor(Math.random() * 100) + 1);
    $(this).attr('src', 'https://picsum.photos/id/' + randomNumber + '/202/100');      
  });    

  var images = $('.image').sort(function (a, b) {
    return +$(a).data('sort') - +$(b).data('sort');
  });
  
  var index = 0;
  var getNextImage = function(index){
    var remainder = index % images.length;
    return $(images[(remainder === 0) ? images.length - 1 : remainder - 1]);
  };
    
  $("#btnNext").click(function(){    
    getNextImage(index - 1).addClass("blur-content");
    getNextImage(index).toggleClass("blur-content");   
    index++;
  });
  
});
li {
  list-style-type: none;
  float: left;
  margin: 10px;
}

.imgage {
  margin-top: 50px;
}

body h2 {
  font-family: sans-serif, 'Montserrat';
}

#cover {
  top:0; 
  left: 0;  
  position: fixed; 
  height: 100%; 
  width: 100%; 
  background: #CCC; 
  z-index:9999;
}

.blur-content {
    -webkit-filter: url(#svg-blur);
    filter: url(#svg-blur);
}
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<button id="btnNext"> Next </button>
<div id="cover" class="blur-content"></div>
<div>
  <ul>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/fil_1.jpg" width="202px" height="100px" data-sort="7">
        <h2>SOMETHING</h2>
    </li>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/export1.jpg" width="202px" height="100px" data-sort="2">
        <h2>IMPORT</h2>
    </li>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/UKimport.jpg" width="202px" height="100px" data-sort="3">
        <h2>CARRIER</h2>
    </li>
  </ul>

  <ul>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/DHL.jpg" width="202px" height="100px" data-sort="4">
        <h2>DHL</h2>
    </li>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/HMRC_logo.jpg" width="202px" height="100px" data-sort="5">
        <h2>HMRC</h2>
    </li>
    <li>
      <div class="imgage">
        <img class="image blur-content" src="images/Importt.jpg" width="202px" height="100px" data-sort="6">
        <h2>HMRC2</h2>
    </li>
  </ul>
</div>

<!-- SVG Blur Filter -->
<!-- 'stdDeviation' is the blur amount applied -->
<svg id="svg-filter-blur">
    <filter id="svg-blur">
        <feGaussianBlur in="SourceGraphic" stdDeviation="4"></feGaussianBlur>
    </filter>
</svg>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Switching images dynamically using Flask and JavaScript

I'm currently working on Flask and encountering a perplexing issue. I'm attempting to update an image using JavaScript, but I am getting these errors from Flask: ... 12:05:34] "GET / HTTP/1.1" 200 - ... 12:05:38] "GET /img/pictur ...

PHP version 7.2.1 is throwing an error indicating an undefined index for the file_upload

Encountering an error message: Notice: Undefined index: file_upload in C:\MAMP\htdocs\basic_files\upload.php on line 3 Each time I attempt to upload a file using the form. While many attribute this issue to problems with enctype or ...

Could it be that the reason why document.getElementById is undefined in a Vue2 component is due to a misunderstanding

I am currently building a simple chat feature that fetches messages from Firebase and displays them in a div. The objective is to automatically scroll to the bottom of the div WHEN relevantMessages changes, as long as the current scroll position is close ...

Creating HTML tables dynamically using PHP

I am currently working on creating a dynamic HTML table by querying the database using PHP. I am facing some challenges in understanding how to combine two different loops to ensure the correct generation of the desired table. <table><tr> & ...

ReactJs allows for fluid scroll animations that persist as long as the mouse is clicked or a button

Just some background information: I'm aiming to replicate the scrolling effect seen in Etsy's product image thumbnails carousel. Essentially, when you hover over the top part of the div, it automatically scrolls down until the last image is reve ...

Pick and modify a particular component in ReactJS

Currently, I am working on a project in ReactJS where I am attempting to toggle the colors of two buttons. While I have successfully set the active state property of the selected button, I am facing challenges with changing the style of another button (cal ...

Secure your online file with a password

I need to access a specific file on my computer through a program, not a web browser. However, I want to ensure that only authorized users can view the file by requiring a password with the request. How can I set up the file to prompt for a password befor ...

Trigger an Ajax call to submit data and execute a PHP SQL query upon clicking

I am attempting to create a feature where pressing a button triggers a PHP function without reloading the page. Here is the button I have: <div class= "obutton feature2" data-id="<?php echo $bookID;?>"> <button>Reserve Book</but ...

Are arrays being used in function parameters?

Can the following be achieved (or something similar): function a(foo, bar[x]){ //perform operations here } Appreciate it in advance. ...

Button to return to top and footer placement

I recently added a "back-to-top" button to my website. Here is the HTML: <div class="scroll-top scroll-is-not-visible"> <a href="#0"><i class="fa fa-angle-up" aria-hidden="true"></i></a> </div> <footer class="site ...

Implementing dual pagination components in Vue JS for dynamic updates on click

Having two pagination components on a single page is convenient for users to navigate without scrolling too much. One component is placed at the top and the other at the bottom. The issue arises when I switch to page 2 using the top component, as the bott ...

To modify the text within the pagination select box in ANTD, follow these steps:

Is it possible to modify the text within the ant design pagination select component? I have not been able to find a solution in the documentation. I specifically want to replace the word "page" with another term: https://i.sstatic.net/w55hf.png ...

What is the best way to code an HTML block with jQuery?

Could someone guide me on creating the following using jQuery: <div class="card"> <img src="images/cat6.jpg" alt="Avatar" style="width:100%"> <div class="container"> <h4><b>John Watson</b></h4> ...

What is the reason behind modern browsers continuing to add spaces between inline blocks when there is whitespace present?

Consider the following HTML markup: <div class="inlineblock">one</div> <div class="inlineblock">two</div> <div class="inlineblock">three</div> Accompanied by this CSS style: .inlineblock{ display: inline-block; } ...

What is the most efficient method for transferring ASP.NET form data to an Excel spreadsheet?

I am confident that exporting data from my web form should be achievable, but I'm not quite sure of the steps involved. My web form contains numerous select dropdowns and input boxes. Could anyone guide me on how to export the data from these asp co ...

What is the best way to align my grid cells to the center?

I'm facing an issue where the grid cells do not move closer together as I resize the window, instead they just stay in their place. I want to achieve a similar layout to . To share my project code, I have uploaded it on codepen: https://codepen.io/Ale ...

Incorporating Protractor for automated testing with PhantomJS

Looking to test my AngularJS Application end-to-end, Protractor seems like the way to go. Setting it up was smooth sailing and everything runs smoothly in Chrome. However, I need to use a headless browser and have been exploring how to integrate Protractor ...

How can we customize HTML images without allowing third-party JavaScript to enlarge them?

I am using Blogger to host my website and I have a basic knowledge of HTML and CSS. I want to incorporate a collaborative add-your-link feature using SimplyLinked. However... They provided me with the following HTML: <script type="text/javascript" src ...

How does Facebook utilize ajax to refresh content on a user's side only upon request?

I'm curious about the inner workings of Facebook's newsfeed algorithm. I'm interested in creating a similar feature for my own project. Based on my observations, it seems that Facebook does not use a $jQuery refresh to update the newsfeed. ...

Issue with Ext JS: The property 'substring' is being attempted to be read from an undefined value

Hey there! I'm trying to incorporate a grid panel into my view using Extjs 4.1.1, but I keep encountering an error in the browser console that says "Cannot read property 'substring' of undefined". Below is the JavaScript code snippet I am us ...