* { box-sizing: border-box; } body { margin: 0; background: #ffffff; color: #101010; font-family: Arial, Helvetica, sans-serif; } .promo-code-widget { width: 900px; max-width: calc(100% – 36px); min-height: 190px; margin: 8px auto; padding: 30px; border: 1px solid #e5e5e5; background: #ffffff; } .promo-card { min-height: 81px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 14px 18px 14px 20px; margin-bottom: 30px; border: 1px solid #e5e5e5; border-radius: 11px; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04); } .promo-card-copy { display: flex; flex-direction: column; flex: 1; } .promo-card-copy strong { margin-bottom: 2px; font-size: 21px; line-height: 1.2; } .promo-card-copy span { font-size: 12px; color: #7d5260; } .promo-input { width: 330px; height: 44px; padding: 0 14px; border: 1px solid #b8b8b8; border-radius: 5px; font-size: 16px; text-transform: uppercase; outline: none; } .promo-input:focus { border-color: #9d2038; box-shadow: 0 0 0 2px rgba(157, 32, 56, 0.12); } .promo-button { width: 100%; height: 45px; border: 0; border-radius: 24px; background: #9d2038; color: #ffffff; font-family: Georgia, “Times New Roman”, serif; font-size: 16px; font-weight: 700; cursor: pointer; } .promo-button:hover { background: #861b30; } .promo-error { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: #9d2038; } @media (max-width: 700px) { .promo-code-widget { padding: 20px; } .promo-card { align-items: stretch; flex-direction: column; gap: 14px; } .promo-input { width: 100%; } }
const BASE_URL = “https://subscribe.arcade.moneyweek.com/uk/moneyweek-subscription/dp/35dcc931?promo=”; const input = document.getElementById(“promoCode”); const button = document.getElementById(“promoSubmit”); const error = document.getElementById(“promoError”); function submitPromo() { const code = input.value.trim().toUpperCase(); if (!code) { error.textContent = “Please enter a promo code.”; return; } error.textContent = “”; const destination = BASE_URL + encodeURIComponent(code); window.open(destination, “_blank”, “noopener,noreferrer”); } button.addEventListener(“click”, submitPromo); input.addEventListener(“keydown”, (event) => { if (event.key === “Enter”) { submitPromo(); } }); function sendMessageToParentWindow(typeOfMessage, message = null) { let postMessage = { bordeaux: message }; let url = “http://crow.futurecdn.net/output/moneyweek-promo-widget-1/moneyweek-promo-widget(1).html”; if (typeOfMessage === “analytics”) { postMessage = { analytics: { …message } }; } if (postMessage !== {}) { window.parent.postMessage( postMessage, url ); } } let message = { targeting: { [“moneyweek-promo-widget(1).html”]: “MoneyWeek Promo Code Widget” } } window.onload = sendMessageToParentWindow(“bordeaux”, message);