File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1- function guessDownloadTab ( ) {
2- if ( navigator . appVersion . indexOf ( 'iPhone' ) !== - 1 || navigator . appVersion . indexOf ( 'iPad' ) !== - 1 || navigator . appVersion . indexOf ( 'iPod' ) !== - 1 ) {
3- return 'ios' ;
1+ function guessDownloadTab ( locationHash ) {
2+ if ( locationHash === '#win' || locationHash === '#mac' || locationHash === '#linux' || locationHash === '#android' || locationHash === '#ios' ) {
3+ return locationHash ;
4+ } else if ( navigator . appVersion . indexOf ( 'iPhone' ) !== - 1 || navigator . appVersion . indexOf ( 'iPad' ) !== - 1 || navigator . appVersion . indexOf ( 'iPod' ) !== - 1 ) {
5+ return '#ios' ;
46 } else if ( navigator . appVersion . indexOf ( 'Android' ) !== - 1 ) {
5- return 'android' ;
7+ return '# android' ;
68 } else if ( navigator . appVersion . indexOf ( 'Linux' ) !== - 1 || navigator . appVersion . indexOf ( 'X11' ) !== - 1 ) {
7- return 'linux' ;
9+ return '# linux' ;
810 } else if ( navigator . appVersion . indexOf ( 'Mac' ) !== - 1 ) {
9- return 'mac' ;
11+ return '# mac' ;
1012 } else {
11- return 'win' ;
13+ return '# win' ;
1214 }
1315}
Original file line number Diff line number Diff line change 22 < link rel ="dns-prefetch " href ="https://github.com ">
33{{ end }}
44{{ define "main" }}
5- < div x-data ="{ tab: guessDownloadTab() } " x-cloak >
5+ < div x-data ="{ tab: guessDownloadTab(location.hash ) } " x-init =" location.hash = tab || '#win' " @hashchange.window =" tab = guessDownloadTab(location.hash) " >
66 {{ range .Pages }}
7- < section x-show ="tab === '{{ .Slug }}' " class ="container flex flex-wrap items-center py-12 min-h-[66vh] ">
7+ < section x-show ="tab === '# {{ .Slug }}' " class ="container flex flex-wrap items-center py-12 min-h-[66vh] ">
88 < figure class ="w-full md:w-1/2 lg:w-auto mx-auto pr-0 md:pr-8 ">
99 < img class ="lazyload " data-src ="{{ .Params.Screenshot }} " data-srcset ="{{ .Params.Screenshot }} 1x, {{ .Params.Screenshot2x }} 2x "/>
1010 </ figure >
1616 < div class ="container flex flex-wrap justify-center text-white p-2 ">
1717 {{ range $index, $element := .Pages }}
1818 < div class ="w-1/3 md:w-1/5 p-2 ">
19- < button :class ="{ 'text-primary hover:text-primary focus:text-primary border-primary hover:border-primary focus:border-primary ': tab === '{{ .Slug }}' } " @click ="tab = '{{ .Slug }}' " class ="btn btn-outline-gray-500 px-2 w-full whitespace-nowrap "> {{ safeHTML .Params.ButtonLabel }}</ button >
19+ < button :class ="{ 'text-gray-800 border-gray-400 bg-gray-400 ': tab === '# {{ .Slug }}' } " @click ="location.hash = '# {{ .Slug }}' " class ="btn btn-outline-gray-500 px-2 w-full whitespace-nowrap "> {{ safeHTML .Params.ButtonLabel }}</ button >
2020 </ div >
2121 {{ end }}
2222 </ div >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ <h1 class="font-h1 mb-8">{{ .Title }}</h1>
55 < p class ="lead "> {{ .Description }}</ p >
66 </ header >
77
8- < div x-data ="{planOption: location.hash} " @hashchange.window ="planOption = location.hash " class ="py-12 ">
8+ < div x-data ="{planOption: location.hash} " x-init =" location.hash = planOption || '#for-individuals' " @hashchange.window ="planOption = location.hash " class ="py-12 ">
99 < header class ="text-center ">
1010 < h2 class ="text-center font-h2 mb-4 ">
1111 {{ i18n "pricing_title" . }}
@@ -95,7 +95,7 @@ <h2 class="text-center font-h2 mb-4">
9595 < p class ="text-sm md:text-base text-gray-500 mb-4 ">
9696 {{ i18n "pricing_android_price_description" . }}
9797 </ p >
98- < a href ="{{ .Site.LanguagePrefix }}/downloads/ " role ="button " class ="btn btn-primary w-full " data-umami-event ="pricing-android-cta ">
98+ < a href ="{{ .Site.LanguagePrefix }}/downloads/#android " role ="button " class ="btn btn-primary w-full " data-umami-event ="pricing-android-cta ">
9999 {{ i18n "pricing_android_cta" . }}
100100 </ a >
101101 </ div >
@@ -151,7 +151,7 @@ <h2 class="text-center font-h2 mb-4">
151151 </ p >
152152 </ div >
153153 </ div >
154- < a href ="{{ .Site.LanguagePrefix }}/downloads/ " role ="button " class ="btn btn-primary w-full " data-umami-event ="pricing-ios-cta ">
154+ < a href ="{{ .Site.LanguagePrefix }}/downloads/#ios " role ="button " class ="btn btn-primary w-full " data-umami-event ="pricing-ios-cta ">
155155 {{ i18n "pricing_ios_cta" . }}
156156 </ a >
157157 </ div >
You can’t perform that action at this time.
0 commit comments