Create a visually stunning CSS3 animation within a specified container, mimicking the style shown in the

I'm currently working on creating the animation depicted in the image below:

https://i.stack.imgur.com/W69EQ.jpg

My goal is to develop a video slider where, upon clicking a button, the video will seamlessly shift to the right within its parent container and then return from the left without revealing its original position. I've experimented with various methods but haven't achieved the desired result so far.

Thank you for your assistance!

http://jsfiddle.net/5bpa1x4L/

<div class='contendor_portafolio' class='next'>
 <video  id='video' width="320" height="240" controls>
    <source src="video.mp4" type="video/mp4" />
 </video>
</div>

    #video{
      width: 98%;
      height: 100%;
      transition: all linear 0.5s;
      background:blue;
    }

    .next{
      display: block;
     /* opacity: 1;*/

     -webkit-animation: next 0.5s 1; /* Safari 4+ */
    }

    @-webkit-keyframes next {
      25% { 

        -webkit-transform: translateX(2000px);
       }
       50% { 
        opacity: 0;
        -webkit-transform: translateY(-2000px);
        display: none;
       }
       80% { 
        -webkit-transform: translateX(-2000px)
       }  
      100%{
      } 
    }

    .contendor_portafolio{
        position: fixed;
        width: 84%;
        top: 10%;
        height: 80%;
        z-index: 91;
        left: 8%;
        text-align: center;
        opacity:1;
        background: green;
        transition: all linear 0.5s;
    }

Answer №1

Make sure you're moving the video ID and not the next class.

#video{
   width: 98%;
   height: 100%;
   transition: all linear 0.5s;
   background:blue;
   -webkit-animation: next 5s infinite; /* Safari 4+ */
}

I made some adjustments to the positions for a smoother exit and entry, as well as changing it to loop infinitely.

@-webkit-keyframes next {
   25% { 
      -webkit-transform: translateX(1700px);
   }
   50% { 
      opacity: 0;
      -webkit-transform: translateY(-2000px);
      display: none;
   }
   60% { 
      -webkit-transform: translateX(-1700px);
   }
   100%{
   } 
}

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

Looking to understand how to effectively utilize the ContentProtectionCallback in SHAKA PLAYER?

Could someone assist me in understanding how to pass the ContentProtectionCallback in order to manage the preProcessor of a drm license url for shaka player? [ var manifestUri = '<mpd url>'; function initApp() { // Including nece ...

Steps for positioning a z-indexed division

In my main wrapper, which has a fixed width of 960px, there is a login button located at the top right corner. When this button is pressed, a div layer opens directly below and in front of the main wrapper using z-index: 1. The issue I am facing is that I ...

The absence of PHP GET variable being set

I am encountering an issue with my registration php class. It is designed to display a form and upon clicking the registration button, it triggers a function in a login javascript file. This JavaScript file utilizes ajax to send data to an index.php file. ...

Tips for styling CSS for individual "ID" elements within a primary "Class" container

Struggling with crafting CSS code to style a specific HTML snippet. Take a look at the following HTML: <div class="FourSquares"> <div id="first"></div> <div id="second"></div> <div id="third"></div> ...

elements positioned next to each other

I currently have two nested divs like this: <div id="header"> <div id="logo"></div> <div id="header_r"></div> </div> The corresponding CSS styles are as follows: #header{ border: ...

Trouble with buttons in table cells

There is a problem with a button placed in a table cell that spans two rows and does not fill the second row. How can I ensure that this button fills both rows? I have attempted to adjust the height in the button's style as well as in the table cell i ...

Using jQuery to move a div to a specific location on the page

Is there a way to translate the position of div x and y using Jquery that is compatible with all browsers, such as IE 7, IE8, IE9, and IE10? I have attempted the following: <div id="s1" style="-ms-transform:translate(159,430)"> hello ...

Particles.js fails to persist as I scroll down the HTML page

After creating a website page, I incorporated Particles.js for the background. However, when I scroll down, the particles seem to be confined to the initial corner of the screen and do not continue downward. Here are my current particle settings: #particl ...

The Bootstrap toast fails to appear on the screen

I am currently working on a website project using HTML with bootstrap and javascript. I have been attempting to include a toast feature by implementing the code provided on the bootstrap website: <div class="toast" role="alert" aria-live="assertive" ...

The rotation of an image in Microsoft Edge results in an HTML file display

One of the images on my website is sourced like this: <p> <img src="images/image.jpg" style="width: 50%;" /> </p> Surprisingly, in Chrome and Firefox, the image looks fine (just how I uploaded it to the server). H ...

Utilize AngularJS to Access Global JavaScript Variables

I recently encountered a situation where I needed to incorporate some dynamic functionality into a website I was building. This led me to AngularJS, which I decided to integrate into certain parts of the site rather than the entire thing. Within my JavaSc ...

What are the implications of using subresource integrity with images and other types of media

Subresource integrity is a fantastic method for securely using third-party controlled HTTP-served resources. However, the specification currently only covers the HTMLLinkElement and HTMLScriptElement interfaces: NOTE A future iteration of this spec may i ...

The Bootstrap Carousel cannot be manually manipulated to switch images

I've run into an issue while trying to integrate a Bootstrap carousel gallery on my webpage. Although the photos automatically change after a few seconds, I am unable to manually switch them using the control buttons. Even after including Jquery, Po ...

CSS Priority - determining the ultimate winner

I have an upcoming exam and I'm reviewing the previous exam paper that was given to me. The question is: When multiple style sheet rules are applied to the same element, which type of rule takes precedence? a. Any declaration from the browser b. ...

Is it possible to change cases within a switch statement after one case condition has been satisfied?

I am currently working on implementing a game that involves rolling dice in Javascript/jQuery. The game has different "Phases" that the player must complete one by one without any interference from previous phases. The goal is to smoothly transition betw ...

Create a speech bubble using only CSS, featuring a partially see-through background and a stylish border

I wish to design a speech bubble using only CSS. There are specific requirements I need to meet: It should adjust its size based on content with some padding or a set size. The background color must be semi-transparent. You must be able to define a borde ...

Creating a visually appealing table in HTML or experimenting with a tableless design can greatly enhance your website's layout

Presenting data with headers in HTML has been a challenge for me. Below is the portion of the header I'm having difficulty with. Although I've successfully rotated the text, the issue I'm facing now is text overlap. Here's the code st ...

The element will display above all other elements in its parent container

I am currently developing a React application, and the code structure is set up as follows: <Div> <Div style={{maxHeight:'60vh'}}> //This section includes the code for displaying a list item. Each item has its context menu that can ...

Steps to create a clickable row with color change in Angular 4

How do I make an entire row clickable and change the row color when a checkbox is clicked? This is my HTML file: <section class="others"> <div class="sub-header">Others</div> <p class="text-center" *ngIf="otherTests.length === 0"> ...

Attempting to recreate the dynamic banner featured in the video

Looking to replicate a setup similar to what was demonstrated in the video. I have two div blocks - one with a random image and the other with a video, and I want them to be as flexible and identical as possible to the video layout. How should I go about a ...