PRACTICAL WEB TIP
Icon Compass Focus
Compass tick marks rotate around a fixed directional arrow in an SVG icon.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
HTML
<a href="#explore" class="tbx-1107"><span class="tbx-1107__disc" aria-hidden="true"><span class="tbx-1107__ticks"></span><svg viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><path d="M19 45 45 19M26 19h19v19"/></svg></span><span class="tbx-1107__label"><small>EXPLORE</small><strong>View details</strong></span></a>
CSS
.tbx-1107{display:flex;align-items:center;gap:16px;width:min(282px,100%);padding:15px;background:#ecf1ed;border-radius:10px;color:#304c45;text-decoration:none;font-family:system-ui,sans-serif}
.tbx-1107__disc{height:82px;width:82px;border-radius:50%;background:#315f53;color:#fff;display:grid;place-items:center;position:relative;flex:none}.tbx-1107__disc svg{width:37px;height:37px;position:relative;z-index:1;transition:transform .48s}
.tbx-1107__ticks{position:absolute;inset:8px;border-radius:50%;border:2px dashed #b4e2c8;opacity:.76;transition:transform .65s cubic-bezier(.2,.8,.2,1),opacity .35s}
.tbx-1107__label{display:flex;flex-direction:column;gap:7px}.tbx-1107__label small{font-size:9px;letter-spacing:.18em;font-weight:750;color:#6b8679}.tbx-1107__label strong{font-size:15px;font-weight:750;white-space:nowrap}
.tbx-1107:is(:hover,:focus-visible) .tbx-1107__ticks{transform:rotate(75deg);opacity:1}.tbx-1107:is(:hover,:focus-visible) .tbx-1107__disc svg{transform:translate(3px,-3px) scale(1.08)}
.tbx-1107:focus-visible{outline:3px solid #95b6a4;outline-offset:3px}@media(prefers-reduced-motion:reduce){.tbx-1107 *{transition:none!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for navigation menus and features sections.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile:Ensure the interactive content remains accessible without hover on touch devices.
Browser:Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion:Check that prefers-reduced-motion is respected.