1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-23 19:36:53 +00:00

enable hover for card animation

This commit is contained in:
devfake 2015-06-23 13:31:37 +02:00
parent d1011e8c54
commit 4bee44f11d

View File

@ -3,45 +3,56 @@
float: left; float: left;
border-radius: 12px; border-radius: 12px;
position: relative; position: relative;
z-index: 10;; z-index: 10;
top: 5px;
left: 5px;
} }
.bla { .bla {
padding: 4px;
float: left;
border-radius: 14px; border-radius: 14px;
margin: 100px; width: 100%;
position: relative; height: 100%;
position: absolute;
opacity: 0;
}
.card-wrap:hover .bla {
box-shadow: 0 0 2px 0 orange; box-shadow: 0 0 2px 0 orange;
opacity: 1;
} }
.shadow { .shadow {
border-radius: 35%; border-radius: 35%;
box-shadow: 0 0 15px 14px #ffa500; box-shadow: 0 0 15px 14px #ffa500;
content: ""; content: "";
height: calc(100% - 40px); height: calc(100% - 50px);
left: 10px; left: 15px;
position: absolute; position: absolute;
width: calc(100% - 20px); width: calc(100% - 22px);
z-index: 1; z-index: 1;
top: 20px; top: 30px;
transition: all 0.3s ease-in-out 0s; transition: all 0.3s ease-in-out 0s;
opacity: 0;
}
.card-wrap:hover .shadow {
-webkit-animation: Shadow 4s ease-in-out infinite; -webkit-animation: Shadow 4s ease-in-out infinite;
-moz-animation: Shadow 4s ease-in-out infinite; -moz-animation: Shadow 4s ease-in-out infinite;
animation: Shadow 4s ease-in-out infinite; animation: Shadow 4s ease-in-out infinite;
} }
.ani { .ani {
background: linear-gradient(2deg, #000, #000, #000, #000);;
transition: all .05s ease-in-out 0s;
}
.card-wrap .ani {
background: linear-gradient(2deg, #ffa500, #ffd68b, #ffa500, #ffa500); background: linear-gradient(2deg, #ffa500, #ffd68b, #ffa500, #ffa500);
background-size: 800% 800%; background-size: 800% 800%;
-webkit-animation: AnimationName 3s ease infinite; -webkit-animation: AnimationName 3s ease infinite;
-moz-animation: AnimationName 3s ease infinite; -moz-animation: AnimationName 3s ease infinite;
animation: AnimationName 3s ease infinite; animation: AnimationName 3s ease infinite;
} }
@-webkit-keyframes Shadow { @-webkit-keyframes Shadow {
@ -96,14 +107,19 @@
} }
.overlay-card { .overlay-card {
background: linear-gradient(2deg, rgba(255,255,255,.05), rgba(255,255,255,.3), rgba(255,255,255,.1)); background: linear-gradient(2deg, rgba(255,255,255,.03), rgba(255,255,255,.2), rgba(255,255,255,.05));
background-size: 800% 800%; background-size: 800% 800%;
position: absolute; position: absolute;
z-index: 20; z-index: 20;
width: calc(100% - 5px); width: calc(100% - 5px);
height: calc(100% - 5px); height: calc(100% - 5px);
border-radius: 12px; border-radius: 12px;
opacity: 0;
cursor: pointer;
}
.card-wrap:hover .overlay-card {
opacity: 1;
-webkit-animation: AnimationName 10s ease infinite; -webkit-animation: AnimationName 10s ease infinite;
-moz-animation: AnimationName 10s ease infinite; -moz-animation: AnimationName 10s ease infinite;
animation: AnimationName 10s ease infinite; animation: AnimationName 10s ease infinite;
@ -124,9 +140,18 @@
50%{background-position:50% 100%} 50%{background-position:50% 100%}
100%{background-position:51% 0%} 100%{background-position:51% 0%}
} }
.card-wrap {
float: left;
width: 160px;
height: 294px;
position: relative;
padding: 4px;
}
</style> </style>
<div class="bla ani"> <div class="card-wrap">
<div class="bla ani"></div>
<img src="http://80.240.132.120/gwent/assets/cards/ballista1.png" class="card" width="150" height="auto"> <img src="http://80.240.132.120/gwent/assets/cards/ballista1.png" class="card" width="150" height="auto">
<div class="shadow"></div> <div class="shadow"></div>
<div class="overlay-card"></div> <div class="overlay-card"></div>