rhombusBlock.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="rhombus-container">
  3. <div class="rev-rhombus-container">
  4. <i class="iconfont icon" v-html="infoData.icon"></i>
  5. </div>
  6. <div class="rhombus-mask">
  7. <div class="rev-rhombus-mask">
  8. <p class="line">{{infoData.line1}}</p>
  9. <p class="line">{{infoData.line2}}</p>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: "rhombusBlock",
  17. props:['infoData']
  18. }
  19. </script>
  20. <style scoped lang="less">
  21. .rhombus-container{
  22. margin: 35px;
  23. position: relative;
  24. transform-origin: center;
  25. width: 176px;
  26. height: 176px;
  27. transform: rotate(45deg);
  28. background-color: white;
  29. & .rhombus-mask{
  30. position: relative;
  31. width: 176px;
  32. height: 176px;
  33. background-color: rgba(26, 111, 166, 0.95);
  34. display: none;
  35. z-index: 5;
  36. & .rev-rhombus-mask{
  37. width: 100%;
  38. position: absolute;
  39. top: 50%;
  40. left: 50%;
  41. transform: translate(-50%,-50%) rotate(-45deg);
  42. & .line{
  43. font-size: 15px;
  44. color: #ffffff;
  45. }
  46. }
  47. }
  48. &:hover{
  49. .rhombus-mask{
  50. display: block;
  51. }
  52. }
  53. & .rev-rhombus-container{
  54. & .icon{
  55. color: #2580bb;
  56. font-size: 73px;
  57. }
  58. position: absolute;
  59. transform-origin: center;
  60. /*transform: rotate(-45deg);*/
  61. left: 50%;
  62. top: 50%;
  63. transform: translate(-50%,-50%) rotate(-45deg);
  64. z-index: 1;
  65. }
  66. }
  67. </style>