In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use CSS3 to implement input input box animation style library. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Html Code:
Clickeveryinput.
Name
Phone
Age
Height
Weight
Class
Element
Move
English
Burger
Wallet
CreditCard
Expires
SecurityCode
Knockknock
Max
Maxedoutcard;)
Artist
Song
Eyes
State
Planet
Galaxy
Css Code:
@ import "compass/css3"
@ importurl (https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
Box-sizing:border-box
}
Html
Body {
Overflow-x:hidden
Font-family: "OpenSans", sans-serif
Font-weight:300
Color:#fff
Background:#efefef
}
@ mixinepic-sides () {/ / https://codepen.io/MichaelArestad/pen/qltuk
Position:relative
Z-index:1
&: before {
Position:absolute
Content: ""
Display:block
Top:0
Left:-5000px
Height:100%
Width:15000px
Z-index:-1
@ content
}
}
.row {
Max-width:800px
Margin:0auto
Padding:60px30px
Background:#032429
@ includeepic-sides () {background:inherit;}
Text-align:center
&: first-child {
Padding:40px30px
}
&: nth-child (2)
&: nth-child (8)
&: nth-child (10) {
Background:#134A46
}
&: nth-child (3)
&: nth-child (7) {
Background:#377D6A
}
&: nth-child (4)
&: nth-child (6) {
Background:#7AB893
}
&: nth-child (5) {
Background:#B2E3AF
}
Span {
Position:relative
Display:inline-block
Margin:30px10px
}
}
. basic-slide {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:70px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Background:#7AB893
Transition:all.3sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
}
}
. basic-slide:focus
. basic-slide:active {
Color:#377D6A
Text-indent:0
Background:#fff
Border-top-left-radius:0
Border-bottom-left-radius:0
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Transform:translateX (- 100%)
}
}
. clean-slide {
Position:relative
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:60px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Transform:translateX (0)
Top:0
Left:0
Bottom:0
Padding:13px15px
Font-size:11px
Font-weight:700
Text-transform:uppercase
Color:#032429
Text-align:left
Text-shadow:01px0rgba (255pr. 255pr. 4)
Transition:all.3sease-in-out,color.3sease-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Overflow:hidden
&: after {
Content: ""
Position:absolute
Top:0
Right:100%
Bottom:0
Width:100%
Background:#7AB893
Z-index:-1
Transform:translate (0)
Transition:all.3sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
}
}
}
. clean-slide:focus
. clean-slide:active {
Color:#377D6A
Text-indent:0
Background:#fff
Border-top-left-radius:0
Border-bottom-left-radius:0
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Color:#fff
Text-shadow:01px0rgba (19, 74, 70, 4)
Transform:translateX (- 100%)
&: after {
Transform:translate (100%)
}
}
}
.gate {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:65px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Background:#7AB893
Transition:all.4sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Transform-origin:leftbottom
Z-index:99
&: before
&: after {
Content: ""
Position:absolute
Top:0
Right:0
Bottom:0
Left:0
Border-radius:3px
Background:#377D6A
Transform-origin:leftbottom
Transition:all.4sease-in-out
Pointer-events:none
Z-index:-1
}
&: before {
Background:rgba (3pr 36pr 41pr .2)
Z-index:-2
Right:20%
}
}
}
Span:nth-child (2) .gate {
Text-indent:85px
}
Span:nth-child (2). Gate:focus
Span:nth-child (2) .gate: active {
Text-indent:0
}
.gate: focus
.gate: active {
Color:#377D6A
Text-indent:0
Background:#fff
Border-top-right-radius:3px
Border-bottom-right-radius:3px
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Transform:rotate (- 66deg)
Border-radius:3px
&: before {
Transform:rotate (10deg)
}
}
}
.skinny {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:75px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Transform:translateX (0)
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Transition:all.3sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Overflow:hidden
&: before
&: after {
Content: ""
Position:absolute
Right:0
Left:0
Z-index:-1
Transition:all.3sease-in-out
}
&: before {
/ / Skinnybithere
Top:5px
Bottom:5px
Background:#377D6A;//changethisto#134A46
Border-top-left-radius:3px
Border-bottom-left-radius:3px
}
&: after {
Top:0
Bottom:0
Background:#377D6A
}
}
}
.skinny: focus
.skinny: active {
Color:#377D6A
Text-indent:0
Background:#fff
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Transform:translateX (- 100%)
&: after {
Transform:translateX (100%)
}
}
}
. slide-up {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:80px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Transform:translateX (0)
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Transition:all.3sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Overflow:hidden
&: before
&: after {
Content: ""
Position:absolute
Right:0
Left:0
Z-index:-1
Transition:all.3sease-in-out
}
&: before {
/ / Skinnybithere
Top:6px
Left:5px
Right:5px
Bottom:6px
Background:#377D6A;//changethisto#134A46
}
&: after {
Top:0
Bottom:0
Background:#377D6A
}
}
}
Span:nth-child (1). Slide-up {
Text-indent:105px
}
Span:nth-child (3). Slide-up
Text-indent:125px
}
Span:nth-child (1). Slide-up:focus
Span:nth-child (1). Slide-up:active
Span:nth-child (3). Slide-up:focus
Span:nth-child (3). Slide-up:active
Text-indent:0
}
. slide-up:focus
. slide-up:active {
Color:#377D6A
Text-indent:0
Background:#fff
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Transform:translateY (- 100%)
&: before {
Border-radius:5px
}
&: after {
Transform:translateY (100%)
}
}
}
. card-slide {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:115px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:block
Position:absolute
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Background:#7AB893
Transition:all.3sease-in-out
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Transform-origin:rightcenter
Transform:perspective (300px) scaleX (1) rotateY (0deg)
}
}
Span:nth-child (2). Card-slide {
Text-indent:55px
}
Span:nth-child (3). Card-slide
Text-indent:150px
}
Span:nth-child (2). Card-slide:focus
Span:nth-child (2). Card-slide:active
Span:nth-child (3). Card-slide:focus
Span:nth-child (3). Card-slide:active
Text-indent:0
}
. card-slide:focus
. card-slide:active {
Color:#377D6A
Text-indent:0
Background:#fff
Border-top-left-radius:0
Border-bottom-left-radius:0
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Transform:perspective (600px) translateX (- 100%) rotateY (80deg)
}
}
.swing {
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:60px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Top:0
Left:0
Padding:10px15px
Text-shadow:01px0rgba (19, 74, 70, 4)
Background:#7AB893
Border-top-left-radius:3px
Border-bottom-left-radius:3px
Transform-origin:2px2px
Transform:rotate (0)
/ / Thereshouldbeabetterway
Animation:swing-back.4s1ease-in-out
}
}
@ keyframesswing {
0% {
Transform:rotate (0)
}
20% {
Transform:rotate (116deg)
}
40% {
Transform:rotate (60deg)
}
60% {
Transform:rotate (98deg)
}
80% {
Transform:rotate (76deg)
}
100% {
Transform:rotate (82deg)
}
}
@ keyframesswing-back {
0% {
Transform:rotate (82deg)
}
100% {
Transform:rotate (0)
}
}
.swing: focus
.swing: active {
Color:#377D6A
Text-indent:0
Background:#fff
Border-top-left-radius:0
Border-bottom-left-radius:0
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Animation:swing1.4s1ease-in-out
Transform:rotate (82deg)
}
}
.balloon {
/ / Assuggestedby https://twitter.com/dbox/status/365888496486985728
Display:inline-block
Width:215px
Padding:10px010px15px
Font-family: "OpenSans", sans
Font-weight:400
Color:#377D6A
Background:#efefef
Border:0
Border-radius:3px
Outline:0
Text-indent:60px;//Arbitrary.
Transition:all.3sease-in-out
&::-webkit-input-placeholder {
Color:#efefef
Text-indent:0
Font-weight:300
}
+ label {
Display:inline-block
Position:absolute
Top:8px
Left:0
Bottom:8px
Padding:5px15px
Color:#032429
Font-size:11px
Font-weight:700
Text-transform:uppercase
Text-shadow:01px0rgba (19, 74, 70, 0)
Transition:all.3sease-in-out
Border-radius:3px
Background:rgba (122, 184, 147, 0)
&: after {
Position:absolute
Content: ""
Width:0
Height:0
Top:100%
Left:50%
Margin-left:-3px
Border-left:3pxsolidtransparent
Border-right:3pxsolidtransparent
Border-top:3pxsolidrgba (122, 184, 147, 0)
Transition:all.3sease-in-out
}
}
}
.balloon: focus
.balloon: active {
Color:#377D6A
Text-indent:0
Background:#fff
&::-webkit-input-placeholder {
Color:#aaa
}
+ label {
Color:#fff
Text-shadow:01px0rgba (19, 74, 70, 4)
Background:rgba (122, 184, 147, 1)
Transform:translateY (- 40px)
&: after {
Border-top:4pxsolidrgba (122, 184, 147, 1)
}
}
}
Thank you for reading! On "how to use CSS3 to achieve input input box animation style library" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.