Thứ Sáu, 25 tháng 5, 2018

Code Slider Post Làm Trang Chủ
XEM BÀI VIÊT
TOÀN MÀN HÌNH


Demo

Đầu tiên chèn đoạn css dưới:

<link href="css/style.css" rel="stylesheet" type="text/css"></link>
<link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet"></link>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"></link>
<style>
body,html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
display: block;
position: relative;
overflow: hidden;
font-family: 'Slabo 27px', serif;
font-size: 16px;
}

h1,h2,h3,h4,h5,h6 {
padding: 0;
margin: 0;
}
ul,li,p {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
.wrapper {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}
.wrapper .container {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}

.slideshow {
height: 100%;
width: 100%;
display: block;
overflow: hidden;
}
.slideshow .slideshow-left {
width: 40%;
float: left;
position: relative;
height: 100%;
}
.slideshow .slideshow-left .Lslide {
height: 100%;
display: block;
overflow: hidden;
position: absolute;
bottom: 0px;
top: 0;
left: 0;
right: 0;
}
.slideshow .Lslide-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
}
.slideshow .Lslide-content h2 {
color: #fff;
font-weight: 600;
font-size: 60px;
line-height: 0.8;
}
.slideshow .Lslide-content p {
color: #fff;
padding: 2.5em 0em;
}
.slideshow .Lslide-content .button {
background-color: #fff;
display: inline-block;
border-radius: 25px;
position: relative;
}
.slideshow .Lslide-content .button i {
float: right;
position: absolute;
top: 50%;
right: 2.5em;
color: #000;
font-size: 9px;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transition: all 0.3s;
}
.slideshow .Lslide-content .button:hover i {
right: 1.7em;
}
.slideshow .Lslide-content .button p {
margin: 0;
padding: 0;
color: #000;
text-align: left;
padding: 0.8em 8em 0.8em 1.5em;
font-size: 12px;
font-weight: 600;
}
.slideshow .slideshow-right {
width: 60%;
float: left;
position: relative;
height: 100%;
}
.slideshow .slideshow-right .Rslide {
height: 100%;
display: block;
overflow: hidden;
position: absolute;
bottom: 0px;
top: 0;
left: 0;
right: 0;
}
.slideshow .slideshow-right .Rslide img {
min-width: 100%;
}
.control {
position: absolute;
left: 40%;
top: 50%;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
}
.control i {
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
text-align: center;
position: absolute;
color: #aaaaaa;
transition: all 0.3s;
-ms-transition: all 0.3s;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
}
.control .control-top {
width: 45px;
height: 50px;
background-color: #fff;
z-index: 5;
position: relative;
border-radius: 0px 4px 4px 0px;
cursor: pointer;
}
.control .control-top:hover i {
color: #333333;
}
.control .control-bottom {
width: 45px;
height: 50px;
background-color: #fff;
z-index: 5;
position: relative;
border-radius: 4px 0px 0px 4px;
left: -45px;
cursor: pointer;
}
.control .control-bottom:hover i {
color: #333333;
}
</style>

Tiếp theo là đoạn code hiển thị:
 <div class="wrapper">
           <div class="container">

               <div class="slideshow">

                    <div class="slideshow-left">

                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>Probably not</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>But not today</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="Lslide">
                            <div class="Lslide-content">
                                <h2>Probably not</h2>
                                <p>Be a part of our creation</p>

                                <div class="button">
                                    <a href="#">
                                        <p>More</p>
                                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </div>   

                    </div>

                    <div class="slideshow-right">

                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-3.jpg" alt="">
                        </div>

                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-5.jpg" alt="">
                        </div>   
                        <div class="Rslide">
                            <img src="http://www.grandvincent-marion.fr/_codepen/flower-1.jpg" alt="">
                        </div>                                             
                    </div>   

                   
                    <div class="control">
                        <div class="oncontrol control-top">
                            <i class="fa fa-arrow-up" aria-hidden="true"></i>
                        </div>
                        <div class="oncontrol control-bottom">
                            <i class="fa fa-arrow-down" aria-hidden="true"></i>
                        </div>                         
                    </div>

               </div>

           </div>
       </div>

Cuối cùng chèn đoạn mã JS dưới đây nữa là xong:
<script>
var Lslide      = document.querySelectorAll('.Lslide'),
    Rslide      = document.querySelectorAll('.Rslide'),
    control     = document.querySelectorAll('.oncontrol'),
    slideHeight = document.querySelector('.wrapper').clientHeight,
    color = ['#fdc97c', '#e5d3d0', '#71b3d6'],
    index = 0;


function init() {
    slideHeight = document.querySelector('.wrapper').clientHeight;
    for (i = 0; i < Lslide.length; i++) {
        Lslide[i].style.backgroundColor = color[i];
        Lslide[i].style.top = -slideHeight * i + "px";
        Rslide[i].style.top = slideHeight * i + "px";
    } 
}
init()
window.addEventListener('resize', function(){
    init()
});

