css - CSS Flipcard using Bulma tiles
问题描述
I am hoping some of you might have some ideas regarding using Bulma Tiles (https://bulma.io/documentation/layout/tiles/). I am partially successful with getting the flip functionality to work using the input checkbox, but the content inside the tile is flipping, not the entire tile.
/* ==========================================
reference --> https://codepen.io/amazingrando/pen/yjbAh
========================================== */
.tile input[type="checkbox"] {
/*Hiding the checkbox. We never want to see it.*/
position: absolute;
left: -9999em;
}
.flip-tile {
cursor: pointer;
/*Animation elements*/
display: block;
perspective: 600px;
position: relative;
transition: all 0.1s;
&:hover {
transform: scale(1.02, 1.02);
}
}
.flip-tile-front, .flip-tile-back{
//position: absolute; top: 0; left: 0;
//width: inherit; height: inherit; /*Size of the card is set by the container*/
backface-visibility: hidden; /*Makes a card invisible from behind.*/
transform-style: preserve-3d;
transition: all 0.4s ease-in-out;
}
.flip-tile-front {
/*Default rotation values*/
transform: rotateX(0deg) rotateY(0deg);
}
.flip-tile-back {
background: MediumPurple;
visibility: hidden;
/*Default rotation value*/
transform: rotateY(-180deg);
}
/*When the container is clicked the checkbox is marked as checked. This activates the CSS below. */
.tile input[type="checkbox"]:checked {
~ .flip-tile {
//animation: lift 0.4s linear;
.flip-tile-back {
visibility: visible;
transform: rotateX(0deg) rotateY(0deg);
}
.flip-tile-front {
transform: rotateY(180deg);
}
}
}
https://codepen.io/lostcook/pen/QWyvBey
Any ideas or help would greatly be appreciated.
Thanks
解决方案
推荐阅读
- nfc - 我们如何解析 NDEF 消息?
- artificial-intelligence - 如何为图像检测绘制多边形数据标注形状?
- android - 如果用户选择了“使用应用程序时”选项,则 checkSelfPermission 返回 false
- c# - 如何使 EF.Functions.Like 不区分大小写?
- python - Django 按用户更改表单结构
- laravel - Carbon::now()->format('Ymd') 和 Carbon::now(7)->format('Ymd') 之间的区别
- java - 禁用菜单项?
- c - 解决 C 警告 - 取消引用空指针
- java - 如何解决 SensorEventListener 操作单独线程中出现的 ANR 问题?
- reactjs - 输入值不随嵌套状态更新