drift-bottle.component_20241224205623.scss 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* drift-bottle.component.scss */
  2. :host {
  3. display: block;
  4. }
  5. /* 设置页面背景色 */
  6. ion-content {
  7. --background: transparent; /* 确保内容背景透明 */
  8. position: relative;
  9. height: 100vh; /* 确保内容高度占满整个视口 */
  10. }
  11. .top-image {
  12. position: absolute;
  13. top: 0;
  14. left: 0;
  15. width: 100%;
  16. height: 80%; /* 图片占据页面的70%高度 */
  17. overflow: hidden;
  18. z-index: 0; /* 确保图片在工具栏之下 */
  19. }
  20. .top-image img {
  21. width: 100%;
  22. height: 100%;
  23. object-fit: fill; /* 使图片填充整个容器并可能被拉伸 */
  24. clip-path: ellipse(140% 130% at 50% -30%); /* 使用椭圆剪裁路径 */
  25. }
  26. .ripple {
  27. position: absolute;
  28. border-radius: 50%;
  29. background-color: rgba(255, 255, 255, 0.6); /* 白色半透明背景 */
  30. transform: scale(0);
  31. animation: rippleEffect 0.6s ease-out;
  32. }
  33. @keyframes rippleEffect {
  34. to {
  35. transform: scale(3);
  36. opacity: 0;
  37. }
  38. }
  39. .button-container {
  40. position: absolute;
  41. bottom: 15%; /* 调整此值以改变按钮距离底部的距离 */
  42. z-index: 2; /* 确保按钮在图片之上 */
  43. }
  44. .left-button {
  45. left: 30px; /* 距离左边的距离 */
  46. }
  47. .right-button {
  48. right: 30px; /* 距离右边的距离 */
  49. }
  50. .middle-button {
  51. left: 145px;
  52. }
  53. .button-container img {
  54. width: 60px; /* 按钮图片宽度 */
  55. height: 60px; /* 按钮图片高度 */
  56. display: block;
  57. }
  58. .circular-button {
  59. width: 60px; /* 按钮图片宽度 */
  60. height: 60px; /* 按钮图片高度 */
  61. border-radius: 50%; /* 将图片剪裁为圆形 */
  62. object-fit: cover; /* 保证图片填充圆形区域 */
  63. transform: scale(1.5); /* 放大1.5倍 */
  64. transform-origin: center; /* 放大的基点为中心 */
  65. transition: transform 0.3s ease; /* 添加平滑过渡效果 */
  66. }
  67. /* 如果需要,可以在悬停时添加一些效果 */
  68. .circular-button:hover {
  69. transform: scale(1.6); /* 鼠标悬停时稍微再放大一点 */
  70. }