function moveToTop() {

    index++;
    for (el = 0; el < Lslide.length; el++) {
        Lslide[el].style.top = parseInt(Lslide[el].style.top) + slideHeight + "px";
        Rslide[el].style.top = parseInt(Rslide[el].style.top) - slideHeight + "px";
    }

    if (index > Lslide.length-1) {
        index = 0;
        for (el = 0; el < Lslide.length; el++) {
            Lslide[el].style.top = -slideHeight * el + "px";
            Rslide[el].style.top = slideHeight * el + "px";
        }
    }
}

function moveToBottom() {
    index--;
    for (el = 0; el < Lslide.length; el++) {
        Lslide[el].style.top = parseInt(Lslide[el].style.top) - slideHeight + "px";
        Rslide[el].style.top = parseInt(Rslide[el].style.top) + slideHeight + "px";
       
    }
    if (index < 0) {
        index = Rslide.length-1;
        for (el = 0; el < Lslide.length; el++) {
            Lslide[el].style.top = parseInt(Lslide[el].style.top) + slideHeight * Lslide.length + "px";
            Rslide[el].style.top = parseInt(Rslide[el].style.top) - slideHeight * Rslide.length + "px";
        }
    }
}

function transition() {
    for (t = 0; t < Lslide.length; t++) {
        Lslide[t].style.transition = "all 0.8s";
        Rslide[t].style.transition = "all 0.8s";
    }
}
 

for (t = 0; t < control.length; t++) {
    control[t].addEventListener("click", function() {

        if (this.classList.contains('control-top')) {
            moveToTop()
        }
        if (this.classList.contains('control-bottom')) {
            moveToBottom()
        }

        transition()
 
    });
}

var wheeling;
function mousemouve(e) {

    clearTimeout(wheeling);
    e.preventDefault();
    var e = window.event || e;
    var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
   
    wheeling = setTimeout(function() {
        wheeling = undefined;
        if (delta === 1) {
            moveToTop()
        }
        if (delta === -1) {
            moveToBottom()
        }
    }, 100);

    transition()
}

document.addEventListener("mousewheel", mousemouve);
document.addEventListener("DOMMouseScroll", mousemouve);
</script>

Thứ Năm, 16 tháng 2, 2017

Code khung tác giả đẹp
XEM BÀI VIÊT
TOÀN MÀN HÌNH




Chèn code hiện thị:



<section>
<input type="radio" id="profile" value="1" name="tractor" checked='checked' />
<input type="radio" id="settings" value="2" name="tractor" />
<input type="radio" id="posts" value="3" name="tractor" />
<input type="radio" id="books" value="4" name="tractor" />

<nav>
<label for="profile" class='fontawesome-camera-retro'></label>
<label for="settings" class='fontawesome-film'></label>
<label for="posts" class='fontawesome-calendar'></label>
<label for="books" class='fontawesome-list-alt'></label>
</nav>

<article class='uno'>
<h2>
<img alt='' src='http://demo.htmleaf.com/1411/201411211523/head-photo.jpg' />
Bẽo
<span>Chia se 78</span></h2>
<footer>
<ul>
<li class='fontawesome-link'></li>
<li class='fontawesome-paper-clip'></li>
<li class='fontawesome-sitemap'></li>
<li class='fontawesome-wrench'></li>
<li class='fontawesome-magic'></li>
</ul>
</footer>
</article>

<article class='dos fontawesome-wrench'>
<p>I'm hurting baby, I'm broken down
I need your loving, loving
I need it now
When I'm without you
I'm something weak
You got me begging, begging
I'm on my knees
I don't wanna be needing your love
I just wanna be deep in your love
And it's killing me when you're away
Ooh baby, cause a bullet don't care where you are
I just wanna be there where you are
And I gotta get one little taste
</p>
</article>

<article class='tres fontawesome-file-alt'>
<ol>
<li>Won't you come and put it down on me
</li>
<li>Oh right here, cause I need
</li>
<li>Little love and little sympathy
</li>
<li>Yeah you show me good loving
</li>
<li>Make it alright
</li>
<li>Need a little a sweetness in my life
</li>
</ol>
</article>

<article class='cuatro fontawesome-copy'>
<dl>
<dt>My broken pieces
</dt>
<dd>You pick them up
Don't leave me hanging, hanging
Come give me some </dd>
<dt>Won't you come and put it down on me
</dt>
<dd>Oh right here, cause I need
Little love and little sympathy
Yeah you show me good loving
Make it alright </dd>
</dl>
</article>
</section>










