|
36 | 36 | .plc-4 > * { |
37 | 37 | @apply pl-4; |
38 | 38 | } |
| 39 | + |
| 40 | +/* |
| 41 | +======================= |
| 42 | + Upcoming |
| 43 | +Call to action effects |
| 44 | +======================= |
| 45 | +*/ |
| 46 | + |
| 47 | +:root { |
| 48 | + /* Light Cornflower Blue */ |
| 49 | + --box-flap-color-1: #94cbe3; |
| 50 | + /* English Red */ |
| 51 | + --box-flap-color-2: #b73f53; |
| 52 | + /* Old Mauve (not used yet) */ |
| 53 | + --box-flap-color-3: #6b334a; |
| 54 | + |
| 55 | + --box-flap-size: theme('spacing.16'); |
| 56 | + --box-flap-offset: theme('spacing.8'); |
| 57 | +} |
| 58 | + |
| 59 | +.box-flap { |
| 60 | + position: relative; |
| 61 | +} |
| 62 | + |
| 63 | +.box-flap-1, |
| 64 | +.box-flap-2 { |
| 65 | + mix-blend-mode: multiply; |
| 66 | + filter: none; |
| 67 | + z-index: -1; |
| 68 | + width: calc(100% + (var(--box-flap-size) * 2)); |
| 69 | + height: calc(100% + (var(--box-flap-size) * 2)); |
| 70 | + position: absolute; |
| 71 | + display: block; |
| 72 | + animation: flapping 10s ease-in-out infinite; |
| 73 | + /* safari cannot handle calc + variable; use the tailwind/postcss fallback for now */ |
| 74 | + /* transform: translateX(calc(-1 * var(--box-flap-size))) translateY(calc(-1 * var(--box-flap-size))); */ |
| 75 | + transform: translateX(calc(-1 * theme('spacing.16'))) |
| 76 | + translateY(calc(-1 * theme('spacing.16'))); |
| 77 | +} |
| 78 | + |
| 79 | +@keyframes flapping { |
| 80 | + 0%, |
| 81 | + 100% { |
| 82 | + clip-path: polygon( |
| 83 | + 0 0, |
| 84 | + calc(100% - var(--box-flap-offset)) calc(0% + var(--box-flap-offset)), |
| 85 | + 100% 100%, |
| 86 | + calc(0% + var(--box-flap-offset)) calc(100% - var(--box-flap-offset)) |
| 87 | + ); |
| 88 | + } |
| 89 | + 50% { |
| 90 | + clip-path: polygon( |
| 91 | + calc(0% + var(--box-flap-offset)) calc(0% + var(--box-flap-offset)), |
| 92 | + 100% 0, |
| 93 | + calc(100% - var(--box-flap-offset)) calc(100% - var(--box-flap-offset)), |
| 94 | + 0 100% |
| 95 | + ); |
| 96 | + } |
| 97 | +} |
| 98 | + |
| 99 | +.box-flap-1 { |
| 100 | + animation-delay: -5s; |
| 101 | + background-color: var(--box-flap-color-1); |
| 102 | + clip-path: polygon( |
| 103 | + 0 0, |
| 104 | + calc(100% - var(--box-flap-offset)) calc(0% + var(--box-flap-offset)), |
| 105 | + 100% 100%, |
| 106 | + calc(0% + var(--box-flap-offset)) calc(100% - var(--box-flap-offset)) |
| 107 | + ); |
| 108 | +} |
| 109 | + |
| 110 | +.box-flap-2 { |
| 111 | + background-color: var(--box-flap-color-2); |
| 112 | + clip-path: polygon( |
| 113 | + calc(0% + var(--box-flap-offset)) calc(0% + var(--box-flap-offset)), |
| 114 | + 100% 0, |
| 115 | + calc(100% - var(--box-flap-offset)) calc(100% - var(--box-flap-offset)), |
| 116 | + 0 100% |
| 117 | + ); |
| 118 | +} |
0 commit comments