【動態(tài)按鈕】
//vue
<el-button :class="{'night': runModelText === '運行模式'}" type="primary" icon="el-icon-coordinate" size="mini" >
<span></span>
<span></span>
<span></span>
<span></span>
<b @click="runModel" >{{ runModelText }} </b>
</el-button>
//樣式
.night{
position: relative!important;
/* color: rgb(18, 190, 243); */
/* letter-spacing: 12px; */
text-align: center;
/* background-color: rgb(31, 49, 133); */
/* background-image: linear-gradient(90deg, rgb(40, 62, 161) 50%,rgb(31, 49, 133) 50% ); */
/* text-transform: uppercase; */
user-select: none;
text-decoration: none;
overflow: hidden;
box-shadow: inset 0 0 10px rgb(14, 84, 105),
0 0 5px rgb(9, 208, 235);
transition: all 0.5s;
}
.night:hover{
text-shadow: 0 0 5px rgb(18, 190, 243),
0 0 8px rgb(18, 190, 243),
0 0 10px rgb(18, 190, 243);
/* background-image: linear-gradient(90deg, rgb(25, 38, 99) 50%,rgb(13, 22, 58) 50% ); */
box-shadow: inset 0 0 10px rgb(14, 20, 105),
0 0 5px rgb(9, 208, 235),
0 0 10px rgb(9, 208, 235);
}
.night span{
position: absolute!important;
}
.night span:nth-child(1){
top: 0;
left: 0;
width: 100%;
height: 2px;
background-image: linear-gradient(to right, transparent , rgb(132, 230, 255));
animation: button_move1 2s linear infinite;
}
@keyframes button_move1 {
0%{
transform: translateX(-100%);
}
100%{
transform: translateX(100%);
}
}
.night span:nth-child(2){
top: 0;
right: 0;
width: 2px;
height: 100%;
transform: translateY(-100%);
background-image: linear-gradient(to bottom, transparent , rgb(132, 230, 255) );
animation: button_move2 2s linear infinite;
animation-delay: 1s;
}
@keyframes button_move2 {
100%{
transform: translateY(100%);
}
}
.night span:nth-child(3){
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-image: linear-gradient(to left, transparent , rgb(132, 230, 255) );
animation: button_move3 2s linear infinite;
}
@keyframes button_move3 {
0%{
transform: translateX(100%);
}
100%{
transform: translateX(-100%);
}
}
.night span:nth-child(4){
top: 0;
left: 0;
width: 2px;
height: 100%;
transform: translateY(100%);
background-image: linear-gradient(to top, transparent , rgb(132, 230, 255) );
animation: move4 2s linear infinite;
animation-delay: 1s;
}
@keyframes move4 {
100%{
transform: translateY(-100%);
}
}
【斜角按鈕】
//html
//斜角按鈕
<a class="title_button">信號機(jī)</a>
<a class="title_button_on">POM4</a>
//css
//斜角按鈕
.title_button,.title_button_on{
position: relative;
display: inline-block;
margin: 0 1px;
padding: 0 15px;
color: white;
font-size: 14px;
}
.title_button::before{
background: #06479e;//默認(rèn)背景色
z-index: -1;//避免背景把按鈕擋住
position: absolute;
content: '';
top: 0;left: 0;right: 0;bottom: 0;
transform: skewX(27deg);
}
.title_button_on::before,.title_button:hover::before{
background: #035fdb;//鼠標(biāo)移過及選中背景色
z-index: -1;//避免背景把按鈕擋住
position: absolute;
content: '';
top: 0;left: 0;right: 0;bottom: 0;
transform: skewX(27deg);
}
開始是有效果的,后來發(fā)現(xiàn)失效了,所以放棄了偽類的寫法妖啥,改為下面寫法
//html
<span class="title_button" ><b></b><a >信號機(jī)</a></span>
<span class="title_button_on" ><b></b><a >INOM</a></span>
//css
//斜角按鈕
.title_button,.title_button_on{
position: relative;
display: inline-block;
margin: 0 1px;
padding: 0 15px;
color: white;
font-size: 14px;
cursor: pointer;
height: 23px;
}
.title_button a,.title_button_on a{
z-index: 2;
position: relative;
}
.title_button b{
width:100%;
display: block;
background: #06479e;
z-index: 1;
position: absolute;
top: 0;left: 0;right: 0;bottom: 0;
transform: skewX(27deg);
}
.title_button_on b,.title_button:hover b{
background: #035fdb;
z-index: 1;
position: absolute;
top: 0;left: 0;right: 0;bottom: 0;
transform: skewX(27deg);
}
【常用表格樣式】
<table class="mytable">
<tr>
<th >控制組 </th>
<th >最大采樣 </th>
<th>最大緩存空間 </th>
<th>所控通道</th>
</tr>
<tr>
<td >組1</td>
<td>4444</td>
<td>5676575</td>
<td>89098</td>
</tr>
</table>
表格樣式
.mytable
{
border-radius: 20px;
width: 100%;
border-collapse: collapse;
margin: 0 auto;
text-align: center;
}
.mytable td, .mytable th
{
border: 1px solid #5f6f9c;
color: #fff;
padding: 10px;
}
.mytable th
{
background-color: #4a5986;
color: #93a2cd;
}
.mytable tr:nth-child(odd)
{
background: #445177;
}
.mytable tr:nth-child(even)
{
background: #445177;
}