@import url(http://fonts.googleapis.com/css?family=Dosis:600,200|Great+Vibes);
@import url(http://weloveiconfonts.com/api/?family=fontawesome);
*, *:after, *:before {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
* {margin:0;padding:0;border: 0 none;position: relative;}
[class*="fontawesome-"]:before {font-family: 'fontawesome', sans-serif;}

html {
background: #33485E;
width: 100%;
height: 100%;
font-family: dosis, sans-serif;
font-weight: 300;
color: #fff;
}

section {
background: #31A66C;
width: 80vw;
max-width: 40rem;
min-width: 390px;
height: 25rem;
margin: 4rem auto;
box-shadow: 0 0 6px rgba(0,0,0,.4);
}
article {
position: absolute;
left: 0;
top: 5rem;
right: 0;
bottom: 0;
padding: 1rem 2rem 0;
overflow: auto;
transition: .7s;
transform: scale(0);
transform-origin: center right;
transition-delay: .1s;
}
article:before {
color: rgba(0,0,0,.2);
font-size: 4rem;
font-weight: 100;
position: absolute;
bottom: 1rem;
right: 1rem;
}
h2 {
font-size: 2.5rem;
font-weight: 600;
text-align: center;
color: rgba(0,0,0,.6);
}
h2 img {
width: 120px;
height: auto;
background: #f9f9f9;
border: 5px solid rgba(0,0,0,.7);
border-radius: 50%;
padding: 5px;
display: block;
margin: 0 auto;
box-shadow: 0 0 7px rgba(0,0,0,.5);
}
h2 span {
font-family: Great Vibes;
font-weight: 400;
display: block;
margin-bottom: 1rem;
}
footer ul {
width: 100%;
color: #037B49;
}
footer li {
list-style-type: none;
float: left;
width: 20%;
text-align: center;
font-size: 3rem;
font-weight: 100;
}
p, dl, ol {
line-height: 1.5;
font-size: 1.3rem;
}
ol li {margin: 0 0 .5rem 1rem;}
dt {
font-size: 1.6rem;
font-weight: 600;
text-indent: 1.5rem;
}
nav {
background: #fff;
width: 100%;
height: 5rem;
box-shadow: 0 0 6px rgba(0,0,0,.4);
}
nav:after {
content:'';
width: 25%;
height: 5rem;
background: #BEE3D1;
position: absolute;
transition: .5s;
}
input {
display: none;
}
label {
width: 25%;
float: left;
color: #BEE3D1;
text-align: center;
cursor: pointer;
transition: .5s;
z-index: 2;
}
label:hover {color: #1E6743;}
label:before {
display: block;
font-size: 3rem;
line-height: 5rem;
z-index: 2;
}
#profile:checked ~ nav [for='profile'],
#settings:checked ~ nav [for='settings'],
#posts:checked ~ nav [for='posts'],
#books:checked ~ nav [for='books'] {
color: #1E6743;
font-weight: 600;
}
#settings:checked ~ nav [for='settings'] {}
#profile:checked ~ nav [for='profile'] {}

#profile:checked ~ nav:after {
left: 0;
}
#settings:checked ~ nav:after {
left:25%;
border-top: 0 none;
}
#posts:checked ~ nav:after {
left: 50%;
}
#books:checked ~ nav:after {
left: 75%;
}

#profile:checked ~ .uno,
#settings:checked ~ .dos,
#posts:checked ~ .tres,
#books:checked ~ .cuatro {
display: block;
transform: scale(1);
transition-delay: .5s;
}
a {color: rgba(0,0,0,.4)}
a:hover {color: rgba(0,0,0,.2)}

Hiệu ứng Button cực đẹp
XEM BÀI VIÊT
TOÀN MÀN HÌNH




Code:


<button class="draw">draw</button>
<button class="draw meet">draw meet</button>
<button class="center">center</button>
<button class="spin">spin</button>
<button class="spin circle">spin circle</button>
<button class="spin thick">spin thick</button>




CSS:

button {
background: none;
border: 0;
box-sizing: border-box;
box-shadow: inset 0 0 0 2px #f45e61;
color: #f45e61;
font-size: inherit;
font-weight: 700;
margin: 1em;
padding: 1em 2em;
text-align: center;
text-transform: capitalize;
position: relative;
vertical-align: middle;
}
button::before, button::after {
box-sizing: border-box;
content: '';
position: absolute;
width: 100%;
height: 100%;
}

.draw {
-webkit-transition: color 0.25s;
transition: color 0.25s;
}
.draw::before, .draw::after {
border: 2px solid transparent;
width: 0;
height: 0;
}
.draw::before {
top: 0;
left: 0;
}
.draw::after {
bottom: 0;
right: 0;
}
.draw:hover {
color: #60daaa;
}
.draw:hover::before, .draw:hover::after {
width: 100%;
height: 100%;
}
.draw:hover::before {
border-top-color: #60daaa;
border-right-color: #60daaa;
-webkit-transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
}
.draw:hover::after {
border-bottom-color: #60daaa;
border-left-color: #60daaa;
-webkit-transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
}

