Membuat Pure Slider Dengan CSS3

Membuat Pure Slider Dengan CSS3 | Seperti janji ku kemarin, kalau akan share tentang slider. Nah seperti kemarin menggunakan CSS3 tanpa JS atau jquery. Jadi mudah ketika mengatur ini dan itu. Slider ini pantas di letakkan pada homepage saja, memang karena ukuran yang relatif membuat sesak blog. Jadi silakan bagi anda yang ingin memakai slider ini.


Kalau ada link download kan itu terlalu mainstream, sekarang anda ambil saja code di bawah ini.

CSS, CSS3 PURE SLIDER

<style type="text/css">
/* LAYOUT */
.bocahit {
margin:0 auto;
overflow:hidden;
width:960px;
}

/* CONTENT SLIDER */
#content-slider {
width:100%;
height:360px;
margin:10px auto 0;
}
/* SLIDER */
#slider {
background:#000;
border:5px solid #eaeaea;
box-shadow:1px 1px 5px rgba(0,0,0,0.7);
height:320px;
width:600px;
overflow:visible;
position:relative;
}
#wammy {
overflow:hidden;
height:320px;
}
#slider ul {
margin:0;
padding:0;
position:relative;
}
#slider li {
width:680px;
height:320px;
position:absolute;
top:-325px;
list-style:none;
}

#slider li.firstanimation {
-moz-animation:cycle 25s linear infinite;
-webkit-animation:cycle 25s linear infinite;
}
#slider li.secondanimation {
-moz-animation:cycletwo 25s linear infinite;
-webkit-animation:cycletwo 25s linear infinite;
}
#slider li.thirdanimation {
-moz-animation:cyclethree 25s linear infinite;
-webkit-animation:cyclethree 25s linear infinite;
}
#slider li.fourthanimation {
-moz-animation:cyclefour 25s linear infinite;
-webkit-animation:cyclefour 25s linear infinite;
}
#slider li.fifthanimation {
-moz-animation:cyclefive 25s linear infinite;
-webkit-animation:cyclefive 25s linear infinite;
}

#slider .tooltip {
background:rgba(0,0,0,0.7);
width:300px;
height:60px;
position:relative;
bottom:75px;
left:-320px;
-moz-transition:all 0.3s ease-in-out;
-webkit-transition:all 0.3s ease-in-out;
}
#slider .tooltip p {
color:#fff;
font:"Coda";
font-size:24px;
font-weight:300;
line-height:60px;
padding:0 0 0 20px;
}
#slider li#first:hover .tooltip,
#slider li#second:hover .tooltip,
#slider li#third:hover .tooltip,
#slider li#fourth:hover .tooltip,
#slider li#fifth:hover .tooltip {
left:0px;
}
#slider:hover li,
#slider:hover .progress-bar {
-moz-animation-play-state:paused;
-webkit-animation-play-state:paused;
}

