Blur transitions in fullpage.js create a seamless visual effect when moving between horizontal

Is there a way to adjust the code below to create a blur effect rather than a fade when transitioning between horizontal slides? I want the movement from one slide to another to feel like moving from one "room" to another, so a blur or similar effect would be more suitable than fadeIn. Please refer to this codepen for reference.

var SCROLLING_SPEED = 200;

$(document).ready(function() {
    $('#fullpage').fullpage({
        verticalCentered: false,
        anchors:['section1'],
      
        // fullPage.js settings for fading-in slides instead of scrolling them.
        // Disable or nullify scrolling of slides
   
        
        // Hide the slides container before the next slide loads
        onSlideLeave: function(anchorLink, index, slideIndex, direction) {
            $.fn.fullpage.setScrollingSpeed(0);
            $('.fp-section').find('.fp-slidesContainer').hide();
        },
      
        // Display the slides container by fading it in after the next slide has been loaded.
        afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex) {
            $('.fp-section').find('.fp-slidesContainer').fadeIn(800);
            $.fn.fullpage.setScrollingSpeed(SCROLLING_SPEED);
        }
     });
});

$(document).ready(function(){

      $(".button1").click(function() {
      $.fn.fullpage.moveTo('section1', 1); 
      $('.fp-section').find('.fp-slidesContainer').hide(); //hide current slide
    });
    
    $(".button2").click(function() {
      $.fn.fullpage.moveTo('section1', 2);
      $('.fp-section').find('.fp-slidesContainer').hide(); //hide current slide
    });
    
    $(".button3").click(function() {
      $.fn.fullpage.moveTo('section1', 3);
      $('.fp-section').find('.fp-slidesContainer').hide(); //hide current slide
    });


});
    /* Header text styling
    * --------------------------------------- */
    h1{
        font-size: 5em;
        font-family: arial,helvetica;
        color: #fff;
        margin:0;
        padding:0;
    }

    /* Centered texts in each section
    * --------------------------------------- */
    .section{
        text-align:center;
    }


    /* Background styles for sections and slides
    * --------------------------------------- */
    .section{
        background-size: cover;
    }

    .slide{
        background-size: cover;
    }


    /*Adding background images for the slides
    * --------------------------------------- */
    #slide1{
        background-image: url(https://raw.githubusercontent.com/alvarotrigo/fullPage.js/master/examples/imgs/bg2.jpg);
        padding: 6% 0 0 0;
    }
    #slide2, #slide3, #slide4{
        background-image: url(https://raw.githubusercontent.com/alvarotrigo/fullPage.js/master/examples/imgs/bg5.jpg);
        padding: 6% 0 0 0;
    }


    /* Styling for the bottom menu
    * --------------------------------------- */
    #infoMenu li a {
        color: #fff;
    }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<div id="fullpage">
    <div class="section" id="section1">
        <div class="slide" id="slide1">
        <h1>Index</h1>
        <button class="button1">
          Slide 1
        </button>
        <button class="button2">
          Slide 2
        </button>
        <button class="button3">
          Slide 3
        </button>
       </div>
        <div class="slide" id="slide2"><h1>First Slide</h1></div>
      <div class="slide" id="slide3"><h1>Second Slide</h1></div>
      <div class="slide" id="slide4"><h1>Third Slide</h1></div>
    </div>
</div>

Answer №1

You may want to experiment with SVG filters along the horizontal axis.

Integrate this SVG code before your slide elements:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="filters">
  <defs>
    <filter id="blur">  <-- The ID is set to 'blur'
      <feGaussianBlur in="SourceGraphic" stdDeviation="15,0" />
      <!-- Adjust the X-axis spread using the first parameter -->
    </filter>
  </defs>
</svg>

<div class="slide" id="slide2"><h1>First Slide</h1></div>
<!-- Others are hidden -->

Learn more about the <feGaussianBlur> tag here.

Include the following scripts:

onSlideLeave: function(anchorLink, index, slideIndex, direction) {
    $('.slide').css({
        webkitFilter:'url(#blur)', // 'blur' corresponds to the SVG filter ID
        filter:'url(#blur)'
    });
},


afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex) {
  setTimeout(function(){
    $('.slide').css({
        webkitFilter:'none', // Remove the filter effect
        filter:'none'
      })
  }, 200);
}

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

It is not possible to alter or manipulate dynamic content received from an Ajax/JSON response when creating a dynamic PHP form

I am in need of a dynamic form that functions as follows: Upon clicking the "ADD" button, a new <div> element should appear for selecting a package. Based on the selected package, the row should change its color by adding or removing certain classe ...

Display or conceal image based on date

I'm interested in showing a unique zodiac sign image on my website according to the date of the year. For instance, from March 21st to April 21st, I want to display the "Aries" image; from April 22nd to May 21st, I want to show the "Taurus" image, and ...