.meet:hover {
color: #fbca67;
}
.meet::after {
top: 0;
left: 0;
}
.meet:hover::before {
border-top-color: #fbca67;
border-right-color: #fbca67;
}
.meet:hover::after {
border-bottom-color: #fbca67;
border-left-color: #fbca67;
-webkit-transition: height 0.25s ease-out, width 0.25s ease-out 0.25s;
transition: height 0.25s ease-out, width 0.25s ease-out 0.25s;
}

.center:hover {
color: #6477b9;
}
.center::before, .center::after {
top: 0;
left: 0;
height: 100%;
width: 100%;
-webkit-transform-origin: center;
-ms-transform-origin: center;
transform-origin: center;
}
.center::before {
border-top: 2px solid #6477b9;
border-bottom: 2px solid #6477b9;
-webkit-transform: scale3d(0, 1, 1);
transform: scale3d(0, 1, 1);
}
.center::after {
border-left: 2px solid #6477b9;
border-right: 2px solid #6477b9;
-webkit-transform: scale3d(1, 0, 1);
transform: scale3d(1, 0, 1);
}
.center:hover::before, .center:hover::after {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
-webkit-transition: -webkit-transform 0.5s;
transition: transform 0.5s;
}

.spin {
width: 6em;
height: 6em;
padding: 0;
}
.spin:hover {
color: #0eb7da;
}
.spin::before, .spin::after {
top: 0;
left: 0;
}
.spin::before {
border: 2px solid transparent;
}
.spin:hover::before {
border-top-color: #0eb7da;
border-right-color: #0eb7da;
border-bottom-color: #0eb7da;
-webkit-transition: border-top-color 0.15s linear, border-right-color 0.15s linear 0.1s, border-bottom-color 0.15s linear 0.2s;
transition: border-top-color 0.15s linear, border-right-color 0.15s linear 0.1s, border-bottom-color 0.15s linear 0.2s;
}
.spin::after {
border: 0 solid transparent;
}
.spin:hover::after {
border-top: 2px solid #0eb7da;
border-left-width: 2px;
border-right-width: 2px;
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
-webkit-transition: -webkit-transform 0.4s linear 0s, border-left-width 0s linear 0.35s;
transition: transform 0.4s linear 0s, border-left-width 0s linear 0.35s;
}

.circle {
border-radius: 100%;
box-shadow: none;
}
.circle::before, .circle::after {
border-radius: 100%;
}

.thick {
color: #f45e61;
}
.thick:hover {
color: #fff;
font-weight: 700;
}
.thick::before {
border: 3em solid transparent;
z-index: -1;
}
.thick::after {
mix-blend-mode: color-dodge;
z-index: -1;
}
.thick:hover::before {
background: #f45e61;
border-top-color: #f45e61;
border-right-color: #f45e61;
border-bottom-color: #f45e61;
-webkit-transition: background 0s linear 0.4s, border-top-color 0.15s linear, border-right-color 0.15s linear 0.15s, border-bottom-color 0.15s linear 0.25s;
transition: background 0s linear 0.4s, border-top-color 0.15s linear, border-right-color 0.15s linear 0.15s, border-bottom-color 0.15s linear 0.25s;
}
.thick:hover::after {
border-top: 3em solid #f45e61;
border-left-width: 3em;
border-right-width: 3em;
}
Code tác giả ẩn hiện chất
XEM BÀI VIÊT
TOÀN MÀN HÌNH




Chèn Code Dưới vào sau /header:


<link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>

