why is my @keyframes not playing when i paste it to my main site

oh boy here we are again

so i made a separate codepen (not my actual project) with an anim in it but when i paste it into my actual website it doesnt work and just flops around on the bottom of my page like a fish out of water and i have no idea why this does not work please help me here’s the code for the codepen with the anim

<html>
<head>
    <meta charset="utf-8">
    <title>Sushi</title>
</head>
<body>
    <style type="text/css">
        body{
            overflow: hidden;
        }
        #sushi{
            position: absolute;
            left: 0;
            visibility: visible;
        }
        #sushi.active{
            animation: mymove 3s infinite linear;
        }

        @keyframes mymove{
            0%{
                left: -15;
                visibility: visible;
            }
            25%{
                left: 25%;
                visibility: visible;
            }
            50%{
                left: 50%;
                visibility: visible;
            }
            75%{
                left: 75%;
                visibility: visible;
            }
  
            94%{
                visibility: hidden;
                left: 100%
          }
            95%{
                left: -10%;
                visibility: hidden;
            }
          100%{
            left: 0%;
            visibility: visible;
          }
        }


    </style>
    <div id="sushi"><img src="https://media.giphy.com/media/4YzoaFKXaGHbpkOnV3/giphy.gif"></div>
    <script type="text/javascript">
        sushi = document.getElementById('sushi');

        sushi.addEventListener('click', function(){
            sushi.classList.add('active');
        });
    </script>
 <h1><blink> CLICK ME!!! </h1>
   </body>
 
</html>

Answer

I think the problem is that there are 2 elements with the Id of sushi and the Javascript can’t find what element it has to add the class of active.

Please add this code to your codepen. https://codepen.io/twakyt/pen/xxdebrP

Here is the completed code

HTML:

<html>
<head>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Grandstander&display=swap" rel="stylesheet">
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Limelight&display=swap" rel="stylesheet">
</head>
<body>
<style type="text/css">
</style>
</script>
<div style="background-image:url(https://i.ibb.co/m5zCnFT/pixil-frame-0-4.png);id:background;width:1450px;height:4395px;border:1px; z-index: z('bottom');position: absolute; z-index: -1; filter: brightness(60%);">
</div>
<h1 id="title">Salmon Info</h1>
<p id="main">A female Chinook Salmon can lay up to 4,000 eggs, while the average is about 3,000 eggs.</p>
<p> Salmon don't eat any food during their journey upstream to mate.</p>
<p> The longest ever trip a salmon took upstream to mate was about 3,845 km (or about 2,389 miles) upstream. </p>
<img src="  https://media.giphy.com/media/ob9abRedlUxy6scitj/giphy.gif" style="float: left; width: 195px; height: 150px; margin-left: 1.5%; margin-bottom: 0.5em;" alt="salmon jumping on bear" id="salmonjumpgif">
<img src="  https://i2.wp.com/www.coopers-seafood.com/wp-content/uploads/2017/01/0sumr143807319621.jpg?w=750&ssl=1" style="float: right; width: 195px; drop-shadow: 3px; height: 150px; margin-right: 1.5%; margin-bottom: 0.5em;" alt="salmon picture" id="img-div">
<a href="https://ibb.co/hBKR929">
</a>
<p> The oldest salmon fossil found is about 50 million years old.</p>
<p>During their trip upstream, they can jump up to 6 feet into the air, almost up to 2 metres.</p>
<figcaption id="img-caption">
PLEASE JUST GO UNDER THE IMAGE IT ISNT THAT HARD
</figcaption>
<p> Most salmons will die as a result of exhaustion after their trip to mate. A small percent of survived salmons will mate few more time in their lifetime. </p>
<p> Salmon are rich in essential vitamins and can decrease the risk of coronary disease and certain cancers. </p>
<p> Atlantic salmon sold in the U.S. are all farm raised.</p>
<img src="https://earthandstarryheaven.files.wordpress.com/2016/05/tumblr_myfcvcow9e1rvu01lo1_1280.jpg?w=300&h=282" alt="salmon photo" style="float: right; width: 195px; drop-shadow: 3px; height: 100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="img-div">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT9ZiqZFPrarJt9BWaE_SlpiQD494As_Nbjx3Zp8zBLCwf2TMUfI8XMulE4ioaeILSfsbyA8fSe6TeG1A&usqp=CAU" style="float: left; width: 195px; height: 100px; margin-left: 1.5%; margin-bottom: 0.5em;" alt="img" id="salmonjumpgif">
<div id="img-caption"> </div>
<p>To get wild salmon, buy Pacific salmon.</p>
<p>Salmon are popular in mythology.</p>
<p>Salmon is a considered a health food.</p>
<p>Salmon are anadromous, which means they are born in fresh water, they migrate to salt water, and then they return to freshwater to spawn.</p>
<p>Grizzly bears love to feast on these fish when they are migrating upstream.</p>
<p>Salmon is a keystone species in Northwest America.</p>
<hr>
<p> There are six types of salmon that are harvested in and around the waters of North America. There is one salmon from the Atlantic Ocean called the Atlantic Salmon, and five from the Pacific Ocean called Chinook, chum, coho, pink, and sockeye.</p>
<p>
Salmon in the United States are found mainly on the Northwestern coastline as well as all around Alaska. There is a small amount on the Atlantic coast and there are some in the Great Lakes as well. Aquaculture for salmon is becoming more and more popular because of the demand for this fish.</p>
<p>Young salmon feed on plankton. As they get older, they feed on other things such as insects, small invertebrates, small fish, and other sea organisms.</p>
<p>
<ul>
<li> <b>Atlantic Salmon -</b> Known also as the black salmon, this fish does not require salt water to live. This species is in decline in the United States and is listed on the Endangered Species List. The average size of the atlantic salmon is 8-12 pounds. A landlocked Atlantic salmon is a freshwater form of the sea-run Atlantic salmon. They are genetically considered a subspecies of the sea-run Atlantic salmon. They reside in lakes, never making the marine migration. They generally do not grow as large as sea-run fish, averaging between 12 and 20 inches long.</li>
</p>
</ul>
<img src="https://media.fisheries.noaa.gov/styles/original/s3/dam-migration/640x427-chinook-salmon.png?null&itok=s7wokwso" style="float: right; width: 195px; drop-shadow: 3px; height: 100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="image">
<ul>
<p>
<li> <b>Chinook Salmon -</b> This animal is the state fish of Alaska and is also known as the king salmon. It is the largest of the salmon species and can get up to 125 pounds. Chinook salmon can live a maximum of 7 years. Chinooks can be found in Alaska (mainly) and down the West coast. The average size of a Chinook is 10-15 pounds. Chinook salmon are anadromous—they hatch in freshwater streams and rivers then migrate out to the saltwater environment of the ocean to feed and grow. Chinook salmon are the largest of the Pacific salmon, hence the name “king salmon.”</li>
</p>
</ul>
<img src="http://www.kingsailfishmounts.com/images/categories_images/image1_271.jpg" style="float: right; width: 195px; drop-shadow: 3px; height: 100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="image">
<ul>
<p>
<li> <b>Chum Salmon -</b> This fish is found in Alaska down to the Northwest tip of the United States. It occupies the broadest range of any other salmon. The average size of a chum is 10-15 pounds. Chum salmon is one of the largest species of Pacific salmon, second only to Chinook salmon in size. When in the ocean, chum salmon are metallic greenish-blue along the back with black speckles, similar to both sockeye and coho salmon. As they enter fresh water, their appearance changes dramatically.</li>
</p>
</ul>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Oncorhynchus_keta.jpeg/220px-Oncorhynchus_keta.jpeg" style="float: right; width: 195px; drop-shadow: 3px; height: 100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="image">
<ul>
<li> <b>Coho Salmon -</b> The Coho salmon, also known as "silvers," is one of the most sought after species and can be found in Alaska and down the West coast. The average size of a coho is 6-12 pounds. Coho salmon are anadromous fish: they are born in freshwater, migrate to the sea in adulthood and return to freshwater to breed. Coho fry (recently hatched fish) feed primarily on insects, zooplankton and small fish. When they reach the ocean, they add small crustaceans to their diet.</li>
<p></p>
</ul>
<img src="https://media.fisheries.noaa.gov/styles/original/s3/dam-migration/640x427-pink-salmon.png?null&itok=WBIjRwIO" style="float: right; width: 195px; drop-shadow: 3px; height: 100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="image">
<ul>
<li> <b>Pink Salmon -</b> Also known as "humpies," the pink salmon is the most abundant, yet smallest in size of the species. The average size of a pink salmon is 3-5 pounds. Pink salmon are the smallest of the Pacific salmon found in North America, weighing between 3.5 and 5 pounds, with an average length of 20 to 25 inches. Pink salmon can be distinguished from other Pacific salmon by the large dark oval spots on their back and entire tail fin as well as their general coloring and form.</li>
<p></p>
</ul>
<img src="https://wiki.fishingplanet.com/images/f/f8/Sockeye_Salmon.png" style="float: right; width: 195px; drop-shadow: 3px; height:  100px; margin-right: 1.5%; margin-bottom: 0.5em;" id="salmonphoto3">
<ul>
<li> <b>Sockeye Salmon -</b> Also known as "reds," this is the most colorful (and the most common) of the species and can survive being in lakes and other freshwater. They sometimes even spawn in rivers and lakes. The average size of a sockeye is 5-8 pounds. The striking orange color of sockeye salmon flesh comes from eating plankton and krill while in the ocean.
Landlocked sockeye salmon rarely grow to more than 14 inches in length and are called “kokanee”. Sockeye salmon are the most economically important species of salmon in Alaska.</li>
</ul>
<hr>
</hr>
<ul>
<p>
<li>Feeding habits depend on a variety of different factors such as weather, season, and time of day.
</p>
</li>
</ul>
<ul>
<p>
<li>Find the correct fishing reel that you feel most comfortable using.
</p>
</li>
</ul>
<ul>
<p>
<li>Use brightly colored lures and add bait and scent to them.
</p>
</li>
</ul>
<ul>
<p>
<li>Fish for salmon early in the morning or late at night.
</p>
</li>
</ul>
<ul>
<p>
<li>Salmon tend to stay at the bottom, so use weights.
</p>
</li>
</ul>
<ul>
<p>
<li>Each state has varying fishing regulations. It is important to educate yourself on them before going out to fish.
</p>
</li>
</ul>
<ul>
<p>
<li>Remember to acquire a fishing permit if taking up this sport. Fishing without a permit is illegal and could result in a fine.
</p>
</li>
</ul>
<ul>
<p>
<li>Look at the state's regulations and seasons to find out when you are allowed to fish.
</p>
</li>
</ul>
<ul>
<p>
<li> Most states have a length limit for their fish. If the fish you caught does not measure the minimum, it is required that you let it go. There are sometimes maximum limits for certain fish as well.
</p>
</li>
</ul>
<ul>
<p>
<li>Most states also have daily limits, or the amount of a certain fish you can keep in one day.</li>
</p>
</ul>
<hr>
<h1 id="title"> Salmon life cycle </h1>
<h3 id="h2"> Birth </h3>
<p> When salmon hatch in a gravel nest called the Redd, they stay in the egg for the winter, while the embryos develop. When they finally hatch, these baby fish, also called "alevin", live off the nutrients provided by the yolk that hangs on their stomachs. This yolk provides them with the supliments they need throughought their life as a baby salmon, also called a "fry". For a while, the fry stay on the redd bottom, under the cover of the nest. However, even under this protection, there are still many dangers to a baby salmon fry. (For one, rising water temperatures. With climate change ever increasing and the Earth heating up, the oceans are slowly becoming unsafe for ecosystems to continue. Another potential threat for these fry are predators, such as blue herons, osprey, and kingfishers.) </p>
<h3 id="h2"> Early life </h3>
<p>The fry will not leave the redd until the yolk hanging from their stomachs is all used up. This takes about 12 weeks to fully drain the yolk. By that time, the young fry swim upwards to the surface, gulping up air to fill their swim bladders. With air in their swim bladders, they now begin to feed. They cannot travel upstream yet, as they are too weak, as an alternative, they begin to drift downstream. They stop at calmer pools to rest, and feed on zooplankton and small bugs. Certain species immediately head out to sea, while others spend up to 2 years in fresh water. Migrating to sea is a long and time-staking journey, and imprinting the smells of their home stream into their noses for when it is time for them to spawn.
<h3 id="h2"> Sea migration journey</h3>
<p>Eventually, they make their way into an estuary. This brackish water provides many nutrient rich foods for growing salmon. Here, young salmon undergo many changes to transition from living in freshwalter to saltwalter. This process is called smoltification. During smoltification, salmon develop a dark back, a light belly, and will change to have silvery colors. This coloring will help them hide in the open ocean. Smolts seek deeper water and avoid light, and their gills and kidneys change so they can process saltwater. Young fish remain in the estuary and tidal creeks, feeding on small fish, insects, crustaceans, and mollusks. Meanwhile, older fish gradually move into deaper, saltier water, untill they enter the ocean.</p>
<h3 id="h2"> Sea</h3>
<p> Some salmon remain in costal coastal waters, while others travel thousands of miles through the open ocean. Depending on the species, they will stay in the ocean for 1 to 7 years. As they travel, they will feed on animals such as fuch, squid, eels, and shrimp. These ocean adults have grown larger and stronger in order to prepare for the difficult journey home. This journey begins when they are ready to spawn, and they're guided back by the smells of their home stream. On their way back, they will have to navigate past fishers and predators such as porpoises, sharks, and seals. Those that do make it back to the estuary will face many obstacles in their battle upstream, such as waterfalls, dams, and even more predators. When migrating adults reach fresh water, they stop eating. During the remainder of the journey, their bodies prepare to spawn. They change color from a silver, to brown, green, or red depending on the species. The males of some species develop a hooked snout, a humped back, and elongated tooth. This transformation occurs to atract potential mates and to defend spawning teritory.</p>
<h3 id="h2">The return home</h3>
<p> Upon reaching their native stream, females build nests, or redds. They turn on their side and use their tales to dislodge stones and pebbles. Males fight for spawning rights with the female. The dominant male will court a female and lay her eggs, while the male fertilizes them. The female covers the nest and moves upstream to prepare another redd. After swimming of hundreds of even thousands of miles to get here, and having completed their quest, the salmon's energy is completely drained. Most die within a few days of spawning. While the journey of these salmon has come to an end, the nutrients from their decomposing bodies will fertilize stream and provide the food for insects and microrganisms nourishing the next generation of salmon. Bears, wolves, otters, birds, and other animals bring nutrient rich droppings as well as un-eaten parts of salmon into the forest, helping to fertilize the surrounding land.
<hr>
<h1 id="title"> Extras </h1>
</a>
<p id="main">For more interesting salmon facts, go to
<a id="tribute-link" href="https://www.salmonfacts.com" target="https://www.salmonfacts.com" </a>
this website.
</p>
</a>
<p> <a id="tribute-link" href="https://www.youtube.com/watch?v=d1kDNzWgHxY" target="https://www.youtube.com/watch?v=d1kDNzWgHxY"> This interesting video shows a river in Alaska that acts as a common ground for Sockeye salmon.</p>
<h2>
<a id="tribute-link" href="https://www.fisheries.noaa.gov/ " target="_blank">
https://www.fisheries.noaa.gov
</h2> </a>
<figure id="img-div">
<div id="sushi1"><img src="https://media.giphy.com/media/4YzoaFKXaGHbpkOnV3/giphy.gif"></div>
<script type="text/javascript">
sushi = document.getElementById('sushi1');
sushi.addEventListener('click', function() {
sushi.classList.add('active');
});
</script>
</body>
</html>

