Skip to content
Source
Sign inSign up
samwillis/one-million-boxes
Open History to see the last commit

TouchFeedback.css

82 lines1.5 KB

1/**
2 * Touch feedback ripple effect styles
3 */
4​
5.touch-feedback-container {
6 position: absolute;
7 inset: 0;
8 pointer-events: none;
9 overflow: hidden;
11​
12.touch-ripple {
13 position: absolute;
14 width: 60px;
15 height: 60px;
16 border-radius: 50%;
17 background: radial-gradient(
18 circle,
19 rgba(255, 255, 255, 0.6) 0%,
20 rgba(255, 255, 255, 0.3) 40%,
21 rgba(255, 255, 255, 0) 70%
22 );
23 transform: translate(-50%, -50%) scale(0);
24 animation: ripple 0.5s ease-out forwards;
25 pointer-events: none;
27​
28/* Team-colored ripples */
29.touch-ripple.team-red {
30 background: radial-gradient(
31 circle,
32 rgba(229, 57, 53, 0.5) 0%,
33 rgba(229, 57, 53, 0.2) 40%,
34 rgba(229, 57, 53, 0) 70%
35 );
37​
38.touch-ripple.team-blue {
39 background: radial-gradient(
40 circle,
41 rgba(30, 136, 229, 0.5) 0%,
42 rgba(30, 136, 229, 0.2) 40%,
43 rgba(30, 136, 229, 0) 70%
44 );
46​
47.touch-ripple.team-green {
48 background: radial-gradient(
49 circle,
50 rgba(67, 160, 71, 0.5) 0%,
51 rgba(67, 160, 71, 0.2) 40%,
52 rgba(67, 160, 71, 0) 70%
53 );
55​
56.touch-ripple.team-yellow {
57 background: radial-gradient(
58 circle,
59 rgba(253, 216, 53, 0.5) 0%,
60 rgba(253, 216, 53, 0.2) 40%,
61 rgba(253, 216, 53, 0) 70%
62 );
64​
65@keyframes ripple {
66 0% {
67 transform: translate(-50%, -50%) scale(0);
68 opacity: 1;
69 }
70 100% {
71 transform: translate(-50%, -50%) scale(3);
72 opacity: 0;
73 }
75​
76/* Reduced motion preference */
77@media (prefers-reduced-motion: reduce) {
78 .touch-ripple {
79 animation: none;
80 display: none;
81 }