<div class="container">
<div class="menu-wrap">
<nav class="menu-top">
<div class="profile"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlQeHPOd0MfDFyH578k2wTQi23d4zKE0nxA_aiRbk17bg1gEk7q476DUINycfLPI7_jNPf9KF4Lb1KauFi13Q_u0KT1pBNAFFQLf009zADLcozsnijf9kF32eYRfDU7KkRJRAo2J3Vx54/s1600/123213.png" alt="Bẽo Hòa Vinh"/><span>Bẽo Hòa Vinh</span></div>
<div class="icon-list">
<a href="#"><i class="fa fa-fw fa-star-o"></i></a>
<a href="#"><i class="fa fa-fw fa-bell-o"></i></a>
<a href="#"><i class="fa fa-fw fa-envelope-o"></i></a>
<a href="#"><i class="fa fa-fw fa-comment-o"></i></a>
</div>
</nav>
<nav class="menu-side">
<a href="#">Recent Stories</a>
<a href="#">Reading List</a>
<a href="#">My Stories</a>
<a href="#">Categories</a>
</nav>
</div>
<button class="menu-button" id="open-button"></button>
<div class="content-wrap">
<div class="content">
<header class="codrops-header">
<h1>Chia Sẻ 78 <span>TÁC GIẢ ẨN HIỆN</span></h1>
<p>
ĐI ĐỂ TRỞ VỀ <br/>
Sáng tác: Tiên Cookie <br/>
<br/>
Verse: <br/>
Tôi đang ở một nơi rất xa, nơi không<br/> có khói bụi thành phố <br/>
Ở một nơi đẹp như mơ <br/>
Trên cao êm êm mây trắng bay lặng nhìn<br/> biển rộng sóng vỗ <br/>
Cuộc đời tôi là những chuyến đi dài <br/>
<br/>
Pre: <br/>
Vượt suối thác, vượt núi dốc, dù chênh<br/> vênh, có xá gì <br/>
Có biết bao thứ tươi đẹp vẫn cứ ở đó<br/> đang chờ tôi <br/>
Người xung quanh ở nơi đây thật dễ mến<br/> dẫu mới gặp <br/>
Ánh mắt lấp lánh hiền hoà chào tôi<br/> chào người bạn mới <br/>
<br/>
Chorus: <br/>
Từng chặng đường dài mà ta qua, giờ<br/> ngồi một mình lại thấy nhớ <br/>
Ngày ngày mặt trời rạng ngời vươn cao<br/> lên từ trên mái nhà <br/>
Từng chặng đường dài mà ta qua đều để<br/> lại kỉ niệm quý giá <br/>
Để lại một điều rằng càng đi xa ta<br/> càng thêm nhớ nhà <br/>
<br/>
Đi thật xa để trở về <br/>
Đi thật xa để trở về <br/>
Có một nơi để trở về <br/>
Đi, Đi để trở về <br/>
<br/>
Verse II: <br/>
Tôi đang ở một nơi rất xa, nơi không<br/> có khói bụi thành phố<br/>
Ở một nơi đẹp như mơ <br/>
Trên cao êm êm mây trắng bay lặng nhìn<br/> biển rộng sóng vỗ <br/>
Cuộc đời tôi là những chuyến đi dài <br/>
<br/>
pre: <br/>
Vượt suối thác, vượt núi dốc, dù chênh<br/> vênh, có xá gì <br/>
Có biết bao thứ tươi đẹp còn đang<br/> trông mong tôi ghé qua <br/>
Người xung quanh ở nơi đây thật dễ mến<br/> dẫu mới gặp <br/>
Ánh mắt lấp lánh hiền hoà chào tôi<br/> chào người bạn mới <br/>
<br/>
Chorus: <br/>
Từng chặng đường dài mà ta qua, giờ<br/> ngồi một mình lại thấy nhớ<br/>
Ngày ngày mặt trời rạng ngời vươn cao<br/> lên từ trên mái nhà <br/>
Từng chặng đường dài mà ta qua đều để<br/> lại kỉ niệm quý giá <br/>
Để lại một điều rằng càng đi xa ta<br/> càng thêm nhớ nhà <br/>
<br/>
Đi thật xa để trở về <br/>
Đi thật xa để trở về <br/>
Có một nơi để trở về <br/>
Đi, Đi để trở về <br/>
<br/>
Brigde:
<br/>
Cuộc đời thật đẹp khi được đi muôn nơi<br/> xa xôi rộng lớn <br/>
Nhưng ta vẫn có nơi để trở về sau mỗi<br/> chuyến đi <br/>
Điều kì diệu là con người ta đi xa hơn<br/> để trưởng thành hơn <br/>
Không quên mang theo bên cạnh hành<br/> trang nỗi nhớ gia đình<br/>
</p>
</header>
</div>
</div><!-- /content-wrap -->
</div><!-- /container -->

<script src="http://demo.htmleaf.com/1410/201410182336/js/main.js"></script>







Chèn CSS dưới vào:



.menu-wrap a {
color: #b8b7ad;
}

.menu-wrap a:hover,
.menu-wrap a:focus {
color: #c94e50;
}

.content-wrap {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}

.content {
position: relative;
background: #b4bad2;
}

/* Overlay */
.content::before {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.3);
content: '';
opacity: 0;
-webkit-transform: translate3d(100%,0,0);
transform: translate3d(100%,0,0);
-webkit-transition: opacity 0.3s, -webkit-transform 0s 0.3s;
transition: opacity 0.3s, transform 0s 0.3s;
}

/* Menu Button */
.menu-button {
position: fixed;
z-index: 1000;
margin: 1em;
padding: 0;
width: 2.5em;
height: 2.25em;
border: none;
text-indent: 2.5em;
font-size: 1.5em;
color: transparent;
background: transparent;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}

