<div class="ps-v22-wrapper">
<div class="ps-v22-container">
<!-- Module 1: Performance Anchor -->
<div class="ps-v22-sec">
<div class="ps-v22-header" style="margin-bottom:12px;">
<span class="ps-v22-tag" style="font-size:11px !important; font-weight:800; color:#86868b; letter-spacing:1.5px; display:block; margin-bottom:2px;">ELITE PERFORMANCE</span>
<h3 class="ps-v21-title" style="font-size:16px !important; font-weight:600; color:#86868b; margin:0;">Unmatched Power & Precision</h3>
</div>
<div class="ps-v22-grid-4">
<div class="ps-v22-item" onmouseenter="v22Roll(this)">
<div class="ps-v22-num" data-target="12">0</div>
<div class="ps-v22-label">Drills</div>
</div>
<div class="ps-v22-item" onmouseenter="v22Roll(this)">
<div class="ps-v22-num" data-target="75">0<small>MPH</small></div>
<div class="ps-v22-label">Top Speed</div>
</div>
<div class="ps-v22-item" onmouseenter="v22Roll(this)">
<div class="ps-v22-num" data-target="5">0<small>H</small></div>
<div class="ps-v22-label">Endurance</div>
</div>
<div class="ps-v22-item" onmouseenter="v22Roll(this)">
<div class="ps-v22-num" data-target="6"><span>±</span>0</div>
<div class="ps-v22-label">Spin Level</div>
</div>
</div>
<div class="ps-v22-performance-row">
<div class="ps-v22-feature-card ps-v22-feature-wide">
<div class="ps-v22-feature-main">External Oscillation</div>
<div class="ps-v22-feature-sub">Visible movement. Wide-angle sweeping paths.</div>
</div>
<div class="ps-v22-feature-card ps-v22-feature-small" onmouseenter="v22Roll(this)">
<div class="ps-v22-num ps-v22-feature-num" data-target="28">0</div>
<div class="ps-v22-label">Landing Points</div>
</div>
</div>
</div>
<div class="ps-v22-line"></div>
<!-- Module 2: Smart Hub -->
<details class="ps-v22-fold">
<summary class="ps-v22-fold-summary">
<span>
<strong>Smart Hub</strong>
<small>3-Way Control | Smart Triple Control</small>
</span>
<span class="ps-v22-fold-icon">+</span>
</summary>
<div class="ps-v22-sec ps-v22-compact-gap">
<div class="ps-v22-grid-3 ps-v32-m-grid">
<div class="ps-v22-hub">
<div class="ps-v22-hub-txt" style="text-align: center;">
<strong class="ps-v22-hub-main">App</strong>
<span class="ps-v22-hub-sub">Control</span>
</div>
<div class="ps-v22-glass">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/app.png?v=1776844399" alt="App Control">
</div>
</div>
<div class="ps-v22-hub">
<div class="ps-v22-hub-txt" style="text-align: center;">
<strong class="ps-v22-hub-main">Remote</strong>
<span class="ps-v22-hub-sub">Smart</span>
</div>
<div class="ps-v22-glass">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/6b6272d197d26395c591d57b0fc39241.png?v=1776844399" alt="Remote Control">
</div>
</div>
<div class="ps-v22-hub">
<div class="ps-v22-hub-txt" style="text-align: center;">
<strong class="ps-v22-hub-main">Apple</strong>
<span class="ps-v22-hub-sub">Watch</span>
</div>
<div class="ps-v22-glass">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/Apple_Watch.png?v=1776844399" alt="Apple Watch Control">
</div>
</div>
</div>
</div>
</details>
<div class="ps-v22-line"></div>
<!-- Module 3: Logistics Pulse -->
<details class="ps-v22-fold">
<summary class="ps-v22-fold-summary">
<span>
<strong>Logistics Pulse</strong>
<small>Free Shipping | Global Doorstep Delivery</small>
</span>
<span class="ps-v22-fold-icon">+</span>
</summary>
<div class="ps-v22-sec ps-v22-compact-gap">
<div class="ps-v22-grid-4 ps-v22-logistics-grid">
<div class="ps-v22-speed">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/flag-for-us-outlying-islands-svgrepo-com.svg?v=1756885133" class="ps-v22-flag" alt="USA">
<span class="ps-v22-fn-text">USA</span>
<div class="ps-v22-speed-hover">
<span class="ps-v22-st">IN STOCK</span>
<span class="ps-v22-days">1-5 Days</span>
</div>
</div>
<div class="ps-v22-speed">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/european-union-svgrepo-com.svg?v=1756885133" class="ps-v22-flag" alt="EU">
<span class="ps-v22-fn-text">EU</span>
<div class="ps-v22-speed-hover">
<span class="ps-v22-st">IN STOCK</span>
<span class="ps-v22-days">1-7 Days</span>
</div>
</div>
<div class="ps-v22-speed ps-uk-gray">
<img src="https://cdn.shopify.com/s/files/1/0653/7484/7107/files/united-kingdom-uk-svgrepo-com.svg?v=1756885133" class="ps-v22-flag" alt="UK">
<span class="ps-v22-fn-text">UK</span>
<div class="ps-v22-speed-hover">
<span class="ps-v22-days">Soon</span>
</div>
</div>
<div class="ps-v22-speed ps-global-card">
<div class="ps-v22-global-icon">🌐</div>
<span class="ps-v22-fn-text">GLOBAL</span>
<div class="ps-v22-speed-hover">
<span class="ps-v22-st">FREE SHIPPING</span>
<span class="ps-v22-global-days">Doorstep</span>
</div>
</div>
</div>
<div class="ps-v22-global-note">
<strong>Global Delivery:</strong> Free shipping to Asia, Europe, North America, and Oceania. Enjoy duty-included doorstep delivery — place your order and wait for the package to arrive at your door. For South America, please contact us before ordering.
</div>
</div>
</details>
<div class="ps-v22-line"></div>
<!-- Module 4: Transaction Capsule -->
<div class="ps-v22-sec ps-v22-checkout-final">
<div class="ps-v22-price-wrap">
<span id="v22-current-price" class="ps-v22-p-main">
{{ product.selected_or_first_available_variant.price | money | strip_html }}
</span>
<span
id="v22-compare-price"
class="ps-v22-p-old"
{% unless product.selected_or_first_available_variant.compare_at_price > product.selected_or_first_available_variant.price %}
style="display:none;"
{% endunless %}
>
{{ product.selected_or_first_available_variant.compare_at_price | money | strip_html }}
</span>
</div>
{% unless product.has_only_default_variant %}
<div class="ps-v22-sw-group">
<label class="ps-v22-option-label">Color:</label>
<div class="ps-v22-sw-list">
{% for variant in product.variants %}
<button
type="button"
class="ps-v22-sw-pill {% if variant.id == product.selected_or_first_available_variant.id %}is-active{% endif %} {% unless variant.available %}is-disabled{% endunless %}"
data-variant-id="{{ variant.id }}"
data-price="{{ variant.price | money | strip_html | escape }}"
data-compare-price="{% if variant.compare_at_price > variant.price %}{{ variant.compare_at_price | money | strip_html | escape }}{% endif %}"
data-inventory="{{ variant.inventory_quantity | default: 0 }}"
data-available="{% if variant.available %}true{% else %}false{% endif %}"
onclick="v22SelectVariant(this)"
{% unless variant.available %}disabled{% endunless %}
>
{% if variant.title == 'Default Title' %}
{{ product.title | upcase }}
{% else %}
{{ variant.title | upcase }}
{% endif %}
</button>
{% endfor %}
</div>
</div>
{% endunless %}
<div class="ps-v32-qty-row">
<span class="ps-v22-option-label ps-v22-qty-label">Quantity:</span>
<div class="ps-v32-capsule-box">
<button type="button" class="ps-v32-op-btn" onclick="v22Qty(-1)">−</button>
<input type="number" id="v22-qty" value="1" readonly>
<button type="button" class="ps-v32-op-btn" onclick="v22Qty(1)">+</button>
</div>
<span id="v22-inventory-text" class="ps-v22-inventory">
(Inventory: {{ product.selected_or_first_available_variant.inventory_quantity | default: 733 }})
</span>
</div>
<div class="ps-v22-btn-stack">
<button type="button" id="v22-buy-btn" class="ps-v22-btn ps-v22-btn-buy" onclick="handleV22Buy()">Buy It Now</button>
<button type="button" id="v22-cart-btn" class="ps-v22-btn ps-v22-btn-cart" onclick="handleV22Cart()">Add to cart</button>
</div>
</div>
<div class="ps-v22-line"></div>
<!-- Module 5: Trust Accordion -->
<details class="ps-v22-fold ps-v22-trust-fold">
<summary class="ps-v22-fold-summary">
<span>
<strong>Trust Accordion</strong>
<small>Warranty, shipping, compatibility and box contents</small>
</span>
<span class="ps-v22-fold-icon">+</span>
</summary>
<div class="ps-v22-accordion-area">
<details class="ps-v22-details">
<summary class="ps-v22-summary">What's in the Box <span class="ps-v22-icon">+</span></summary>
<div class="ps-v22-content">
<ul>
<li>1 x PT-Smart Tennis/Padel Ball Machine</li>
<li>1 x External Lithium Battery (156Wh)</li>
<li>1 x Smart Remote Control</li>
<li>1 x Fast Charger & Maintenance Kit</li>
</ul>
</div>
</details>
<details class="ps-v22-details">
<summary class="ps-v22-summary">Warranty & Support <span class="ps-v22-icon">+</span></summary>
<div class="ps-v22-content">
<p>We provide a <strong>3-year warranty</strong> on the main machine unit and a 1-year warranty on the lithium battery. During the warranty period, we offer free shipping of spare parts for any manufacturing defects.</p>
</div>
</details>
<details class="ps-v22-details">
<summary class="ps-v22-summary">Ball & Surface Compatibility <span class="ps-v22-icon">+</span></summary>
<div class="ps-v22-content">
<p>Compatible with all pressurized, training, and Padel balls. Engineered for Hard, Clay (Dust-proof), and Grass courts.</p>
</div>
</details>
<details class="ps-v22-details">
<summary class="ps-v22-summary">Shipping & Delivery <span class="ps-v22-icon">+</span></summary>
<div class="ps-v22-content">
<p>Free Shipping to Asia, Europe, North America, and Oceania. Duty-included doorstep delivery is available for supported regions. South America customers should contact us before ordering.</p>
</div>
</details>
</div>
</details>
</div>
</div>
<style>
.ps-v22-wrapper {
width: 100%;
margin: 20px 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ps-v22-container {
background: #fff;
border: 1px solid #e5e5e7;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.ps-v22-sec {
padding: 24px;
text-align: left;
}
.ps-v22-compact-gap {
padding-top: 10px;
padding-bottom: 14px;
}
.ps-v22-line {
height: 1px;
background: #f2f2f2;
margin: 0 24px;
}
.ps-v22-grid-4 {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.ps-v22-grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.ps-v22-item {
background: #fbfbfd;
border-radius: 8px;
text-align: center;
padding: 16px 4px;
transition: 0.3s;
cursor: pointer;
}
.ps-v22-item:hover {
background: #fff;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.ps-v22-item:hover .ps-v22-num,
.ps-v22-item:hover .ps-v22-num small,
.ps-v22-item:hover .ps-v22-num span {
color: #4466ff !important;
}
.ps-v22-num {
font-size: 38px;
font-weight: 900;
color: #1d1d1f;
line-height: 1;
transition: color 0.3s;
}
.ps-v22-num small,
.ps-v22-num span {
font-size: 13px;
color: #86868b;
margin-left: 1px;
}
.ps-v22-label {
font-size: 10px;
font-weight: 700;
color: #86868b;
text-transform: uppercase;
margin-top: 4px;
}
.ps-v22-performance-row {
display: grid;
grid-template-columns: 3fr 1fr;
gap: 10px;
margin-top: 10px;
}
.ps-v22-feature-card {
background: #fbfbfd;
border-radius: 8px;
min-height: 74px;
padding: 16px;
display: flex;
flex-direction: column;
justify-content: center;
transition: 0.3s;
}
.ps-v22-feature-card:hover {
background: #fff;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.ps-v22-feature-main {
font-size: 20px;
font-weight: 850;
color: #1d1d1f;
letter-spacing: -0.3px;
line-height: 1.1;
}
.ps-v22-feature-sub {
font-size: 12px;
color: #86868b;
margin-top: 5px;
line-height: 1.35;
}
.ps-v22-feature-small {
text-align: center;
align-items: center;
padding-left: 8px;
padding-right: 8px;
cursor: pointer;
}
.ps-v22-feature-num {
font-size: 34px;
}
.ps-v22-feature-card:hover .ps-v22-num {
color: #4466ff !important;
}
.ps-v22-feature-wide:hover .ps-v22-feature-main,
.ps-v22-feature-wide:hover .ps-v22-feature-sub {
color: #4466ff !important;
}
.ps-v22-fold {
background: #fff;
}
.ps-v22-fold-summary {
padding: 18px 24px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
gap: 16px;
}
.ps-v22-fold-summary::-webkit-details-marker {
display: none;
}
.ps-v22-fold-summary strong {
display: block;
font-size: 14px;
font-weight: 750;
color: #1d1d1f;
line-height: 1.1;
}
.ps-v22-fold-summary small {
display: block;
font-size: 12px;
color: #86868b;
margin-top: 4px;
line-height: 1.2;
}
.ps-v22-fold-icon {
width: 24px;
height: 24px;
border-radius: 50%;
background: #f5f5f7;
display: flex;
align-items: center;
justify-content: center;
color: #86868b;
font-size: 18px;
font-weight: 400;
transition: 0.25s;
flex-shrink: 0;
}
.ps-v22-fold[open] > .ps-v22-fold-summary .ps-v22-fold-icon {
transform: rotate(45deg);
background: rgba(68, 102, 255, 0.08);
color: #4466ff;
}
.ps-v22-hub,
.ps-v22-speed {
background: #fbfbfd;
border-radius: 8px;
height: 68px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
transition: 0.3s;
}
.ps-v22-hub:hover,
.ps-v22-speed:hover {
height: 100px;
box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.ps-v22-hub-main {
display: block;
font-size: 15px;
color: #1d1d1f;
line-height: 1.1;
margin-bottom: 1px;
}
.ps-v22-hub-sub {
display: block;
font-size: 11px;
color: #86868b;
line-height: 1;
}
.ps-v22-glass,
.ps-v22-speed-hover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255,255,255,0.3);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
opacity: 0;
transition: 0.3s;
z-index: 2;
}
.ps-v22-hub:hover .ps-v22-glass,
.ps-v22-speed:hover .ps-v22-speed-hover {
opacity: 1;
}
.ps-v22-glass img {
width: 90%;
height: 90%;
object-fit: contain;
}
.ps-v22-st {
font-size: 8px !important;
font-weight: 800 !important;
color: #007bff !important;
text-transform: uppercase !important;
margin-bottom: 2px !important;
letter-spacing: 0.5px !important;
}
.ps-v22-days {
font-size: 20px !important;
font-weight: 900 !important;
color: #1d1d1f !important;
line-height: 1 !important;
}
.ps-v22-flag {
width: 22px;
margin-bottom: 4px;
}
.ps-v22-fn-text {
text-align: center;
display: block;
font-size: 11px;
font-weight: 700;
color: #86868b;
}
.ps-global-card {
background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 100%);
}
.ps-v22-global-icon {
font-size: 22px;
line-height: 1;
margin-bottom: 5px;
}
.ps-v22-global-days {
font-size: 16px !important;
font-weight: 900 !important;
color: #1d1d1f !important;
line-height: 1 !important;
}
.ps-v22-global-note {
margin-top: 12px;
background: #fbfbfd;
border: 1px solid #f0f0f2;
border-radius: 10px;
padding: 12px 14px;
font-size: 12.5px;
color: #6a6a6a;
line-height: 1.5;
}
.ps-v22-global-note strong {
color: #1d1d1f;
font-weight: 750;
}
.ps-v22-checkout-final {
padding-top: 26px;
padding-bottom: 28px;
}
.ps-v22-price-wrap {
margin-bottom: 22px;
display: flex;
align-items: baseline;
gap: 10px;
}
.ps-v22-p-main {
font-size: 34px;
font-weight: 850;
color: #1d1d1f;
letter-spacing: -0.8px;
line-height: 1;
}
.ps-v22-p-old {
font-size: 16px;
color: #86868b;
text-decoration: line-through;
}
.ps-v22-sw-group {
margin-bottom: 22px;
}
.ps-v22-option-label {
font-size: 15px;
font-weight: 650;
color: #86868b;
display: block;
margin-bottom: 10px;
}
.ps-v22-sw-list {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.ps-v22-sw-pill {
min-width: 92px;
height: 48px;
padding: 0 22px;
border-radius: 50px;
border: 1.5px solid #e0e0e0;
background: #fff;
color: #1d1d1f;
font-size: 13px;
font-weight: 800;
letter-spacing: 1.6px;
cursor: pointer;
transition: 0.2s;
}
.ps-v22-sw-pill:hover {
border-color: #4466ff;
color: #4466ff;
}
.ps-v22-sw-pill.is-active {
border-color: #4466ff !important;
color: #4466ff !important;
background: rgba(68, 102, 255, 0.05) !important;
}
.ps-v22-sw-pill.is-disabled {
opacity: 0.35;
cursor: not-allowed;
text-decoration: line-through;
}
.ps-v32-qty-row {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 28px;
flex-wrap: wrap;
}
.ps-v22-qty-label {
margin-bottom: 0;
}
.ps-v32-capsule-box {
display: flex;
align-items: center;
border: 1.5px solid #e0e0e0;
border-radius: 50px;
padding: 0 14px;
width: 132px;
height: 48px;
justify-content: space-between;
background: #fff;
}
.ps-v32-op-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #121212;
padding: 0;
line-height: 1;
display: flex;
align-items: center;
font-weight: 700;
}
#v22-qty {
width: 34px;
border: none;
text-align: center;
font-size: 17px;
font-weight: 750;
background: transparent;
outline: none;
color: #1d1d1f;
}
.ps-v22-inventory {
font-size: 14px;
color: #86868b;
white-space: nowrap;
}
.ps-v22-btn-stack {
display: flex;
flex-direction: column;
gap: 10px;
}
.ps-v22-btn {
width: 100%;
height: 58px;
border-radius: 50px;
font-size: 15px;
font-weight: 800;
letter-spacing: 2px;
text-transform: uppercase;
cursor: pointer;
border: none;
display: flex;
align-items: center;
justify-content: center;
transition: 0.2s;
}
.ps-v22-btn-buy {
background: #4466ff;
color: #fff;
}
.ps-v22-btn-buy:hover {
background: #3153f5;
transform: translateY(-1px);
}
.ps-v22-btn-cart {
background: #fff;
color: #4466ff;
border: 2px solid #4466ff;
}
.ps-v22-btn-cart:hover {
background: rgba(68, 102, 255, 0.05);
transform: translateY(-1px);
}
.ps-v22-btn.is-disabled {
opacity: 0.45;
cursor: not-allowed;
transform: none !important;
}
.ps-v22-accordion-area {
padding-bottom: 8px;
}
.ps-v22-summary {
padding: 18px 24px;
font-size: 14px;
font-weight: 600;
color: #1d1d1f;
cursor: pointer;
display: flex;
justify-content: space-between;
list-style: none;
}
.ps-v22-summary::-webkit-details-marker {
display: none;
}
.ps-v22-icon {
color: #86868b;
font-size: 18px;
transition: 0.3s;
}
.ps-v22-details[open] .ps-v22-icon {
transform: rotate(45deg);
}
.ps-v22-content {
padding: 0 24px 20px 24px;
font-size: 13px;
color: #6a6a6a;
line-height: 1.6;
}
.ps-v22-details {
border-top: 1px solid #f2f2f2;
}
@media (max-width: 768px) {
.ps-v22-grid-4 {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.ps-v22-logistics-grid {
grid-template-columns: repeat(2, 1fr) !important;
gap: 6px !important;
}
.ps-v22-performance-row {
grid-template-columns: 1fr;
gap: 8px;
}
.ps-v22-feature-card {
min-height: 64px;
padding: 14px;
}
.ps-v22-feature-main {
font-size: 18px;
}
.ps-v22-feature-small {
align-items: flex-start;
text-align: left;
}
.ps-v32-m-grid {
grid-template-columns: repeat(3, 1fr) !important;
gap: 6px !important;
}
.ps-v22-sec {
padding: 16px;
}
.ps-v22-compact-gap {
padding-top: 4px !important;
padding-bottom: 10px !important;
}
.ps-v22-fold-summary {
padding: 16px;
}
.ps-v22-num {
font-size: 32px;
}
.ps-v22-days {
font-size: 18px !important;
}
.ps-v22-global-note {
font-size: 12px;
padding: 11px 12px;
}
.ps-v22-checkout-final {
padding-top: 22px;
padding-bottom: 24px;
}
.ps-v22-p-main {
font-size: 30px;
}
.ps-v22-sw-pill {
min-width: 84px;
height: 44px;
font-size: 12px;
}
.ps-v32-qty-row {
gap: 10px;
margin-bottom: 24px;
}
.ps-v32-capsule-box {
width: 120px;
height: 44px;
}
.ps-v22-btn {
height: 52px;
font-size: 14px;
}
}
</style>
<script>
let v22CurrentVariantId = {{ product.selected_or_first_available_variant.id }};
let v22CurrentAvailable = {% if product.selected_or_first_available_variant.available %}true{% else %}false{% endif %};
function v22SelectVariant(btn) {
if (!btn || btn.disabled) return;
document.querySelectorAll('.ps-v22-sw-pill').forEach(el => {
el.classList.remove('is-active');
});
btn.classList.add('is-active');
v22CurrentVariantId = btn.getAttribute('data-variant-id');
v22CurrentAvailable = btn.getAttribute('data-available') === 'true';
const price = btn.getAttribute('data-price');
const comparePrice = btn.getAttribute('data-compare-price');
const inventory = btn.getAttribute('data-inventory');
const priceEl = document.getElementById('v22-current-price');
const compareEl = document.getElementById('v22-compare-price');
const inventoryEl = document.getElementById('v22-inventory-text');
const buyBtn = document.getElementById('v22-buy-btn');
const cartBtn = document.getElementById('v22-cart-btn');
if (priceEl && price) {
priceEl.innerText = price;
}
if (compareEl) {
if (comparePrice && comparePrice.trim() !== '') {
compareEl.innerText = comparePrice;
compareEl.style.display = 'inline';
} else {
compareEl.innerText = '';
compareEl.style.display = 'none';
}
}
if (inventoryEl) {
inventoryEl.innerText = `(Inventory: ${inventory || 0})`;
}
if (buyBtn && cartBtn) {
if (v22CurrentAvailable) {
buyBtn.disabled = false;
cartBtn.disabled = false;
buyBtn.classList.remove('is-disabled');
cartBtn.classList.remove('is-disabled');
buyBtn.innerText = 'Buy It Now';
cartBtn.innerText = 'Add to cart';
} else {
buyBtn.disabled = true;
cartBtn.disabled = true;
buyBtn.classList.add('is-disabled');
cartBtn.classList.add('is-disabled');
buyBtn.innerText = 'Sold Out';
cartBtn.innerText = 'Sold Out';
}
}
if (window.history && window.history.replaceState) {
const url = new URL(window.location.href);
url.searchParams.set('variant', v22CurrentVariantId);
window.history.replaceState({}, '', url.toString());
}
}
function v22Animate(el, target, dur = 800) {
if (!el || el.isRolling) return;
el.isRolling = true;
const start = performance.now();
const tVal = parseInt(target, 10);
function upd(now) {
const elapsed = now - start;
const prog = Math.min(elapsed / dur, 1);
const ease = prog === 1 ? 1 : 1 - Math.pow(2, -10 * prog);
const cur = Math.floor(ease * tVal);
if (target === '75') {
el.innerHTML = cur + '<small>MPH</small>';
} else if (target === '5') {
el.innerHTML = cur + '<small>H</small>';
} else if (target === '6') {
el.innerHTML = '<span>±</span>' + cur;
} else {
el.innerHTML = cur;
}
if (prog < 1) {
requestAnimationFrame(upd);
} else {
el.isRolling = false;
}
}
requestAnimationFrame(upd);
}
function v22Roll(box) {
const n = box.querySelector('.ps-v22-num');
if (n) {
v22Animate(n, n.getAttribute('data-target'));
}
}
function v22Qty(delta) {
const inp = document.getElementById('v22-qty');
if (!inp) return;
let cur = parseInt(inp.value, 10) + delta;
if (cur < 1) cur = 1;
inp.value = cur;
}
function handleV22Buy() {
if (!v22CurrentAvailable) return;
const qtyInput = document.getElementById('v22-qty');
const qty = qtyInput ? qtyInput.value : 1;
window.location.href = `/cart/add?id=${v22CurrentVariantId}&quantity=${qty}`;
}
function handleV22Cart() {
if (!v22CurrentAvailable) return;
const qtyInput = document.getElementById('v22-qty');
const qty = qtyInput ? parseInt(qtyInput.value, 10) : 1;
fetch('/cart/add.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
items: [
{
id: Number(v22CurrentVariantId),
quantity: qty
}
]
})
}).then(() => {
window.location.href = '/cart';
});
}
(function() {
const obs = new IntersectionObserver((es) => {
es.forEach(e => {
if (e.isIntersecting) {
v22Animate(e.target, e.target.getAttribute('data-target'));
obs.unobserve(e.target);
}
});
}, { threshold: 0.5 });
document.querySelectorAll('.ps-v22-num').forEach(n => obs.observe(n));
})();
</script>