drawing.component.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. :host {
  2. --primary-color: var(--ion-color-primary);
  3. --background-color: #f5f5f5;
  4. }
  5. ion-header {
  6. ion-toolbar {
  7. --background: transparent;
  8. ion-title {
  9. font-size: 18px;
  10. font-weight: 600;
  11. }
  12. }
  13. }
  14. .drawing-container {
  15. position: relative;
  16. width: 100%;
  17. height: calc(100% - 180px);
  18. background: white;
  19. overflow: hidden;
  20. canvas {
  21. touch-action: none;
  22. background: white;
  23. }
  24. }
  25. .tools-panel {
  26. position: fixed;
  27. bottom: 0;
  28. left: 0;
  29. right: 0;
  30. background: white;
  31. padding: 16px;
  32. box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  33. z-index: 1000;
  34. .tools-section {
  35. display: flex;
  36. justify-content: space-around;
  37. margin-bottom: 16px;
  38. ion-button {
  39. --padding-start: 8px;
  40. --padding-end: 8px;
  41. height: 60px;
  42. flex-direction: column;
  43. &.selected {
  44. --color: var(--primary-color);
  45. position: relative;
  46. &::after {
  47. content: '';
  48. position: absolute;
  49. bottom: 0;
  50. left: 25%;
  51. width: 50%;
  52. height: 2px;
  53. background: var(--primary-color);
  54. border-radius: 1px;
  55. }
  56. }
  57. ion-icon {
  58. font-size: 24px;
  59. margin-bottom: 4px;
  60. }
  61. span {
  62. font-size: 12px;
  63. }
  64. }
  65. }
  66. .color-section {
  67. display: flex;
  68. justify-content: center;
  69. gap: 12px;
  70. margin-bottom: 16px;
  71. padding: 0 16px;
  72. .color-item {
  73. width: 30px;
  74. height: 30px;
  75. border-radius: 50%;
  76. border: 2px solid #eee;
  77. cursor: pointer;
  78. transition: transform 0.2s ease;
  79. &.selected {
  80. transform: scale(1.2);
  81. border-color: var(--primary-color);
  82. }
  83. &:hover {
  84. transform: scale(1.1);
  85. }
  86. }
  87. }
  88. .width-section {
  89. padding: 0 16px;
  90. ion-range {
  91. --bar-height: 4px;
  92. --bar-background: #eee;
  93. --bar-background-active: var(--primary-color);
  94. --height: 40px;
  95. --knob-size: 20px;
  96. --knob-background: white;
  97. --knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  98. }
  99. }
  100. }
  101. // 添加动画效果
  102. @keyframes slideUp {
  103. from {
  104. transform: translateY(100%);
  105. }
  106. to {
  107. transform: translateY(0);
  108. }
  109. }
  110. .tools-panel {
  111. animation: slideUp 0.3s ease-out;
  112. }