.menu-button::before {
position: absolute;
top: 0.5em;
right: 0.5em;
bottom: 0.5em;
left: 0.5em;
background: linear-gradient(#373a47 20%, transparent 20%, transparent 40%, #373a47 40%, #373a47 60%, transparent 60%, transparent 80%, #373a47 80%);
content: '';
}

.menu-button:hover {
opacity: 0.6;
}
/* Menu */
.menu-wrap {
position: absolute;
font-weight: 700;
opacity: 0;
-webkit-transition: opacity 1s;
transition: opacity 1s;
}

.menu-top {
line-height: 58px;
}

.menu-top .profile {
display: inline-block;
padding: 8px 10px;
line-height: 42px;
}

.menu-top .profile,
.menu-side {
width: 300px;
}

.menu-top .profile img {
float: left;
margin-right: 1em;
width: 43px;
}

.icon-list {
display: inline-block;
font-size: 1.25em;
}

.icon-list a {
margin: 0 1em 0 0;
padding: 0;
}

@media screen and (max-width: 32em) {
.icon-list {
padding-left: 1em;
}
}

.menu-side a {
display: block;
padding: 1.2em;
border-bottom: 1px solid rgba(0,0,0,0.1);
}

.menu-side a:first-child {
border-top: 1px solid rgba(0,0,0,0.1);
}

/* Shown menu */
.show-menu .menu-wrap {
opacity: 1;
}

.show-menu .content-wrap,
.show-menu .menu-button {
-webkit-transform: translate3d(300px,60px,0);
transform: translate3d(300px,60px,0);
}

.show-menu .content::before {
opacity: 1;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
/* Header */
.codrops-header {
margin: 0 auto;
padding: 3em 2em;
text-align: center;
height: 100%;
}

.codrops-header h1 {
margin: 0 auto;
font-weight: 800;
font-size: 3.75em;
line-height: 1;
}

.codrops-header h1 span {
display: block;
font-size: 50%;
font-weight: 400;
padding-top: 0.325em;
}

.codrops-links {
text-transform: uppercase;
font-weight: 700;
font-size: 0.69em;
line-height: 2.2;
padding: 1.61em 5em;
}

.codrops-links a {
display: inline-block;
padding: 0 1em;
text-decoration: none;
letter-spacing: 1px;
}

.codrops-icon:before {
margin: 0 4px;
text-transform: none;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: 'codropsicons';
line-height: 1;
speak: none;
-webkit-font-smoothing: antialiased;
}

.codrops-icon-drop:before {
content: "\e001";
}

.codrops-icon-prev:before {
content: "\e004";
}

/* Demo Buttons Style */
.codrops-demos {
font-size: 1em;
max-width: 1200px;
margin: 3em auto 5em;
padding: 2em 10em 0;
}

.codrops-demos > a {
display: inline-block;
margin: 0.75em;
padding: 1.35em 1.1em;
width: 15em;
background: #fffce1;
outline: none;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 800;
border-radius: 20px/50px;
}

.codrops-demos > a.current-demo {
background: #c94e50;
color: #fffce1;
}

/* Related demos */
.related {
margin-top: 5em;
padding: 0 3em 5em;
}

.related p {
font-size: 1.5em;
font-weight: 700;
}

.related > a {
display: inline-block;
text-align: center;
margin: 20px 10px;
padding: 25px;
border-radius: 35px/200px;
background: #fffce1;
max-width: 100%;
}

.related a img {
max-width: 100%;
opacity: 0.8;
border-radius: 20px/100px;
}

.related a:hover img,
.related a:active img {
opacity: 1;
}

.related a h3 {
margin: 0;
padding: 0.5em 0.75em 0.3em;
max-width: 300px;
text-align: left;
}

body #cdawrap {
top: auto;
bottom: 35px;
right: 35px;
background: #b4bad2;
border: 1px solid rgba(131,135,151,0.6);
}

.demo-wave body #cdawrap {
top: 35px;
right: 35px;
bottom: auto;
}

@media screen and (max-width: 40em) {
body {
font-size: 80%;
}
.codrops-header h1 {
font-size: 2.5em;
}
.codrops-demos {
max-width: 900px;
padding: 2em 2em 0;
}
.related > a {
margin: 20px 0;
}
}

@media screen and (max-width: 25em) {

.codrops-icon {
font-size: 250%;
}

.codrops-icon span {
display: none;
}

}








Cuối là chèn JS:



<script type="text/javascript">
/*!
* classie - class helper functions
* from bonzo https://github.com/ded/bonzo
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
*/

/*jshint browser: true, strict: true, undef: true */
/*global define: false */

( function( window ) {

'use strict';

// class helper functions from bonzo https://github.com/ded/bonzo

function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}

// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;

if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}

function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}

var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};

// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( classie );
} else {
// browser global
window.classie = classie;
}

})( window );
</script>


<script type="text/javascript">
/**
* main.js
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2014, Codrops
* http://www.codrops.com
*/
(function() {

var bodyEl = document.body,
content = document.querySelector( '.content-wrap' ),
openbtn = document.getElementById( 'open-button' ),
closebtn = document.getElementById( 'close-button' ),
isOpen = false;

function init() {
initEvents();
}

function initEvents() {
openbtn.addEventListener( 'click', toggleMenu );
if( closebtn ) {
closebtn.addEventListener( 'click', toggleMenu );
}

// close the menu element if the target it´s not the menu element or one of its descendants..
content.addEventListener( 'click', function(ev) {
var target = ev.target;
if( isOpen && target !== openbtn ) {
toggleMenu();
}
} );
}

function toggleMenu() {
if( isOpen ) {
classie.remove( bodyEl, 'show-menu' );
}
else {
classie.add( bodyEl, 'show-menu' );
}
isOpen = !isOpen;
}

init();

})();
</script>

