Pure CSS Slider
How do I make an pure css slider?
This is a pure CSS slider. Currently the keyframe animation has to be changed if you differ the amount of slides which is a shame. I'd like to look into dynamically creating the keyframe animation, which would allow me to adjust the percentages based upon the amount of slides but I'm under the impression that's not possible.. What is a pure css slider? How do you make a pure css slider? This script and codes were developed by Daryll Doyle on 24 January 2023, Tuesday.
Pure CSS Slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS Slider</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="sliderWrap"> <div class="sliderContent"> <div class="slide"> <img src="http://placehold.it/400x200&text=1"> <div class="text">This is some text</div> </div> <div class="slide"> <img src="http://placehold.it/400x200&text=2"> <div class="text">You can hover to pause the slider.</div> </div> <div class="slide"> <img src="http://placehold.it/400x200&text=3"> <div class="text">How about a <a href="https://enshrined.co.uk/" target="_BLANK">link</a>?</div> </div> </div>
</div>
</body>
</html>
Pure CSS Slider - Script Codes CSS Codes
@-webkit-keyframes slideMe { 0% { -webkit-transform: translateX(0%); transform: translateX(0%); } 30% { -webkit-transform: translateX(0%); transform: translateX(0%); } 40% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } 70% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } 80% { -webkit-transform: translateX(-200%); transform: translateX(-200%); } 99% { -webkit-transform: translateX(-200%); transform: translateX(-200%); } 100% { -webkit-transform: translateX(0%); transform: translateX(0%); }
}
@keyframes slideMe { 0% { -webkit-transform: translateX(0%); transform: translateX(0%); } 30% { -webkit-transform: translateX(0%); transform: translateX(0%); } 40% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } 70% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } 80% { -webkit-transform: translateX(-200%); transform: translateX(-200%); } 99% { -webkit-transform: translateX(-200%); transform: translateX(-200%); } 100% { -webkit-transform: translateX(0%); transform: translateX(0%); }
}
.sliderWrap { width: 400px; height: 200px; margin: auto; overflow: hidden; position: relative;
}
.sliderWrap .sliderContent { width: auto; max-height: 100%; white-space: nowrap; font-size: 0px; -webkit-transition-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95); transition-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95); -webkit-transition: all 5000ms cubic-bezier(0.445, 0.05, 0.55, 0.95); transition: all 5000ms cubic-bezier(0.445, 0.05, 0.55, 0.95); -webkit-animation: slideMe 16s infinite; animation: slideMe 16s infinite;
}
.sliderWrap .sliderContent:hover { -webkit-animation-play-state: paused; animation-play-state: paused;
}
.sliderWrap .sliderContent .slide { display: inline-block; height: auto; width: 100%; position: relative;
}
.sliderWrap .sliderContent .slide .text { font-size: 1.5rem; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; position: absolute; bottom: 0; box-sizing: border-box; padding: 10px;
}
Developer | Daryll Doyle |
Username | darylldoyle |
Uploaded | January 24, 2023 |
Rating | 3 |
Size | 2,748 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Crafty Clicks Wrapper Demo | 2,974 Kb |
Ball Bounce | 3,196 Kb |
Pure CSS Checkbox | 3,316 Kb |
The very 2D caterpillar | 3,702 Kb |
CSS Only, Responsive Modal Form | 3,862 Kb |
Test. | 1,403 Kb |
CSS Ball Loader | 2,449 Kb |
CSS Owl | 3,421 Kb |
Battery API | 3,321 Kb |
CSS Cow | 3,968 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Weather App | Kw7oe | 3,162 Kb |
Playing with FlexBox | _Billy_Brown | 3,162 Kb |
Mobile first social buttons with no iframe | Alistairtweedie | 3,158 Kb |
Barber Shop | Bhlaird | 6,270 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
Nice textured background | Hans | 2,659 Kb |
Konami Code Easter Egg | Teolitto | 3,051 Kb |
Alter bg opacity on hover... | Chrisboon27 | 2,054 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
Midterm dry run | Jds317 | 1,649 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!