/* PROGRESS BAR */
.progress-bar {
position:relative;
top:-5px;
width:680px;
height:5px;
background:#000;
-moz-animation:fullexpand 25s ease-out infinite;
-webkit-animation:fullexpand 25s ease-out infinite;
}
/* ANIMATION */
@-moz-keyframes cycle {
0% { top:0px; }
4% { top:0px; }
16% { top:0px; opacity:1; z-index:0; }
20% { top:325px; opacity:0; z-index:0; }
21% { top:-325px; opacity:0; z-index:-1; }
92% { top:-325px; opacity:0; z-index:0; }
96% { top:-325px; opacity:0; }
100%{ top:0px; opacity:1; }

}
@-moz-keyframes cycletwo {
0% { top:-325px; opacity:0; }
16% { top:-325px; opacity:0; }
20% { top:0px; opacity:1; }
24% { top:0px; opacity:1; }
36% { top:0px; opacity:1; z-index:0; }
40% { top:325px; opacity:0; z-index:0; }
41% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-moz-keyframes cyclethree {
0% { top:-325px; opacity:0; }
36% { top:-325px; opacity:0; }
40% { top:0px; opacity:1; }
44% { top:0px; opacity:1; }
56% { top:0px; opacity:1; }
60% { top:325px; opacity:0; z-index:0; }
61% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-moz-keyframes cyclefour {
0% { top:-325px; opacity:0; }
56% { top:-325px; opacity:0; }
60% { top:0px; opacity:1; }
64% { top:0px; opacity:1; }
76% { top:0px; opacity:1; z-index:0; }
80% { top:325px; opacity:0; z-index:0; }
81% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-moz-keyframes cyclefive {
0% { top:-325px; opacity:0; }
76% { top:-325px; opacity:0; }
80% { top:0px; opacity:1; }
84% { top:0px; opacity:1; }
96% { top:0px; opacity:1; z-index:0; }
100%{ top:325px; opacity:0; z-index:0; }
}

@-webkit-keyframes cycle {
0% { top:0px; }
4% { top:0px; }
16% { top:0px; opacity:1; z-index:0; }
20% { top:325px; opacity:0; z-index:0; }
21% { top:-325px; opacity:0; z-index:-1; }
50% { top:-325px; opacity:0; z-index:-1; }
92% { top:-325px; opacity:0; z-index:0; }
96% { top:-325px; opacity:0; }
100%{ top:0px; opacity:1; }

}
@-webkit-keyframes cycletwo {
0% { top:-325px; opacity:0; }
16% { top:-325px; opacity:0; }
20% { top:0px; opacity:1; }
24% { top:0px; opacity:1; }
36% { top:0px; opacity:1; z-index:0; }
40% { top:325px; opacity:0; z-index:0; }
41% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-webkit-keyframes cyclethree {
0% { top:-325px; opacity:0; }
36% { top:-325px; opacity:0; }
40% { top:0px; opacity:1; }
44% { top:0px; opacity:1; }
56% { top:0px; opacity:1; z-index:0; }
60% { top:325px; opacity:0; z-index:0; }
61% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-webkit-keyframes cyclefour {
0% { top:-325px; opacity:0; }
56% { top:-325px; opacity:0; }
60% { top:0px; opacity:1; }
64% { top:0px; opacity:1; }
76% { top:0px; opacity:1; z-index:0; }
80% { top:325px; opacity:0; z-index:0; }
81% { top:-325px; opacity:0; z-index:-1; }
100%{ top:-325px; opacity:0; z-index:-1; }
}
@-webkit-keyframes cyclefive {
0% { top:-325px; opacity:0; }
76% { top:-325px; opacity:0; }
80% { top:0px; opacity:1; }
84% { top:0px; opacity:1; }
96% { top:0px; opacity:1; z-index:0; }
100%{ top:325px; opacity:0; z-index:0; }
}

/* ANIMATION BAR */
@-moz-keyframes fullexpand {
0%, 20%, 40%, 60%, 80%, 100% { width:0%; opacity:0; }
4%, 24%, 44%, 64%, 84% { width:0%; opacity:0.3; }
16%, 36%, 56%, 76%, 96% { width:100%; opacity:0.7; }
17%, 37%, 57%, 77%, 97% { width:100%; opacity:0.3; }
18%, 38%, 58%, 78%, 98% { width:100%; opacity:0; }
}
@-webkit-keyframes fullexpand {
0%, 20%, 40%, 60%, 80%, 100% { width:0%; opacity:0; }
4%, 24%, 44%, 64%, 84% { width:0%; opacity:0.3; }
16%, 36%, 56%, 76%, 96% { width:100%; opacity:0.7; }
17%, 37%, 57%, 77%, 97% { width:100%; opacity:0.3; }
18%, 38%, 58%, 78%, 98% { width:100%; opacity:0; }
}
</style>

HTML, CSS3 PURE SLIDER

<div class="bocahit">
<div id="content-slider">
<div id="slider">
<div id="wammy">
<ul>
<li id="first" class="firstanimation">
<a href="http://www.bocahit.com/search/label/Pemrograman">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3iFEXFHk6Uz61UFh3PIxy3ANZjosKmt2kTnz-od6fYmGsmWqmnsOJ10I72Mi_PCFoeC-ibk-Albtd8owmJpLKC9AMKPvzxyg7KMNdWzwuVOB8-VWEVsE2gU9LatKf4v-wojJx-WGLXBmv/s680/C.png" alt="Pemrograman Bahasa C"/>
</a>
<div class="tooltip">
<p>Pemrograman C</p>
</div>
</li>

<li id="second" class="secondanimation">
<a href="http://www.bocahit.com/search/label/Cosplay">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJcYHZcAgze_SKmULrmsKRi3mYsxgJcAg0SDUfXNRiWvqsrSjG5vF_oRdKSvQZH902i7HQZGgjyfwwnW6e5yZWWRjHMMV-KJRyOJYoTxSgVeXlpXMpiL5FDMTzXmrMZk4EqzO7qLtdur9f/s680/CZ.png" alt="Tips Jitu Cosplayer"/>
</a>
<div class="tooltip">
<p>Tips Jitu Cosplayer</p>
</div>
</li>

<li id="third" class="thirdanimation">
<a href="#">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg56CpbT0egHIjh0BBMcGkNXTvhVNyFz1dLKOTG8Fx5J0SrnM9NMfx3pNepp42Y3awvUe7LjIzWIguoc03SbJ8lQUwfAhtF_lm4oOni9TUNQfPgGIeae_2fvJLk2uIKCP1qrlZ99BE6KC44/s680/City%2520Hunter.png" alt="Info Figure"/>
</a>
<div class="tooltip">
<p>Info Figure</p>
</div>
</li>

<li id="fourth" class="fourthanimation">
<a href="http://www.bocahit.com/search/label/SEO">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfWVhoo-H5ht0LlZJ9ix4LmjEE_Yy3V8K3i15RE8jMw7S8rGui0VWbgY6wPAzPo0nVCSl3qFGa4nGbJDOZrJE5woAaOP0tHVL8tVYRbFPlX2TAy-EB0lQPVC3_ISK9BMyJQwToUohyphenhyphenoizP/s680/SEO.png" alt="Tips SEO"/>
</a>
<div class="tooltip">
<p>Tips SEO</p>
</div>
</li>

<li id="fifth" class="fifthanimation">
<a href="http://www.bocahit.com/search/label/Blogger">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBJaUC2yrwfvMOu8C9LTFJTIr-CefDuX2ElBFZMwUGXK4Cv6ybZTBsdWiJmUtltkKTUolztWPshvHPD-hPzMlLPIr8zRMKZNVfLvi8eLljFfac6rTP6RvUwOHOBSTLTFTLCtDP7xH-fjDf/s680/blog.png" alt="Tutorial Blog"/>
</a>
<div class="tooltip">
<p>Tutorial Blogger</p>
</div>
</li>
</ul>
</div>
<div class="progress-bar"></div>
</div>
</div>
</div>

Panjangkah?semakin panjang semakin asik aja,,Selamat Mencoba :D

3 comments:

 
D2D :] © 2013. All Rights Reserved. Powered by Blogger
Top