Get rid of the animation that appears at the beginning and end

I have a unique CSS animation of a Pacman character, but I want to customize it so that the mouth remains open at all times instead of having the opening and closing animation. How can I achieve this?

.loader{position:absolute;top:50%;left:50%;height:60px;width:160px;margin:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}
.circles{position:absolute;left:-5px;top:0;height:60px;width:180px}
.circles span{position:absolute;top:25px;height:12px;width:12px;border-radius:12px;background-color:grey}
.circles span.one{right:80px}
.circles span.two{right:40px}
.circles span.three{right:0px}
.circles{-webkit-animation:animcircles 0.5s infinite linear;animation:animcircles 0.5s infinite linear}
@-webkit-keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-40px,0px);transform:translate(-40px,0px)}}
@keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-40px,0px);transform:translate(-40px,0px)}}
.pacman{position:absolute;left:0;top:0;height:60px;width:60px}
.pacman .eye{position:absolute;top:10px;left:30px;height:7px;width:7px;border-radius:7px;background-color:#1C163A}
.pacman span{position:absolute;top:0;left:0;height:60px;width:60px}
.pacman span::before{content:"";position:absolute;left:0;height:30px;width:60px;background-color:yellow} 
.pacman .top::before{top:0;border-radius:60px 60px 0px 0px}
.pacman .bottom::before{bottom:0;border-radius:0px 0px 60px 60px}
.pacman .left::before{bottom:0;height:60px;width:30px;border-radius:60px 0px 0px 60px}
.pacman .top{-webkit-animation:animtop 0.5s infinite;animation:animtop 0.5s infinite}
@-webkit-keyframes animtop{0%,100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}}
@keyframes animtop{0%,100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}
.pacman .bottom{-webkit-animation:animbottom 0.5s infinite;animation:animbottom 0.5s infinite}
@-webkit-keyframes animbottom{0%,100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(45deg);transform:rotate(45deg)}}
@keyframes animbottom{0%,100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(45deg);transform:rotate(45deg)}}
<div class="loader">
  <div class="circles">
    <span class="one"></span>
    <span class="two"></span>
    <span class="three"></span>
  </div>
  <div class="pacman">
    <span class="top"></span>
    <span class="bottom"></span>
    <span class="left"></span>
    <div class="eye"></div>
  </div>
</div> 

Answer №1

modify the two css classes responsible for the animation

.pacman .top and .pacman .bottom need to be changed to:

.pacman .bottom{
  -webkit-transform:rotate(45deg);transform:rotate(45deg)
}
.pacman .top{
  -webkit-transform:rotate(-45deg);transform:rotate(-45deg)
}

resulting in the following look:

.loader{position:absolute;top:45%;left:55%;height:75px;width:120px;margin:0;-webkit-transform:translate(-45%,-55%);transform:translate(-45%,-55%)}
.circles{position:absolute;left:-10px;top:5px;height:75px;width:170px}
.circles span{position:absolute;top:20px;height:14px;width:14px;border-radius:14px;background-color:blue}
.circles span.one{right:75px}
.circles span.two{right:35px}
.circles span.three{right:5px}
.circles{-webkit-animation:animcircles 0.7s infinite linear;animation:animcircles 0.7s infinite linear}
@-webkit-keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-35px,0px);transform:translate(-35px,0px)}}
@keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-35px,0px);transform:translate(-35px,0px)}}
.pacman{position:absolute;left:0;top:0;height:50px;width:50px}
.pacman .eye{position:absolute;top:20px;left:25px;height:5px;width:5px;border-radius:5px;background-color:#FF5733}
.pacman span{position:absolute;top:5px;left:5px;height:50px;width:50px}
.pacman span::before{content:"";position:absolute;left:0;height:25px;width:50px;background-color:green} 
.pacman .top::before{top:0;border-radius:50px 50px 0px 0px}
.pacman .bottom::before{bottom:0;border-radius:0px 0px 50px 50px}
.pacman .left::before{bottom:0;height:50px;width:25px;border-radius:50px 0px 0px 50px}

.pacman .bottom{-webkit-transform:rotate(45deg);transform:rotate(45deg)}
.pacman .top{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}
<div class="loader">
  <div class="circles">
    <span class="one"></span>
    <span class="two"></span>
    <span class="three"></span>
  </div>
  <div class="pacman">
    <span class="top"></span>
    <span class="bottom"></span>
    <span class="left"></span>
    <div class="eye"></div>
  </div>
</div> 

Answer №2

.loader{position:absolute; top:50%; left:50%; height:60px; width:160px; margin:0; -webkit-transform:translate(-50%,-50%); transform:translate(-50%,-50%)}
.circles{position:absolute; left:-5px; top:0; height:60px; width:180px}
.circles span{position:absolute; top:25px; height:12px; width:12px; border-radius:12px; background-color:grey}
.circles span.one{right:80px}
.circles span.two{right:40px}
.circles span.three{right:0px}
.circles{-webkit-animation:animcircles 0.5s infinite linear; animation:animcircles 0.5s infinite linear}
@-webkit-keyframes animcircles{0%{-webkit-transform:translate(0px,0px); transform:translate(0px,0px)} 100%{-webkit-transform:translate(-40px,0px); transform:translate(-40px,0px)}
@keyframes animcircles{0%{-webkit-transform:translate(0px,0px); transform:translate(0px,0px)} 100%{-webkit-transform:translate(-40px,0px); transform:translate(-40px,0px)}
.pacman{position:absolute; left:0; top:0; height:60px; width:60px}
.pacman .eye{position:absolute; top:10px; left:30px; height:7px; width:7px; border-radius:7px; background-color:#1C163A}
.pacman span{position:absolute; top:0; left:0; height:60px; width:60px}
.pacman span::before{content:""; position:absolute; left:0; height:30px; width:60px; background-color:yellow}
.pacman .top::before{top:0; border-radius:60px 60px 0px 0px}
.pacman .bottom::before{bottom:0; border-radius:0px 0px 60px 60px}
.pacman .left::before{bottom:0; height:60px; width:30px; border-radius:60px 0px 0px 60px}
.pacman .top{transform: rotate( -45deg );}
.pacman .bottom{transform: rotate( 45deg );}
<div class="loader">
<div class="circles">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
<div class="pacman">
<span class="top"></span>
<span class="bottom"></span>
<span class="left"></span>
<div class="eye"></div>
</div>
</div>

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

Transferring HTML information to Flask

I'm struggling with passing a value from a text box in a web application to a Flask application. Despite my efforts, the request object in Flask does not seem to contain the data I need. Can anyone provide assistance with this issue? Below are the rel ...

Generating a PDF file from HTML div content using a button click

I am looking to export a specific div section as a PDF file. The div contains a mix of text, images, and charts. <div id="newdiv"> <img src="http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/ ...

Is there a way to deliver information to a specific element on a client's HTML page?

My current project involves using Node.js to serve a webpage that collects user inputs and stores them in a mongodb server. The web page also displays these user inputs. I am trying to determine the best way to pass the user inputs from node.js to the < ...

Tips for integrating bootstrap code within PHP tags

<?php $con=mysqli_connect("localhost","root","","testdatabase"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_qu ...

How to retrieve a string from a regular expression in Javascript without [Object object] output

Within my code, there exists a parent form component and a child component used for auto-completing text input. The Parent component passes an array of objects named autoCompTxt, consisting of name and id fields, to the Child component. //Parent: const [ob ...

Discover the ultimate guide to harmonize IE 9 with the ingenious Bootstrap Multiselect plugin developed by davidstutz

I've come across an amazing plug-in developed by David Stutz that allows for a Bootstrap and jQuery multi-select options list. Here are some resources: Check out the source code on Github Find documentation and examples here This plug-in works fla ...

What is the best way to ensure a CSS element maintains its position margins even after adjusting them with JavaScript?

Currently, I am in the process of developing a minesweeper game using a combination of HTML, CSS, and JavaScript. The code snippet I am utilizing to generate the grid is as follows: <div id="game-space"></div> <script type="t ...

`Finding the appropriate place to define a variable within a React Component`

When attempting to declare the variable images within the component, I encountered an error. See the screenshot for more information: here. ...

Error encountered while attempting to load JSON data into HTML audio element

I need to incorporate data from a JSON file into an HTML audio tag. While I've been able to extract the desired information from the JSON, I'm facing difficulty loading it into HTML. Here's what I've tried so far: <?php $json = file ...

I seem to be having issues with the downloaded files for Bootstrap 4. Is there something I am

After creating a site with Bootstrap 4 and downloading all the necessary files, I encountered an issue where Bootstrap was not functioning properly. Strangely, when using the CDN version of Bootstrap, everything worked perfectly. Could I be overlooking som ...

What is the best way to eliminate excess space on the right side in Bootstrap 4 while in mobile view?

I'm struggling to understand why this layout is not responsive on mobile devices, triggering a bottom scroll bar at around 616px. I'm looking for a solution to hide the scroll bar at least until 414px for iPhones and other smartphones. I've ...

Tips for aligning images and text in the center of a row using Bootstrap

I am struggling to center the image along with the text in my code. I attempted to use a container, but it did not have the desired effect. Below is the image: https://i.sstatic.net/fnaj4.png <section id="features"> <!-- <div ...

Adjust the scrollbar color when hovering over a particular div

Is there a way to change the color of a div's scrollbar when hovering over the div without assigning an id to it? I've attempted the following methods so far: div:hover { ::-webkit-scrollbar {color: black} } and div:hover + ::-webkit-scroll ...

Tips for preventing the bootstrap modal from disappearing during auto postback in asp.net

I am currently using vb.net in my asp.net project along with Bootstrap 4. Within a modal, I have two dropdown lists. The goal is for the second list to be sorted based on the user's selection from the first list. However, I encountered an issue where ...

What specific quirk in Firefox is responsible for this behavior, and is there a way to replicate it in standards mode?

In Firefox, this particular document displays differently in standards mode compared to quirks mode. When in quirks mode, the div fills the entire screen, but in standards mode it does not. I went through the MDN quirks list and couldn't pinpoint a sp ...

Is there a way to create an HTML popup that automatically opens a link and an image file side by side

Can a popup code be created to automatically open both a link and an image side by side? ...

Concealing a Bootstrap table on an ASP.NET MVC View using jQuery

My website is powered by ASP.NET MVC and it showcases records in a Bootstrap 3 table. When there are no records, a div is displayed. Following the advice of another user, I adjusted the view to render the table along with the "no records" div simultaneousl ...

Avoid triggering a keydown event if certain div elements have been clicked

When the user presses the space bar, my script is set up to perform certain actions, such as stopping an audio player: $('html').keydown(function(e){ if(e.keyCode == 32){ // Stop the audio player } } However, an issue arises when a ...

Strange Behavior When Floating Right in Chrome

There's a strange issue that I'm facing, only in Chrome. It seems to be adding some extra space on top of an element with float: right, but only when the browser window is resized (you can see how the name then shifts under the header): This pro ...

Unable to reset disabled styling for CSS select box

My Windows 8 app consists of two pages: Page1.html and Page2.html. Page1 references ui-light.css and page1.css, while Page2 references ui-light.css and page2.css. In the ui-light.css file, there is a rule defined for the disabled state of select boxes. I ...