Using Passport authentication callback rather than redirecting the user

passport.authenticate('local-register',{ successRedirect: '/login', failureRedirect: '/path_to_greatness', })(req, res, next); In the process of developing a stateless API, I have encountered l ...

What is the best way to "blend" a ShaderMaterial with a LambertMaterial?

First and foremost, I want to express my gratitude for this amazing work and community. My goal is to create a simple low poly-style water material. I am aware that there are various ways to achieve this, and I prefer to handle it in a JavaScript script ...

Sending information from the parent component to the child Bootstrap Modal in Angular 6

As a newcomer to Angular 6, I am facing challenges with passing data between components. I am trying to launch a child component bootstrap modal from the parent modal and need to pass a string parameter to the child modal component. Additionally, I want t ...

Implement the use of HTML buttons to dynamically change the source attribute of an image using

I am in the process of creating a webpage with 25 different images that will be displayed one at a time. Each image represents unique combinations from two sets of items: (ant, blueberry, ladybug, marshmallow, mushroom) and (blimp, truck, moon, ocean, redw ...

The parent is relatively positioned and its child is absolutely positioned and floated to the left

I'm currently working on a design where I have a group of parent containers with the float left property applied. Inside each parent container, there is a child div with position absolute defined within them. Here's an example: <div class="wr ...

Can an array in Javascript contain another array?

I am looking to organize multiple sets of information, each containing specific details. This is how I envision it: var users = [{userID:1, userName:robert}, {userID:2, userName:daniel}] Then, when I want to access this data: users.userID // 1, 2 users. ...

audio tag not functioning correctly to advance to the following track

Here's my HTML5 code: <audio controls autoplay> <source src="song/1.mp3" type="audio/mpeg"> <source src="song/2.mp3" type="audio/mpeg"> <source src="song/3.mp3" type="audio/mpeg"> Your browser does not support the ...

Create an unordered list using the <ul> tag

Creating a ul as input is my goal, similar to this example on jsfiddle: http://jsfiddle.net/hailwood/u8zj5/ (However, I want to avoid using the tagit plugin and implement it myself) I envision allowing users to enter text in the input field and upon hitt ...

How can I bring in a node module or JavaScript file without relying on webpack when working with create-react-app?

I've been facing a challenge while trying to link an external JavaScript file (server.js) with my index.js file in create-react-app. The issue arises because the server.js file utilizes the npm zeromq node module, which seems to have compatibility pro ...

having trouble getting jQuery .submit() function to trigger

I am having trouble getting jQuery's .submit() function to work on my form. I have successfully tested an alert when placed within $(document).ready(), but I cannot seem to get it to trigger on form submission. Here is the script I am using in the BO ...

Firing a jQuery event at precise mouse coordinates

I am facing a unique challenge with my website design - I have implemented a semi-transparent header and footer, and now I need to capture click and hover events in order to trigger the same event on a different DOM element at the exact mouse location. Wh ...

How about designing a button with a dual-layered border for a unique touch

Looking for a specific button: My attempted CSS code that's not working: button { font-family: 'Ubuntu', sans-serif; font-size: 1em; font-weight: bold; color: white; border: 3px double #f26700; background: #f26700; ...

The deletion of property '1' from the [object Array] is not possible

How to Retrieve a List in My Components Using Input : @Input() usersInput: Section[]; export interface Section { displayName: string; userId: number; title: number; } Here is the Value List : 0: displayName: "بدون نام" ...

Using Angular's ng-repeat to display a combination of different elements

I'm currently working on transitioning a form from .Net MVC to Angular. I've successfully used ng-repeat to generate the input fields within the form, which is working well. However, I now need to incorporate select fields along with the text inp ...

What is the best way to import an ES6 module in a Vue file that is being loaded by httpVueLoader?

I'm attempting to incorporate the urlJoin function within a Vue single file component. I am not using a compiler, and instead utilize httpVueLoader to load the Vue file. However, when I try the following: <script> import urlJoin from 'htt ...

Move your cursor over a specific element to change the div located before it, rather than the one after

Is it possible to have <div> B affect <div> A on hover, instead of the other way around? I've only seen code for the reverse using (+) in CSS. #b:hover + #a { background: #ccc } <div id="a">Div A</div> <div id="b"> ...

What is the best way to iterate over an indexed attribute in PHP?

Here is my ajax code snippet: $.ajax({ type: "POST", url: "bee_sesi_edit.php", data: 'serv_ruang='+ serv_ruangx +'&who='+names +'&sesi_d1='+ sesi_d1 +&apos ...

Step-by-step guide on utilizing jQuery to fade out all elements except the one that is selected

There are multiple li elements created in this way: echo '<ul>'; foreach ($test as $value){ echo '<li class="li_class">.$value['name'].</li>'; } echo '</ul>'; This code will generate the fol ...