styles.css

Aus Infopedia
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of t…“)
 
Zeile 1: Zeile 1:
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
+
.flipcard:hover .flipcard-body, .flipcard:focus .flipcard-body {
.flip-card {
+
transform: rotateY(-180deg);
  background-color: transparent;
 
  width: 300px;
 
  height: 200px;
 
  border: 1px solid #f1f1f1;
 
  perspective: 1000px; /* Remove this if you don't want the 3D effect */
 
 
}
 
}
  
/* This container is needed to position the front and back side */
+
.flipcard-back {
.flip-card-inner {
+
transform: rotateY(-180deg);
  position: relative;
+
 
  width: 100%;
+
}
  height: 100%;
+
 
  text-align: center;
+
.flipcard {
  transition: transform 0.8s;
+
perspective: 40rem;
  transform-style: preserve-3d;
+
transition: z-index, transform 0.2s;
 +
transition-delay: 0.7s, 0s;
 +
z-index: 0;
 +
  padding: 10px;
 +
  text-decoration: none;
 +
}
 +
 
 +
.flipcard:hover {
 +
transition-delay: 0s;
 +
z-index: 1;
 
}
 
}
  
/* Do an horizontal flip when you move the mouse over the flip box container */
+
.flipcard:active {
.flip-card:hover .flip-card-inner {
+
transform: scale(0.975);
  transform: rotateY(180deg);
 
 
}
 
}
  
/* Position the front and back side */
+
.flipcard-body {
.flip-card-front, .flip-card-back {
+
display: flex;
  position: absolute;
+
transform-style: preserve-3d;
  width: 100%;
+
transition: 0.7s transform;
  height: 100%;
+
border-radius: 0.25rem;
  backface-visibility: hidden;
+
flex: 1;
 +
  width: 250px;
 +
  height: 250px;
 +
  margin: auto;
 
}
 
}
  
/* Style the front side (fallback if image is missing) */
+
.flipcard-front, .flipcard-back {
.flip-card-front {
+
backface-visibility: hidden;
  background-color: #bbb;
+
min-width: 100%;
  color: black;
+
display: flex;
 +
align-items: center;
 +
background-color: white;
 +
box-sizing: border-box;
 +
border-radius: 0.25rem;
 
}
 
}
  
/* Style the back side */
+
.shadow, .flipcard-front, .flipcard-back {
.flip-card-back {
+
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);
  background-color: dodgerblue;
 
  color: white;
 
  transform: rotateY(180deg);
 
 
}
 
}

Version vom 3. März 2021, 21:54 Uhr

 .flipcard:hover .flipcard-body, .flipcard:focus .flipcard-body {
	 transform: rotateY(-180deg);
}

 .flipcard-back {
	 transform: rotateY(-180deg);

}

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

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

 .flipcard:active {
	 transform: scale(0.975);
}

 .flipcard-body {
 	 display: flex;
	 transform-style: preserve-3d;
	 transition: 0.7s transform;
	 border-radius: 0.25rem;
	 flex: 1;
   width: 250px;
   height: 250px;
   margin: auto;
}

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

 .shadow, .flipcard-front, .flipcard-back {
	 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);
}