styles.css

Aus Infopedia
Wechseln zu:Navigation, Suche
Zeile 1: Zeile 1:
.flip-card {
+
.flip-card {
   background-color: transparent;
+
   perspective: 40rem;
 +
  transition: z-index, transform 0.2s;
 +
  transition-delay: 0.7s, 0s;
 +
  z-index: 0;
 +
  padding: 10px;
 +
  text-decoration: none;
 +
}
 +
 
 +
.flip-card-inner {
 +
  display: flex;
 +
  transform-style: preserve-3d;
 +
  transition: transform 0.5s;
 +
  transform-origin: center right;
 +
  border-radius: 0.25rem;
 +
  flex: 1;
 
   width: 250px;
 
   width: 250px;
 
   height: 250px;
 
   height: 250px;
   perspective: 1000px;
+
   margin: auto;
 +
  text-align: center;
 +
  box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04), 0 2px 2px rgba(0, 0, 0, 0.04), 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 8px rgba(0, 0, 0, 0.04), 0 16px 16px rgba(0, 0, 0, 0.04);
 +
}
 +
 
 +
.flip-card:hover {
 +
  transition-delay: 0s;
 +
  z-index: 1;
 
}
 
}
  
.flip-card-inner {
+
.flip-card:active {
  position: relative;
+
   transform: scale(0.975);
  width: 100%;
 
  height: 100%;
 
  text-align: center;
 
  transition: transform 0.6s;
 
   transform-style: preserve-3d;
 
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
 
 
}
 
}
  
.flip-card:hover .flip-card-inner {
+
.flip-card:hover .flip-card-inner, .flip-card:focus .flip-card-inner {
   transform: rotateY(-180deg);
+
   transform: translateX(-100) rotateY(-180deg);
 
}
 
}
  
.flip-card-front, .flip-card-back {
+
.flip-card-front, .flip-card-back {
  position: absolute;
 
  width: 100%;
 
  height: 100%;
 
 
   backface-visibility: hidden;
 
   backface-visibility: hidden;
 +
  min-width: 100%;
 +
  display: flex;
 +
  align-items: center;
 +
  background-color: white;
 +
  box-sizing: border-box;
 +
  border-radius: 0.25rem;
 
}
 
}
  
Zeile 32: Zeile 50:
 
}
 
}
  
.flip-card-back {
+
.flip-card-back {
 
   background-color: #818A91;
 
   background-color: #818A91;
 
   color: white;
 
   color: white;
   transform: rotateY(-180deg);
+
   transform: rotateY(-180deg) translateX(100);
 
}
 
}

Version vom 4. März 2021, 10:36 Uhr

 .flip-card {
  perspective: 40rem;
  transition: z-index, transform 0.2s;
  transition-delay: 0.7s, 0s;
  z-index: 0;
  padding: 10px;
  text-decoration: none;
}

 .flip-card-inner {
  display: flex;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  transform-origin: center right;
  border-radius: 0.25rem;
  flex: 1;
  width: 250px;
  height: 250px;
  margin: auto;
  text-align: center;
  box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04), 0 2px 2px rgba(0, 0, 0, 0.04), 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 8px rgba(0, 0, 0, 0.04), 0 16px 16px rgba(0, 0, 0, 0.04);
}

 .flip-card:hover {
  transition-delay: 0s;
  z-index: 1;
}

 .flip-card:active {
  transform: scale(0.975);
}

 .flip-card:hover .flip-card-inner, .flip-card:focus .flip-card-inner {
  transform: translateX(-100) rotateY(-180deg);
}

 .flip-card-front, .flip-card-back {
  backface-visibility: hidden;
  min-width: 100%;
  display: flex;
  align-items: center;
  background-color: white;
  box-sizing: border-box;
  border-radius: 0.25rem;
}

.flip-card-front {
  background-color: #bbb;
  color: black;
}

 .flip-card-back {
  background-color: #818A91;
  color: white;
  transform: rotateY(-180deg) translateX(100);
}