From 7566855d5a938f34ccf7a0844e3fafdea27fe744 Mon Sep 17 00:00:00 2001 From: aelmanaa Date: Fri, 13 Dec 2024 15:02:44 +0100 Subject: [PATCH] update --- .../TutorialBlockchainSelector.css | 229 ------------------ .../TutorialBlockchainSelector.module.css | 103 +++++++- .../TutorialBlockchainSelector.tsx | 50 +++- 3 files changed, 137 insertions(+), 245 deletions(-) delete mode 100644 src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.css diff --git a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.css b/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.css deleted file mode 100644 index 625131d42eb..00000000000 --- a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.css +++ /dev/null @@ -1,229 +0,0 @@ -.tutorial-blockchain-selector { - display: flex; - flex-direction: column; - gap: var(--space-4x); - margin: var(--space-4x) 0; -} - -.selectors-row { - display: flex; - gap: 1rem; - align-items: center; - justify-content: flex-start; - background: var(--color-background-2); - padding: 1rem; - border-radius: 8px; - transition: opacity 0.3s ease; -} - -.selectors-row.is-loading { - opacity: 0.6; - position: relative; -} - -.selectors-row.is-loading::after { - content: ""; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 2px; - background: linear-gradient(90deg, transparent, var(--color-primary), transparent); - animation: loading 1.5s infinite; -} - -@keyframes loading { - 0% { - transform: translateX(-100%); - } - 100% { - transform: translateX(100%); - } -} - -.selector-group { - flex: 1; - max-width: 300px; -} - -.env-select { - width: auto !important; - background: var(--color-primary); - color: white; - border: none; - font-size: 0.875rem; -} - -.selector-group select { - width: 100%; - padding: 0.5rem; - border-radius: 4px; - border: 1px solid #e2e8f0; - background: white; - font-size: 0.875rem; - transition: all 0.2s ease; -} - -.selector-group select:hover { - border-color: var(--color-primary); - box-shadow: 0 0 0 1px var(--color-primary); -} - -.selector-group select:focus { - outline: 3px solid #2d7cd6; - outline-offset: 2px; -} - -.selector-group select.has-value { - border-color: var(--color-success); - background-color: #f0fdf4; -} - -/* Style for the first select (Environment) */ -.selector-group:first-child select { - color: #ffffff; - background-color: #375bd2; - background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); -} - -.selector-group:first-child select:hover { - color: #ffffff; - background-color: #1a2b6b; - border-color: #1a2b6b; -} - -@media (max-width: 768px) { - .selectors-row { - flex-direction: column; - } -} - -.deployment-params { - background: var(--color-background-2); - border-radius: 8px; - padding: 16px; - margin: 16px 0; -} - -.param-group { - display: grid; - grid-template-columns: 160px 1fr; - gap: 12px; - align-items: center; - padding: 8px 0; - border-bottom: 1px solid var(--color-border-primary); -} - -.param-group:last-child { - border-bottom: none; -} - -.param-group label { - color: var(--color-text-secondary); - font-family: var(--font-mono); - font-size: var(--space-3x); -} - -.validation-message { - color: #d63c2d; /* WCAG AA compliant red */ - background: #fff8f8; - padding: 8px; - border-left: 4px solid currentColor; -} - -.state-banner { - position: sticky; - top: 0; - z-index: 100; - background: #f8f9fa; - border-bottom: 1px solid #e9ecef; - padding: 8px 16px; - display: flex; - justify-content: space-between; - align-items: center; -} - -.state-banner__network { - font-weight: 500; -} - -.state-banner__progress { - color: #6c757d; -} - -.tutorial-progress { - display: flex; - justify-content: space-between; - margin: 2rem 0; - padding: 1rem; - background: var(--color-background-2); - border-radius: 8px; -} - -.progress-step { - display: flex; - align-items: center; - gap: 0.5rem; - opacity: 0.5; -} - -.progress-step.active { - opacity: 1; - font-weight: 600; -} - -.progress-step.completed { - opacity: 1; - color: var(--color-success); -} - -.step-number { - width: 24px; - height: 24px; - border-radius: 50%; - background: var(--color-border-primary); - display: flex; - align-items: center; - justify-content: center; - font-size: 14px; -} - -.completed .step-number { - background: var(--color-success); - color: white; -} - -.active .step-number { - background: var(--color-primary); - color: white; -} - -.status-panel { - margin: 2rem 0; - padding: 1rem; - background: var(--color-background-2); - border-radius: 8px; -} - -.status-item { - display: flex; - justify-content: space-between; - padding: 0.5rem 0; - border-bottom: 1px solid var(--color-border-primary); -} - -.status-item:last-child { - border-bottom: none; -} - -.status-label { - color: var(--color-text-secondary); -} - -.selector-group:nth-child(2)::after { - content: "→"; - position: absolute; - right: -0.75rem; - color: var(--color-primary); - font-weight: bold; -} diff --git a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.module.css b/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.module.css index b9ead255dd2..6cb39a1725d 100644 --- a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.module.css +++ b/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.module.css @@ -190,21 +190,110 @@ /* Arrow styling */ .arrowContainer { + --touch-target-size: 44px; + --animation-timing: cubic-bezier(0.4, 0, 0.2, 1); + display: flex; align-items: center; justify-content: center; + min-width: var(--touch-target-size); + min-height: var(--touch-target-size); + padding: 0 1rem; + cursor: default; + position: relative; + outline: none; + transition: transform 0.2s var(--animation-timing); +} + +/* RTL Support */ +[dir="rtl"] .arrowContainer { + transform: scaleX(-1); } .arrow { - color: var(--color-accent); - opacity: 0.6; - transition: all 0.2s ease; + color: var(--color-text-secondary); + transition: all 0.3s var(--animation-timing); + will-change: transform, opacity; } -/* Add subtle animation when chains are selected */ -.chainSelectors:has([value]:not([value=""])) .arrow { - opacity: 1; - transform: translateX(2px); +.arrowGroup { + transform-origin: center; + transition: transform 0.3s var(--animation-timing); +} + +/* Interactive States */ +.arrowContainer:hover .arrow { + color: var(--color-primary); +} + +.arrowContainer:hover .arrowGroup { + transform: scale(1.05); +} + +.arrowContainer:active .arrowGroup { + transform: scale(0.95); +} + +/* Focus States */ +.arrowContainer:focus-visible { + outline: 2px solid var(--color-primary); + outline-offset: 2px; + border-radius: 4px; +} + +/* Animations */ +@media (prefers-reduced-motion: no-preference) { + .arrowPath { + opacity: 0.8; + animation: bidirectionalFlow 3s var(--animation-timing) infinite; + } + + .arrowLine { + opacity: 0.6; + animation: fadeInOut 3s var(--animation-timing) infinite; + } + + /* Stagger animations */ + .arrowPath:first-child { + animation-delay: 0s; + } + + .arrowPath:last-child { + animation-delay: 1.5s; + } + + @keyframes bidirectionalFlow { + 0%, + 100% { + opacity: 0.8; + transform: translateX(0); + } + 50% { + opacity: 1; + transform: translateX(2px); + } + } + + @keyframes fadeInOut { + 0%, + 100% { + opacity: 0.6; + } + 50% { + opacity: 1; + } + } +} + +/* Mobile/Touch Optimization */ +@media (hover: none) { + .arrowContainer { + cursor: pointer; + } + + .arrowContainer:active .arrow { + transform: scale(0.95); + } } @media (max-width: 1200px) { diff --git a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.tsx b/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.tsx index adc4952ed9d..c3df6bd27d5 100644 --- a/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.tsx +++ b/src/components/CCIP/TutorialBlockchainSelector/TutorialBlockchainSelector.tsx @@ -143,15 +143,47 @@ export const TutorialBlockchainSelector = () => { placeholder="Select Source" /> -
- - +
+ + + + + + + + + + +