CSS
语言:
CSSSCSS
确定
.code-button {
display: inline-block;
font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Monaco", "Consolas", monospace;
margin: 1em;
background: #434d5a;
border: none;
padding: 1em 0;
color: white;
text-align: center;
text-decoration: none;
width: 9em;
-webkit-transition: all 0.2s ease, background-color 0.2s ease 0.1s, box-shadow 0.2s ease 0.1s;
transition: all 0.2s ease, background-color 0.2s ease 0.1s, box-shadow 0.2s ease 0.1s;
}
.code-button__bracket,
.code-button__text,
.code-button__code {
display: inline-block;
margin-right: -3px;
text-align: center;
width: 0.5em;
-webkit-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.code-button__bracket {
font-weight: normal;
}
.code-button__text {
opacity: 0;
position: absolute;
-webkit-transition: color 0.2s ease 0.1s;
transition: color 0.2s ease 0.1s;
}
.code-button:hover {
color: #434d5a;
background-color: #aaffa9;
box-shadow: inset 15px 5px 70px -10px #aaffa9, inset -15px -5px 70px -10px #11ffbd;
padding: 1em 0;
-webkit-transition: all 0.2s ease, color 0.2s ease 0.05s;
transition: all 0.2s ease, color 0.2s ease 0.05s;
}
.code-button:hover .code-button__code,
.code-button:hover .code-button__text {
width: 2em;
}
.code-button:hover .code-button__code {
opacity: 0;
position: absolute;
}
.code-button:hover .code-button__text {
opacity: 1;
position: static;
-webkit-transition: all 0.2s ease, color 0.2s ease 0s;
transition: all 0.2s ease, color 0.2s ease 0s;
}
.code-button:hover .code-button__bracket {
-webkit-transition: all 0.2s ease, color 0.2s ease 0s;
transition: all 0.2s ease, color 0.2s ease 0s;
}
.code-button--html:hover {
background-color: #fc8f71;
box-shadow: inset 15px 15px 90px -20px #fc8f71, inset -15px -5px 80px -10px #fcdcab;
}
.code-button--js:hover {
background-color: #87e1ed;
box-shadow: inset 15px 15px 90px -20px #7996d1, inset -15px -5px 80px -10px #87e1ed;
}
body {
text-align: center;
padding: 10px;
background: #fffaf7;
}
h1 {
color: #2d343d;
font-family: "Fredoka One";
text-transform: uppercase;
font-size: 4em;
line-height: 0.7em;
}
h1 small {
opacity: 0.7;
font-family: "Comfortaa";
text-transform: none;
font-size: 0.7em;
line-height: 0.5em;
}