Code Button Chất
XEM BÀI VIÊT
TOÀN MÀN HÌNH





Chèn code bên dưới vào nơi hiển thị:


<div class="buttons-ctn">
<a href="#" class="button button--left"><span>Trái</span></a>
<a href="#" class="button button--right"><span>Phải</span></a>
</div>
<div class="button__content button__content--left">
<h2>Bạn Chọn Trái!</h2>
<a href="#">Chả Có Gì Ở Đây Hết :)</a>
</div>
<div class="button__content button__content--right">
<h2>Bạn Chọn Phải!</h2>
<a href="#">Chả Có Gì Ở Đây Hết :)</a>
</div>

<main>
<header class="htmleaf-header">
<h1>Chia Sẻ 78</h1>
<div class="htmleaf-links">
</div>
</header>
</main>

<script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
<script>window.jQuery || document.write('<script src="js/jquery-2.1.1.min.js"><\/script>')</script>



Chèn tiếp CSS sau:



.buttons-ctn {
will-change: transform;
position: absolute;
top: 50%;
left: 50%;
margin-left: -140px;
margin-top: -30px;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}

.button {
will-change: transform;
position: relative;
float: left;
display: inline-block;
padding: 20px;
width: 140px;
text-align: center;
line-height: normal;
-webkit-transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.button--left {
background: #141414;
color: white;
}
.button--right {
background: #ebebeb;
color: #141414;
}
.button--active {
cursor: default;
}
.button--active span {
opacity: 0;
}

.button__content {
display: block;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
padding: 60px 20px;
text-align: center;
width: 600px;
visibility: hidden;
opacity: 0;
z-index: 10;
color: white;
}
.button__content--left {
color: white;
}
.button__content--left a {
color: #141414;
background: white;
}
.button__content--right {
color: #141414;
}
.button__content--right a {
color: white;
background: #141414;
}
.button__content--active {
opacity: 1;
visibility: visible;
}
.button__content a {
display: inline-block;
padding: 10px 20px;
}
.button__content h2 {
font-size: 36px;
text-transform: uppercase;
letter-spacing: 3px;
font-weight: 300;
}
@media (max-width: 650px) {
.button__content {
width: 295px;
}
}

main {
color: white;
text-align: center;
}
main h1 {
font-weight: 300;
margin-bottom: 8px;
margin-top: 24px;
}
main p {
margin-top: 0;
}
main p a {
font-size: 20px;
position: absolute;
left: 0;
right: 0;
bottom: 24px;
color: rgba(0, 0, 0, 0.6);
}





Cuối cùng là chèn JS nữa là xong:


<script>
var button = $('.button');
var content = $('.button__content');
var win = $(window);
var expand = function () {
if (button.hasClass('button--active')) {
return false;
} else {
var W = win.width();
var xc = W / 2;
var that = $(this);
var thatWidth = that.innerWidth() / 2;
var thatOffset = that.offset();
var thatIndex = that.index();
var other;
if (!that.next().is('.button')) {
other = that.prev();
} else {
other = that.next();
}
var otherWidth = other.innerWidth() / 2;
var otherOffset = other.offset();
var thatContent = $('.button__content').eq(thatIndex);
var thatContentW = thatContent.innerWidth();
var thatContentH = thatContent.innerHeight();
var thatTransX = xc - thatOffset.left - thatWidth;
var otherTransX = xc - otherOffset.left - otherWidth;
var thatScaleX = thatContentW / that.innerWidth();
var thatScaleY = thatContentH / that.innerHeight();
that.css({
'z-index': '2',
'transform': 'translateX(' + thatTransX + 'px)'
});
other.css({
'z-index': '0',
'opacity': '0',
'transition-delay': '0.05s',
'transform': 'translateX(' + otherTransX + 'px)'
});
that.on('transitionend webkitTransitionEnd', function () {
that.css({ 'transform': 'translateX(' + thatTransX + 'px) scale(' + thatScaleX + ',' + thatScaleY + ')' });
that.addClass('button--active');
thatContent.addClass('button__content--active');
thatContent.css('transition', 'all 1s 0.1s cubic-bezier(0.23, 1, 0.32, 1)');
that.off('transitionend webkitTransitionEnd');
});
return false;
}
};
var hide = function (e) {
var target = $(e.target);
if (target.is(content)) {
return;
} else {
button.removeAttr('style').removeClass('button--active');
content.removeClass('button__content--active').css('transition', 'all 0.2s 0 cubic-bezier(0.23, 1, 0.32, 1)');
}
};
var bindActions = function () {
button.on('click', expand);
win.on('click', hide);
};
var init = function () {
bindActions();
};
init();
</script>

Menu dọc ẩn hiện
XEM BÀI VIÊT
TOÀN MÀN HÌNH




Chèn code dưới vào phần menu:




<nav>
<ul>
<li>Home</li>
<li>About me</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</nav>
<div class="openNav">
<div class="icon"></div>
</div>

<div class="wrapper">
<section>
<h1>Chia Sẻ 78</h1>
</section>
</div>

<script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
<script>window.jQuery || document.write('<script src="js/jquery-2.1.1.min.js"><\/script>')</script>






Tiếp đến chèn css:




.navOpen {
overflow: hidden;
}
.wrapper {
transition-duration: 0.5s;
transition-timing-function: swing;
background-color: white;
width: 100%;
height: 100%;
position: relative;
padding: 100px 40px;
}
.wrapper.open {
transform: translateX(250px) translateY(50px);
-webkit-transform: translateX(250px) translateY(50px);
box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
}
.wrapper section {
max-width: 600px;
margin: 0 auto;
}
.wrapper section h1 {
font-weight: 300;
font-size: 30px;
margin-bottom: 10px;
}
.wrapper section h2 {
font-weight: 300;
font-size: 20px;
margin-bottom: 40px;
}
.wrapper section p {
margin-bottom: 40px;
}
.openNav {
transition-duration: 0.5s;
transition-timing-function: swing;
width: 50px;
height: 50px;
background-color: #14B9FF;
position: fixed;
top: 20px;
left: 20px;
z-index: 9;
}
.openNav:hover {
cursor: pointer;
}
.openNav .icon {
transition-duration: 0.2s;
position: absolute;
width: 30px;
height: 2px;
background-color: white;
top: 24px;
left: 10px;
}
.openNav .icon:before,
.openNav .icon:after {
transition-duration: 0.5s;
background-color: white;
position: absolute;
content: "";
width: 30px;
height: 2px;
left: 0px;
}
.openNav .icon:before {
top: -7px;
}
.openNav .icon:after {
top: 7px;
}
.openNav.open {
transform: translateX(250px) translateY(50px);
-webkit-transform: translateX(250px) translateY(50px);
}
.openNav.open .icon {
background-color: transparent;
}
.openNav.open .icon:before,
.openNav.open .icon:after {
top: 0;
}
.openNav.open .icon:before {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.openNav.open .icon:after {
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
nav {
background-color: #14B9FF;
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
}
nav ul {
width: 250px;
margin-top: 50px;
}
nav ul:hover li {
color: rgba(255, 255, 255, 0.5);
}
nav ul li {
transition-duration: 0.25s;
display: block;
padding: 5px 40px;
color: white;
letter-spacing: 0.02em;
text-align: right;
}
nav ul li:hover {
cursor: pointer;
color: white;
}




Chèn JS cuối cùng là xong:



<script type="text/javascript">

$('.openNav').click(function () {
$('body').toggleClass('navOpen');
$('nav').toggleClass('open');
$('.wrapper').toggleClass('open');
$(this).toggleClass('open');
});
</script>

Menu ngang cực đẹp
XEM BÀI VIÊT
TOÀN MÀN HÌNH



Chèn code vào nơi hiển thị:

<link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

<div id="wrapper">
<div id="toolbar">
<div class="button"></div>
<ul class="icons">
<li><i class="fa fa-home fa-2x" aria-hidden="true"></i></li>
<li><i class="fa fa-user fa-2x" aria-hidden="true"></i></li>
<li><i class="fa fa-star fa-2x" aria-hidden="true"></i></li>
<li><i class="fa fa-file-text-o fa-2x" aria-hidden="true"></i></li>
<li><i class="fa fa-paper-plane-o fa-2x" aria-hidden="true"></i></li>
</ul>
</div>
</div>
</div>
<script src="http://cdn.bootcss.com/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>




Thêm CSS:

#wrapper {
text-align:center;
font-family: 'Lato', sans-serif;
text-transform:uppercase;
}


#toolbar {
width:100%;
max-width:670px;
min-width:550px;
margin: 70px auto;
}

.button {
width:70px;
height:70px;
border-radius:50%;
background-color:#3AB09E;
color:#ffffff;
text-align:center;
font-size:3.5em;
position:relative;
left:50%;
margin-left:-35px;
z-index:1;
}

.button,.icons{
-webkit-transition: -webkit-all 1s cubic-bezier(.87,-.41,.19,1.44);
transition: all 1s cubic-bezier(.87,-.41,.19,1.44);
}

.button:after {
content:"+";
}

.button.active {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
left:60px;
}


.icons {
width:0%;
overflow:hidden;
height:36px;
list-style:none;
padding:16px 10px 10px 50px;
background-color:#ffffff;
box-shadow: 1px 1px 1px 1px #DCDCDC;
margin:-68px 0 0 45%;
border-radius: 2em;
}

.icons.open {
width:80%;
margin:-68px 0 0 5%;
overflow:hidden;
}

.icons li {
display: none;
width:10%;
color:#3AB09E;
}

.icons.open li {
width:16%;
display: inline-block;
}




Cuối Cùng Thêm JS Là oke: