Code Hiệu Ứng Hộp Search Tìm Kiếm Đẹp Cho Blogspot



Demo

Đầu tiền Chèn đoạn code hiển thị khung search dưới đây:
 <label class="input-container closed">
<div class="shadow"></div>
<div class="center">
<input type="text" class="input" placeholder="Search">
</div>
<div class="sticks"></div>
</label>


    <script>
      document.querySelector('.sticks').addEventListener('click', function (e) {
e.stopPropagation();
e.preventDefault();
//document.querySelector('.input').value = '';
document.querySelector('.input-container').blur();
});
      //# sourceURL=pen.js
    </script>

Tiếp đến là chèn đoạn css nữa là xong:

body {
--height: 50;
--width: 300;
--border: 5;
--speed: 0.4;
--ease: cubic-bezier(.85,.01,.4,.97);
--color-bk: #6CD4FF;
background: var(--color-bk);
display: flex;
align-items: center;
justify-content: center;
transition-property: background;
transition-duration: calc(var(--speed) * 1s);
transition-timing-function: var(--ease);
}
body:focus-within {
--speed: 0.7;
background-color: #63C1E8;
}

::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.5);
}

:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.5);
}

::-ms-input-placeholder {
color: rgba(255, 255, 255, 0.5);
}

::placeholder {
color: rgba(255, 255, 255, 0.5);
}

:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.5);
}

::-ms-input-placeholder {
color: rgba(255, 255, 255, 0.5);
}

.input-container {
width: calc(var(--width) * 1px);
height: calc(var(--height) * 1px);
position: relative;
cursor: pointer;
-webkit-transform: rotate(12deg) scale(0.7);
transform: rotate(12deg) scale(0.7);
transition-property: opacity, -webkit-transform;
transition-property: opacity, transform;
transition-property: opacity, transform, -webkit-transform;
transition-duration: calc(var(--speed) * 1s);
transition-timing-function: var(--ease);
}
.input-container .center {
border: calc(var(--border) * 1px) solid white;
border-left: none;
border-right: none;
width: 100%;
height: calc(100% - var(--border) * 2px);
-webkit-transform: scalex(0);
transform: scalex(0);
transition: inherit;
background-color: var(--color-bk);
}
.input-container input {
transition: inherit;
width: calc(100% - var(--height));
height: 100%;
border: 0;
outline: 0;
color: white;
background: transparent;
font-size: 1.3rem;
opacity: 0;
padding: 0;
margin: 0;
}
.input-container .shadow {
position: absolute;
width: 100%;
height: 100%;
border-radius: 2em;
top: 0;
left: 0;
box-shadow: 0px 10px 50px 0px rgba(0, 0, 0, 0.1);
transition: inherit;
-webkit-transform: scalex(0) translateY(-10px);
transform: scalex(0) translateY(-10px);
opacity: 0;
}
.input-container:after, .input-container:before {
z-index: 1;
content: '';
transition: inherit;
width: calc((var(--height) * 0.5px) - (var(--border) * 1px));
height: calc((var(--height) * 1px) - (var(--border) * 2px));
display: block;
top: 0;
border-color: white;
position: absolute;
background-color: var(--color-bk);
border: calc(var(--border) * 1px) solid white;
}
.input-container:before {
right: 100%;
border-radius: 2em 0 0 2em;
border-right: none;
-webkit-transform: translateX(calc(var(--width) * 0.5px));
transform: translateX(calc(var(--width) * 0.5px));
}
.input-container:after {
left: 100%;
border-radius: 0 2em 2em 0;
border-left: none;
-webkit-transform: translateX(calc(var(--width) * -0.5px));
transform: translateX(calc(var(--width) * -0.5px));
}
.input-container .sticks {
position: absolute;
height: calc(var(--height) * 0.5px);
width: 1px;
bottom: 0;
right: 0;
transition: inherit;
transition-duration: calc(var(--speed) * 1.15s);
-webkit-transform: translateX(calc((var(--width) - var(--height)) * -0.53px)) rotate(-45deg);
transform: translateX(calc((var(--width) - var(--height)) * -0.53px)) rotate(-45deg);
z-index: 2;
}
.input-container .sticks:before, .input-container .sticks:after {
transition: -webkit-transform calc(var(--speed) * 1s) var(--ease);
transition: transform calc(var(--speed) * 1s) var(--ease);
transition: transform calc(var(--speed) * 1s) var(--ease), -webkit-transform calc(var(--speed) * 1s) var(--ease);
height: calc(var(--height) * 0.5px);
width: calc(var(--border) * 1px);
position: absolute;
content: '';
background-color: white;
left: calc(var(--border) * -0.5px);
bottom: calc(var(--height) * -0.25px);
}
.input-container:focus-within {
-webkit-transform: rotate(0deg) translatey(-10px);
transform: rotate(0deg) translatey(-10px);
}
.input-container:focus-within .center {
-webkit-transform: scalex(1);
transform: scalex(1);
}
.input-container:focus-within .shadow {
-webkit-transform: scalex(1) translateY(0px);
transform: scalex(1) translateY(0px);
opacity: 1;
}
.input-container:focus-within input {
opacity: 1;
}
.input-container:focus-within:before {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.input-container:focus-within:after {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.input-container:focus-within .sticks {
transition-duration: calc(var(--speed) * 1s);
-webkit-transform: translateX(calc(var(--height) * -0.1px)) translateY(0) rotate(180deg);
transform: translateX(calc(var(--height) * -0.1px)) translateY(0) rotate(180deg);
}
.input-container:focus-within .sticks:before {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.input-container:focus-within .sticks:after {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}

CÓ THỂ BẠN ĐANG TÌM
  • Tạo dropdown label (nhãn) cho blogspot
    Tạo dropdown label (nhãn) cho blogspot
    22/05/2018 - 0 bình luận
    Nhãn (Label, Tags, Categories...) là một thành phần rất quan trọng khi bạn sử dụng nền tảng blogger. Nhãn giúp …
  • CSS Simple bảng giá tác thiết kế
    CSS Simple bảng giá tác thiết kế
    26/05/2018 - 0 bình luận
    DemoĐầu tiền các bạn chèn đoạn css dưới vào:<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap…
  • Tạo khung chứa code có nút copy to clipboard cho blogspot
    Tạo khung chứa code có nút copy to clipboard cho blogspot
    24/05/2018 - 0 bình luận
    Để làm được điều đó thì bạn cần các công cụ sauFontawesome để cho nút copy thêm sinh độngJQuery: cái này thì hầ…
  • Nâng cấp Blogger Layout, Default Widget và Skin lên phiên bản mới
    Nâng cấp Blogger Layout, Default Widget và Skin lên phiên bản mới
    25/05/2018 - 0 bình luận
    Vừa qua Google có tung ra gói theme blogger mới khá đẹp mắt với chức năng tùy chỉnh cao hơn. Tuy nhiên với hầu …
  • Code Slider Post Làm Trang Chủ
    Code Slider Post Làm Trang Chủ
    25/05/2018 - 0 bình luận
    DemoĐầu tiên chèn đoạn css dưới:<link href="css/style.css" rel="stylesheet" type="text/css"></link>…
  • Code Hiệu Ứng Hộp Search Tìm Kiếm Đẹp Cho Blogspot
    Code Hiệu Ứng Hộp Search Tìm Kiếm Đẹp Cho Blogspot
    15/05/2018 - 0 bình luận
    DemoĐầu tiền Chèn đoạn code hiển thị khung search dưới đây: <label class="input-container closed"> &…
  • Code Nút Social share cho blogspot Blogger
    Code Nút Social share cho blogspot Blogger
    21/05/2018 - 0 bình luận
    Button chia sẻ bài viết lên các trang mạng xã hội là 1 thành phần không thể thiếu với mỗi template blogger. Việ…
  • Hiệu ứng Hover cho img Chất cho blogspot
    Hiệu ứng Hover cho img Chất cho blogspot
    14/05/2018 - 0 bình luận
    DemoĐầu tiên bạn kiểm tra blog bạn có link css này chưa, chưa có thì chèn thêm vào link css dưới: <link href…
  • Template Blogspot Giống Zing Mp3 2018
    Template Blogspot Giống Zing Mp3 2018
    29/10/2018 - 0 bình luận
    Demo   Liên hệ#Giao diện nghe nhạc, #Template blogspot nhạc, Template nhạc.
  • Thay đổi Avatar thành viên nào đó của comment Blogger
    Thay đổi Avatar thành viên nào đó của comment Blogger
    20/05/2018 - 0 bình luận
    Khi bạn sử dụng hệ thống bình luận mà blogger cung cấp, nếu như hồ sơ người dùng chưa có avatar thì blogger sẽ …
  • Thẻ điều kiện blogger 2018
    Thẻ điều kiện blogger 2018
    18/05/2018 - 0 bình luận
    Dưới đây là danh sách thẻ cũ và thẻ mới được cập nhật và cách sử dụngPhần I. Các thẻ điều kiện1. Trang chủ (Hom…
  • Hiệu ứng Canvas
    Hiệu ứng Canvas
    30/11/2018 - 0 bình luận
    DemoĐầu tiên chèn CSS:html, body { margin: 0px; width: 100%; height: 100%; overflow: hidden; background: #000; …