drift-bottle.component_20241224153137.scss 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. .button-container {
  27. position: absolute;
  28. bottom: 15%; /* 调整此值以改变按钮距离底部的距离 */
  29. z-index: 2; /* 确保按钮在图片之上 */
  30. }
  31. .left-button {
  32. left: 30px; /* 距离左边的距离 */
  33. }
  34. .right-button {
  35. right: 30px; /* 距离右边的距离 */
  36. }
  37. .button-container img {
  38. width: 60px; /* 按钮图片宽度 */
  39. height: 60px; /* 按钮图片高度 */
  40. display: block;
  41. }
  42. .circular-button {
  43. width: 60px; /* 按钮图片宽度 */
  44. height: 60px; /* 按钮图片高度 */
  45. border-radius: 50%; /* 将图片剪裁为圆形 */
  46. object-fit: cover; /* 保证图片填充圆形区域 */
  47. transform: scale(1.5); /* 放大1.5倍 */
  48. transform-origin: center; /* 放大的基点为中心 */
  49. transition: transform 0.3s ease; /* 添加平滑过渡效果 */
  50. }
  51. /* 如果需要,可以在悬停时添加一些效果 */
  52. .circular-button:hover {
  53. transform: scale(1.6); /* 鼠标悬停时稍微再放大一点 */
  54. }