CSS:

#title {
font-family: limelight;
font-size: 40px;
color: #ffe3f0;
text-align: center;
text-shadow: 2px 2px 5px;
z-index: z("top");
}
#sushi1 {
position: absolute;
left: 0;
visibility: visible;
}
.active {
animation: LeftToR 3s infinite linear;
}
@keyframes LeftToR {
0% {
left: -15;
visibility: visible;
}
25% {
left: 25%;
visibility: visible;
}
50% {
left: 50%;
visibility: visible;
}
75% {
left: 75%;
visibility: visible;
}
94% {
visibility: hidden;
left: 100%
}
95% {
left: -10%;
visibility: hidden;
}
100% {
left: 0%;
visibility: visible;
}
}
#h2 {
font-size: 30px;
color: #ffe3f0;
font-family: limelight;
text-align: center;
text-shadow: 2px 2px 5px;
z-index: z("top");
}
#background {
position: absolute;
left: 0px;
top: 0px;
z-index: z("top");
width: 80px;
height: 60px;
background-repeat: repeat;
}
li {
font-size: 17px;
text-shadow: 2px 2px 5px;
line-height: 25px;
z-index: z("top");
color: #ffbad3;
}
hr {
width: 400px;
background-color: pink;
height: 5px;
z-index: z("top");
}
p {
font-family: grandstander;
color: #ffbad3;
text-align: center;
text-shadow: 2px 2px 5px;
font-size: 17px;
line-height: 23px;
z-index: z("top");
}
ul {
font-family: grandstander;
color: #e9967a;
text-align: center;
text-shadow: 1px 1px 5px;
line-height: 20px;
z-index: z("top");
}
cite {
color: #ffbad3;
text-align: left;
text-shadow: 2px 2px 5px;
font-size: 17px;
line-height: 23px;
font-family: grandstander;
}
#img-div {
border-radius: 50px;
box-shadow: 0 0 20px salmon;
}
#image {
border-radius: 50px;
box-shadow: 0 0 20px salmon;
background-color: white;
}
#image2 {
z-index: 0;
width: 150px;
height: 150px;
padding: 0px;
background-repeat: repeat;
}
#salmonphoto3 {
border-radius: 50px;
box-shadow: 0 0 20px salmon;
background-color: white;
image-height: 15px;
}
#salmonjumpgif {
border-radius: 50px;
box-shadow: 0 0 20px salmon;
}
#img-caption {
font-style: italic;
padding: 2px;
text-align: left;
font-size: 17px;
font-family: grandstander;
color: #ffe3f0;
text-shadow: 2px 2px 5px;
}
#tribute-link {
color: white;
font-family: grandstander;
text-align: left;
font-size: 17px;
padding: 2px;
}
#tribute-link:hover {
color: #ffbad3;
}
#sushi {
position: relative;
cursor: pointer;
}
main {
color: #ffbad3;
text-align: center;
text-shadow: 2px 2px 5px;
font-size: 17px;
line-height: 23px;
z-index: z("top");
}
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -25px;
}
body {
overflow: x;
}