diff --git a/acrobat/blocks/unity/unity.js b/acrobat/blocks/unity/unity.js index 54272e65..b2d66d1a 100644 --- a/acrobat/blocks/unity/unity.js +++ b/acrobat/blocks/unity/unity.js @@ -1,3 +1,5 @@ +import LIMITS from '../verb-widget/limits.js'; + const localeMap = { '': 'en-us', br: 'pt-br', @@ -98,12 +100,23 @@ function getUnityLibs(prodLibs = '/unitylibs') { && !hostname.includes('localhost')) { return prodLibs; } + // eslint-disable-next-line compat/compat const branch = new URLSearchParams(window.location.search).get('unitylibs') || 'main'; if (branch.indexOf('--') > -1) return `https://${branch}.hlx.live/unitylibs`; return `https://${branch}--unity--adobecom.hlx.live/unitylibs`; } export default async function init(el) { + let mobileApp; + if ((/iPad|iPhone|iPod/.test(window.browser?.ua) && !window.MSStream) + || /android/i.test(window.browser?.ua)) { + mobileApp = true; + } + + const element = el.querySelector('span'); + const verb = element.classList[1].replace('icon-', ''); + if (mobileApp && LIMITS[verb].mobileApp) return; + const unitylibs = getUnityLibs(); const langFromPath = window.location.pathname.split('/')[1]; const languageCode = localeMap[langFromPath] ? localeMap[langFromPath].split('-')[0] : 'en'; diff --git a/acrobat/blocks/verb-widget/verb-widget.css b/acrobat/blocks/verb-widget/verb-widget.css index ef488a2a..057e96f6 100644 --- a/acrobat/blocks/verb-widget/verb-widget.css +++ b/acrobat/blocks/verb-widget/verb-widget.css @@ -236,6 +236,13 @@ margin-left: 15px; } +.verb-mobile-cta:hover, +.verb-mobile-cta:active { + background-color: #0054b6; + color: #fff; + text-decoration: none; +} + @media screen and (min-width: 768px) { .verb-container { align-items: center; @@ -246,11 +253,10 @@ } .verb-mobile-cta { - /* display: none; */ background: #1473e6; border-radius: 8px; padding: 11px 27px; - color: white; + color: #fff; white-space: nowrap; font-weight: 700; display: flex;