-
-
-
- Currency:
-
+
+
+
-
-
- Compact:
-
+
+
+
-
+
@@ -91,40 +76,52 @@ function changeCurrency() {
.container {
display: flex;
flex-direction: column;
+ gap: 16px;
align-items: center;
- gap: 20px;
-}
-
-.number {
- font-size: 78px;
+ justify-content: center;
+ padding: 16px;
+ height: 80px;
}
-.controls {
+.button-wrapper {
+ position: relative;
display: flex;
- gap: 20px;
- border-radius: 50px;
+ align-items: center;
+ justify-content: center;
}
-.controls > div {
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 18px;
+.progress-ring {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ pointer-events: none;
}
-.switch-container {
- width: 40px;
- height: 20px;
- border-radius: 25px;
- cursor: pointer;
- display: flex;
- padding: 5px;
+.button {
+ color: var(--black);
+ background-color: var(--white);
+ border-radius: 999px;
+ padding: 12px 20px;
+ position: relative;
+ isolation: isolate;
+ overflow: hidden;
+ will-change: transform;
+ user-select: none;
+ -webkit-user-select: none;
+ -webkit-touch-callout: none;
}
-.switch-handle {
- width: 20px;
- height: 20px;
- background-color: #4ff0b7;
- border-radius: 50%;
+.button-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: var(--green);
+ border-radius: 999px;
+ z-index: -1;
+ filter: blur(20px);
+ scale: 2;
}
From 36a1e0596bf6095d59c80683ff71222d7f9fa3c3 Mon Sep 17 00:00:00 2001
From: Persephone Flores <34418758+hp0844182@users.noreply.github.com>
Date: Fri, 4 Apr 2025 19:52:41 +0800
Subject: [PATCH 2/2] test: add test for stroke-width attribute handling in SVG
---
.../src/components/__tests__/svg.test.ts | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/packages/motion/src/components/__tests__/svg.test.ts b/packages/motion/src/components/__tests__/svg.test.ts
index b91522e..7eba13a 100644
--- a/packages/motion/src/components/__tests__/svg.test.ts
+++ b/packages/motion/src/components/__tests__/svg.test.ts
@@ -35,4 +35,26 @@ describe('row-value', () => {
expect(path.getAttribute('stroke')).toBe('blue')
expect(path.getAttribute('opacity')).toBe('1')
})
+ it('should update stroke-width through attributes instead of style', async () => {
+ const strokeWidth = motionValue(2)
+ const wrapper = render(Motion, {
+ props: {
+ as: 'path',
+ style: {
+ strokeWidth,
+ },
+ },
+ attrs: {
+ 'data-testid': 'path',
+ },
+ })
+ await nextTick()
+ const path = wrapper.getByTestId('path')
+ expect(path.style.strokeWidth).toBeFalsy()
+ expect(path.getAttribute('stroke-width')).toBe('2')
+ strokeWidth.set(4)
+ await delay(100)
+ expect(path.style.strokeWidth).toBeFalsy()
+ expect(path.getAttribute('stroke-width')).toBe('4')
+ })
})