File tree 3 files changed +15
-13
lines changed
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' ;
4
6
} else if ( navigator . appVersion . indexOf ( 'Android' ) !== - 1 ) {
5
- return 'android' ;
7
+ return '# android' ;
6
8
} else if ( navigator . appVersion . indexOf ( 'Linux' ) !== - 1 || navigator . appVersion . indexOf ( 'X11' ) !== - 1 ) {
7
- return 'linux' ;
9
+ return '# linux' ;
8
10
} else if ( navigator . appVersion . indexOf ( 'Mac' ) !== - 1 ) {
9
- return 'mac' ;
11
+ return '# mac' ;
10
12
} else {
11
- return 'win' ;
13
+ return '# win' ;
12
14
}
13
15
}
Original file line number Diff line number Diff line change 2
2
< link rel ="dns-prefetch " href ="https://github.com ">
3
3
{{ end }}
4
4
{{ 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) " >
6
6
{{ 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] ">
8
8
< figure class ="w-full md:w-1/2 lg:w-auto mx-auto pr-0 md:pr-8 ">
9
9
< img class ="lazyload " data-src ="{{ .Params.Screenshot }} " data-srcset ="{{ .Params.Screenshot }} 1x, {{ .Params.Screenshot2x }} 2x "/>
10
10
</ figure >
16
16
< div class ="container flex flex-wrap justify-center text-white p-2 ">
17
17
{{ range $index, $element := .Pages }}
18
18
< 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 >
20
20
</ div >
21
21
{{ end }}
22
22
</ div >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ <h1 class="font-h1 mb-8">{{ .Title }}</h1>
5
5
< p class ="lead "> {{ .Description }}</ p >
6
6
</ header >
7
7
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 ">
9
9
< header class ="text-center ">
10
10
< h2 class ="text-center font-h2 mb-4 ">
11
11
{{ i18n "pricing_title" . }}
@@ -95,7 +95,7 @@ <h2 class="text-center font-h2 mb-4">
95
95
< p class ="text-sm md:text-base text-gray-500 mb-4 ">
96
96
{{ i18n "pricing_android_price_description" . }}
97
97
</ 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 ">
99
99
{{ i18n "pricing_android_cta" . }}
100
100
</ a >
101
101
</ div >
@@ -151,7 +151,7 @@ <h2 class="text-center font-h2 mb-4">
151
151
</ p >
152
152
</ div >
153
153
</ 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 ">
155
155
{{ i18n "pricing_ios_cta" . }}
156
156
</ a >
157
157
</ div >
You can’t perform that action at this time.
0 commit comments