@kompasid/lit-web-components 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/index.html +1 -1
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.d.ts +32 -2
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.js +110 -4
- package/dist/src/components/kompasid-grace-period/KompasGracePeriod.js.map +1 -1
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +136 -186
- package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
- package/dist/tailwind/tailwind.js +117 -22
- package/dist/tailwind/tailwind.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/kompasid-grace-period/KompasGracePeriod.ts +74 -3
- package/src/components/kompasid-grace-period/readme.md +21 -7
- package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +186 -188
- package/tailwind/tailwind.css +117 -22
- package/tailwind/tailwind.ts +117 -22
|
@@ -28,6 +28,10 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
28
28
|
align-items: center;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.z-index-max {
|
|
32
|
+
z-index: 999999;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
.font-lora {
|
|
32
36
|
font-family: 'Lora', 'Georgia', 'serif';
|
|
33
37
|
}
|
|
@@ -155,6 +159,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
155
159
|
default:
|
|
156
160
|
source = 'article'
|
|
157
161
|
}
|
|
162
|
+
|
|
158
163
|
const directUrlCheckout: string = `${url}${originHost}&source=${source}`
|
|
159
164
|
window.open(directUrlCheckout)
|
|
160
165
|
}
|
|
@@ -614,22 +619,20 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
614
619
|
|
|
615
620
|
private headerSection(type: PaywallType, title: string) {
|
|
616
621
|
let buttonContent
|
|
622
|
+
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'
|
|
623
|
+
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'
|
|
617
624
|
|
|
618
625
|
if (type === 'epaper') {
|
|
619
626
|
buttonContent = html` <button
|
|
620
627
|
@click=${this.redirectToPrevUrl}
|
|
621
|
-
class="hidden md:block w-8 h-8 pl-4 ${
|
|
622
|
-
? 'text-blue-300'
|
|
623
|
-
: 'text-blue-600'}"
|
|
628
|
+
class="hidden md:block w-8 h-8 pl-4 ${textColorClass}"
|
|
624
629
|
>
|
|
625
630
|
${unsafeSVG(getFontAwesomeIcon('fas', 'arrow-left'))}
|
|
626
631
|
</button>`
|
|
627
632
|
} else if (type === 'audio') {
|
|
628
633
|
buttonContent = html` <button
|
|
629
634
|
@click=${this.togglePaywall}
|
|
630
|
-
class="hidden md:block w-8 h-8 pl-4 ${
|
|
631
|
-
? 'text-blue-300'
|
|
632
|
-
: 'text-blue-600'}"
|
|
635
|
+
class="hidden md:block w-8 h-8 pl-4 ${textColorClass}"
|
|
633
636
|
>
|
|
634
637
|
${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}
|
|
635
638
|
</button>`
|
|
@@ -637,9 +640,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
637
640
|
buttonContent = nothing
|
|
638
641
|
}
|
|
639
642
|
|
|
640
|
-
const headerClass = `text-base flex justify-center self-center md:block md:text-xl ${
|
|
641
|
-
this.isDark ? 'text-white' : 'text-grey-600'
|
|
642
|
-
} text-center font-lora font-bold tracking-wide md:tracking-normal max-w-xs sm:max-w-lg md:w-full md:max-w-full ${
|
|
643
|
+
const headerClass = `text-base flex justify-center self-center md:block md:text-xl ${buttonTextColorClass} text-center font-lora font-bold tracking-wide md:tracking-normal max-w-xs sm:max-w-lg md:w-full md:max-w-full ${
|
|
643
644
|
type === 'audio' && 'sm:px-16 md:px-20'
|
|
644
645
|
}`
|
|
645
646
|
|
|
@@ -655,19 +656,22 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
655
656
|
}
|
|
656
657
|
|
|
657
658
|
private descriptionSection(data: Array<string>) {
|
|
658
|
-
|
|
659
|
-
|
|
659
|
+
const spaceYClass =
|
|
660
|
+
this.type === 'audio' ? 'space-y-2 md:space-y-1' : 'space-y-2'
|
|
661
|
+
const textColorClass = this.isDark ? 'text-green-400' : 'text-green-500'
|
|
662
|
+
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'
|
|
663
|
+
|
|
664
|
+
return html` <div class=" flex flex-col items-center">
|
|
665
|
+
<div class="flex flex-col md:max-w-[464px] mt-2.5 md:mt-3 ${spaceYClass}">
|
|
660
666
|
${data.map(
|
|
661
667
|
item =>
|
|
662
668
|
html`
|
|
663
669
|
<div class="flex items-center">
|
|
664
|
-
<div class
|
|
670
|
+
<div class="${textColorClass}">
|
|
665
671
|
${unsafeSVG(getFontAwesomeIcon('fas', 'check', 12, 12))}
|
|
666
672
|
</div>
|
|
667
673
|
<h6
|
|
668
|
-
class="text-xs md:text-base ${
|
|
669
|
-
? 'text-white'
|
|
670
|
-
: 'text-grey-600'} ml-0.5 md:ml-1"
|
|
674
|
+
class="text-xs md:text-base ml-0.5 md:ml-1 ${buttonTextColorClass}"
|
|
671
675
|
>
|
|
672
676
|
${item}
|
|
673
677
|
</h6>
|
|
@@ -679,12 +683,13 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
679
683
|
}
|
|
680
684
|
|
|
681
685
|
private informationPackages() {
|
|
682
|
-
|
|
686
|
+
const marginTopClass = this.type === 'audio' ? 'mt-4 md:mt-2' : 'mt-4'
|
|
687
|
+
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'
|
|
688
|
+
|
|
689
|
+
return html` <div class="flex justify-center ${marginTopClass}">
|
|
683
690
|
<button
|
|
684
691
|
@click=${this.otherPackagesClicked}
|
|
685
|
-
class="text-sm md:text-base font-bold ${
|
|
686
|
-
? 'text-blue-300'
|
|
687
|
-
: 'text-blue-600'} underline"
|
|
692
|
+
class="text-sm md:text-base font-bold underline ${textColorClass}"
|
|
688
693
|
>
|
|
689
694
|
Lihat Paket Lainnya
|
|
690
695
|
</button>
|
|
@@ -692,6 +697,9 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
692
697
|
}
|
|
693
698
|
|
|
694
699
|
private epaperRegistrationSection() {
|
|
700
|
+
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'
|
|
701
|
+
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'
|
|
702
|
+
|
|
695
703
|
return html`
|
|
696
704
|
<div>
|
|
697
705
|
<button
|
|
@@ -700,50 +708,41 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
700
708
|
loc: 'hard_paywall',
|
|
701
709
|
next: this.epaperHost + window.location.pathname,
|
|
702
710
|
})}
|
|
703
|
-
class="text-sm md:text-base font-bold ${
|
|
704
|
-
? 'text-blue-300'
|
|
705
|
-
: 'text-blue-600'} underline"
|
|
711
|
+
class="text-sm md:text-base font-bold underline ${textColorClass}"
|
|
706
712
|
>
|
|
707
713
|
Masuk
|
|
708
714
|
</button>
|
|
709
|
-
<span class
|
|
710
|
-
jika sudah berlangganan.</span
|
|
711
|
-
>
|
|
715
|
+
<span class="${buttonTextColorClass}">jika sudah berlangganan.</span>
|
|
712
716
|
</div>
|
|
713
717
|
`
|
|
714
718
|
}
|
|
715
719
|
|
|
716
720
|
private regulerRegistrationSection() {
|
|
721
|
+
const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'
|
|
722
|
+
const buttonTextColorClass = this.isDark ? 'text-white' : 'text-grey-600'
|
|
723
|
+
|
|
717
724
|
return html`
|
|
718
725
|
<div class="flex flex-col items-center justify-center">
|
|
719
726
|
<div>
|
|
720
727
|
<button
|
|
721
728
|
@click=${() => redirectToRegister('hard_paywall')}
|
|
722
|
-
class="text-sm md:text-base font-bold ${
|
|
723
|
-
? 'text-blue-300'
|
|
724
|
-
: 'text-blue-600'} underline"
|
|
729
|
+
class="text-sm md:text-base font-bold underline ${textColorClass}"
|
|
725
730
|
>
|
|
726
731
|
Daftar
|
|
727
732
|
</button>
|
|
728
|
-
<span class
|
|
729
|
-
untuk kuota artikel gratis</span
|
|
733
|
+
<span class="${buttonTextColorClass}"
|
|
734
|
+
>untuk kuota artikel gratis</span
|
|
730
735
|
>
|
|
731
736
|
</div>
|
|
732
737
|
<div>
|
|
733
|
-
<span class
|
|
734
|
-
>atau
|
|
735
|
-
</span>
|
|
738
|
+
<span class="${buttonTextColorClass}">atau</span>
|
|
736
739
|
<button
|
|
737
740
|
@click=${() => redirectToLogin({ loc: 'hard_paywall' })}
|
|
738
|
-
class="text-sm md:text-base font-bold ${
|
|
739
|
-
? 'text-blue-300'
|
|
740
|
-
: 'text-blue-600'} underline"
|
|
741
|
+
class="text-sm md:text-base font-bold underline ${textColorClass}"
|
|
741
742
|
>
|
|
742
743
|
Masuk
|
|
743
744
|
</button>
|
|
744
|
-
<span class
|
|
745
|
-
jika sudah punya akun.</span
|
|
746
|
-
>
|
|
745
|
+
<span class="${buttonTextColorClass}">jika sudah punya akun.</span>
|
|
747
746
|
</div>
|
|
748
747
|
</div>
|
|
749
748
|
`
|
|
@@ -758,19 +757,20 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
758
757
|
private paymentMobileExtension(data: Array<PaymentImage>) {
|
|
759
758
|
return html`
|
|
760
759
|
<div
|
|
761
|
-
class="w-full ${this.isDark
|
|
760
|
+
class="w-full max-w-xs mb-1 ml-8 md:hidden absolute px-4 ${this.isDark
|
|
762
761
|
? '-bottom-6'
|
|
763
|
-
: 'bottom-0'}
|
|
762
|
+
: 'bottom-0'}"
|
|
764
763
|
>
|
|
765
764
|
<div
|
|
766
|
-
class="w-full ${this.isDark
|
|
765
|
+
class="w-full rounded p-3 max-w-xs ${this.isDark
|
|
767
766
|
? 'bg-dark-6 border-dark-6'
|
|
768
|
-
: 'bg-white border-white'}
|
|
767
|
+
: 'bg-white border-white'}"
|
|
769
768
|
>
|
|
770
769
|
<svg
|
|
771
|
-
class="right-0 ${this
|
|
770
|
+
class="right-0 h-4 mr-10 -mt-7 z-0 transform rotate-180 absolute ${this
|
|
771
|
+
.isDark
|
|
772
772
|
? 'text-dark-6 border-dark-6'
|
|
773
|
-
: 'text-white border-white '}
|
|
773
|
+
: 'text-white border-white '}"
|
|
774
774
|
x="0px"
|
|
775
775
|
y="0px"
|
|
776
776
|
viewBox="0 0 255 255"
|
|
@@ -778,7 +778,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
778
778
|
<polygon class="fill-current" points="0,0 127.5,127.5 255,0" />
|
|
779
779
|
</svg>
|
|
780
780
|
<div
|
|
781
|
-
class="grid place-items-center items-center grid-flow-row grid-cols-5 grid-rows-2
|
|
781
|
+
class="grid place-items-center items-center grid-flow-row grid-cols-5 grid-rows-2 gap-y-4"
|
|
782
782
|
>
|
|
783
783
|
${data.map(
|
|
784
784
|
item =>
|
|
@@ -795,34 +795,38 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
private primaryPackages(product: Product) {
|
|
798
|
+
const { isDark } = this
|
|
799
|
+
const isAudio = this.type === 'audio'
|
|
800
|
+
|
|
801
|
+
const containerClass = `flex flex-wrap justify-between h-[68px] items-center rounded-lg md:mx-0 w-full max-w-xs md:max-w-sm md:w-3/5 mt-2.5${
|
|
802
|
+
isDark ? ' bg-grey-600' : ' bg-white'
|
|
803
|
+
}${isAudio ? ' md:mt-3' : ' md:mt-4'} border border-yellow-400 relative`
|
|
804
|
+
|
|
805
|
+
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'
|
|
806
|
+
|
|
807
|
+
const buttonClass = `h-8 rounded mr-4 flex items-center${
|
|
808
|
+
isDark ? ' bg-green-300 border border-green-400' : ' bg-green-500'
|
|
809
|
+
}`
|
|
810
|
+
|
|
811
|
+
const buttonTextClass = `text-xs md:text-sm font-bold py-2 px-4${
|
|
812
|
+
isDark ? ' text-black' : ' text-white'
|
|
813
|
+
}`
|
|
814
|
+
|
|
798
815
|
return html`
|
|
799
|
-
<div
|
|
800
|
-
class="flex flex-wrap justify-between h-[68px] items-center ${this
|
|
801
|
-
.isDark
|
|
802
|
-
? 'bg-grey-600'
|
|
803
|
-
: 'bg-white'} rounded-lg md:mx-0 w-full max-w-xs md:max-w-sm md:w-3/5 mt-2.5 md:mt-4 border border-yellow-400 relative"
|
|
804
|
-
>
|
|
816
|
+
<div class="${containerClass}">
|
|
805
817
|
<div class="flex flex-col py-3 px-4">
|
|
806
818
|
<div class="flex flex-none items-center">
|
|
807
819
|
<h5 class="text-base md:text-lg font-bold text-orange-400">
|
|
808
820
|
${formatRupiah(product.price)}
|
|
809
821
|
</h5>
|
|
810
|
-
<h6
|
|
811
|
-
class="text-xs md:text-base ${this.isDark
|
|
812
|
-
? 'text-dark-7'
|
|
813
|
-
: 'text-grey-600'} font-bold pl-1"
|
|
814
|
-
>
|
|
822
|
+
<h6 class="text-xs md:text-base font-bold pl-1 ${textColorClass}">
|
|
815
823
|
/ ${product.periode}
|
|
816
824
|
</h6>
|
|
817
825
|
</div>
|
|
818
826
|
${product.savingPrice
|
|
819
827
|
? html`
|
|
820
828
|
<div class="flex items-center">
|
|
821
|
-
<p
|
|
822
|
-
class="text-xs ${this.isDark
|
|
823
|
-
? 'text-dark-7'
|
|
824
|
-
: 'text-grey-600'}"
|
|
825
|
-
>
|
|
829
|
+
<p class="text-xs ${textColorClass}">
|
|
826
830
|
hanya
|
|
827
831
|
<span class="text-orange-400"
|
|
828
832
|
>${formatRupiah(product.savingPrice)}</span
|
|
@@ -834,9 +838,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
834
838
|
: nothing}
|
|
835
839
|
</div>
|
|
836
840
|
<button
|
|
837
|
-
class="
|
|
838
|
-
? 'bg-green-300 border border-green-400'
|
|
839
|
-
: 'bg-green-500'} rounded mr-4 flex items-center"
|
|
841
|
+
class="${buttonClass}"
|
|
840
842
|
@click=${() =>
|
|
841
843
|
this.redirectToCheckout(
|
|
842
844
|
product.url,
|
|
@@ -846,13 +848,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
846
848
|
product.position
|
|
847
849
|
)}
|
|
848
850
|
>
|
|
849
|
-
<h6
|
|
850
|
-
class="text-xs md:text-sm ${this.isDark
|
|
851
|
-
? 'text-black'
|
|
852
|
-
: 'text-white'} font-bold py-2 px-4"
|
|
853
|
-
>
|
|
854
|
-
Langganan
|
|
855
|
-
</h6>
|
|
851
|
+
<h6 class="${buttonTextClass}">Langganan</h6>
|
|
856
852
|
</button>
|
|
857
853
|
<div class="absolute -top-2 left-4">
|
|
858
854
|
<div class="rounded bg-yellow-300 px-2 py-0.5 text-xs">
|
|
@@ -864,33 +860,38 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
864
860
|
}
|
|
865
861
|
|
|
866
862
|
private secondaryPackages(product: Product) {
|
|
863
|
+
const { isDark } = this
|
|
864
|
+
const isAudio = this.type === 'audio'
|
|
865
|
+
|
|
866
|
+
const containerClass = `flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${
|
|
867
|
+
isDark ? ' bg-grey-600' : ' bg-white'
|
|
868
|
+
}${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`
|
|
869
|
+
|
|
870
|
+
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-600'
|
|
871
|
+
|
|
872
|
+
const buttonClass = `h-8 rounded border border-green-500${
|
|
873
|
+
isDark ? ' text-green-300' : ' bg-white text-green-500'
|
|
874
|
+
}`
|
|
875
|
+
|
|
876
|
+
const buttonTextClass = `text-xs md:text-sm font-bold px-4${
|
|
877
|
+
isDark ? ' text-green-300' : ' text-green-500'
|
|
878
|
+
}`
|
|
879
|
+
|
|
867
880
|
return html`
|
|
868
|
-
<div
|
|
869
|
-
class="flex flex-wrap items-center justify-between ${this.isDark
|
|
870
|
-
? 'bg-grey-600'
|
|
871
|
-
: 'bg-white'} py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4"
|
|
872
|
-
>
|
|
881
|
+
<div class="${containerClass}">
|
|
873
882
|
<div class="flex flex-col">
|
|
874
883
|
<div class="flex items-center">
|
|
875
884
|
<h5 class="text-base md:text-lg font-bold text-orange-400">
|
|
876
885
|
${formatRupiah(product.price)}
|
|
877
886
|
</h5>
|
|
878
|
-
<h6
|
|
879
|
-
class="text-xs md:text-base ${this.isDark
|
|
880
|
-
? 'text-dark-7'
|
|
881
|
-
: 'text-grey-600'} font-bold pl-1"
|
|
882
|
-
>
|
|
887
|
+
<h6 class="text-xs md:text-base font-bold pl-1 ${textColorClass}">
|
|
883
888
|
/ ${product.periode}
|
|
884
889
|
</h6>
|
|
885
890
|
</div>
|
|
886
891
|
${product.savingPrice
|
|
887
892
|
? html`
|
|
888
893
|
<div class="flex items-center">
|
|
889
|
-
<p
|
|
890
|
-
class="text-xs ${this.isDark
|
|
891
|
-
? 'text-dark-7'
|
|
892
|
-
: 'text-grey-600'}"
|
|
893
|
-
>
|
|
894
|
+
<p class="text-xs ${textColorClass}">
|
|
894
895
|
hanya
|
|
895
896
|
<span class="text-orange-400"
|
|
896
897
|
>${formatRupiah(product.savingPrice)}</span
|
|
@@ -910,16 +911,9 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
910
911
|
product.price,
|
|
911
912
|
product.position
|
|
912
913
|
)}
|
|
913
|
-
class="
|
|
914
|
-
'bg-white'} border border-green-500 rounded"
|
|
914
|
+
class="${buttonClass}"
|
|
915
915
|
>
|
|
916
|
-
<h6
|
|
917
|
-
class="text-xs md:text-sm ${this.isDark
|
|
918
|
-
? 'text-green-300'
|
|
919
|
-
: 'text-green-500'} font-bold px-4"
|
|
920
|
-
>
|
|
921
|
-
Langganan
|
|
922
|
-
</h6>
|
|
916
|
+
<h6 class="${buttonTextClass}">Langganan</h6>
|
|
923
917
|
</button>
|
|
924
918
|
</div>
|
|
925
919
|
`
|
|
@@ -927,7 +921,7 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
927
921
|
|
|
928
922
|
private packagesSection(data: Packages) {
|
|
929
923
|
return html`
|
|
930
|
-
<div class="flex flex-col w-full items-center mt-8
|
|
924
|
+
<div class="flex flex-col w-full items-center mt-8 md:mt-2 px-4">
|
|
931
925
|
${data.memberships.map(item =>
|
|
932
926
|
item.isHighlight
|
|
933
927
|
? this.primaryPackages(item)
|
|
@@ -970,12 +964,10 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
970
964
|
}
|
|
971
965
|
|
|
972
966
|
private helpDesk() {
|
|
967
|
+
const textColorClass = this.isDark ? 'text-dark-7' : 'text-white'
|
|
968
|
+
|
|
973
969
|
return html`
|
|
974
|
-
<div
|
|
975
|
-
class="${this.isDark
|
|
976
|
-
? 'text-dark-7'
|
|
977
|
-
: 'text-white'} self-center text-xs md:text-sm"
|
|
978
|
-
>
|
|
970
|
+
<div class="self-center text-xs md:text-sm ${textColorClass}">
|
|
979
971
|
Butuh bantuan? Hubungi
|
|
980
972
|
<button
|
|
981
973
|
@click=${this.customerServiceClicked}
|
|
@@ -988,11 +980,14 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
988
980
|
}
|
|
989
981
|
|
|
990
982
|
private userAction() {
|
|
983
|
+
const isAudio = this.type === 'audio'
|
|
984
|
+
const paddingClass = isAudio ? 'md:py-3.5' : 'md:py-6'
|
|
985
|
+
const marginClass = isAudio ? 'md:mt-4' : 'md:mt-8'
|
|
986
|
+
const backgroundClass = this.isDark ? 'bg-dark-4' : 'bg-blue-600'
|
|
987
|
+
|
|
991
988
|
return html`
|
|
992
989
|
<div
|
|
993
|
-
class="flex py-5 px-8
|
|
994
|
-
? 'bg-dark-4'
|
|
995
|
-
: 'bg-blue-600'} w-full justify-evenly rounded-b-xl mt-6 md:mt-8 relative"
|
|
990
|
+
class="flex py-5 px-8 w-full justify-evenly rounded-b-xl mt-6 relative ${paddingClass} ${marginClass} ${backgroundClass}"
|
|
996
991
|
>
|
|
997
992
|
${this.helpDesk()}
|
|
998
993
|
</div>
|
|
@@ -1000,56 +995,55 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1000
995
|
}
|
|
1001
996
|
|
|
1002
997
|
private introductoryPrice() {
|
|
998
|
+
const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'
|
|
1003
999
|
return html` <div
|
|
1004
1000
|
class="flex space-x-1 h-5 md:h-max overflow-hidden md:flex-col md:space-x-0 items-center md:items-start md:justify-center"
|
|
1005
1001
|
>
|
|
1006
1002
|
<h5 class="text-base md:text-lg font-bold text-orange-400">Rp 10.000</h5>
|
|
1007
|
-
<p class="text-xs ${
|
|
1008
|
-
untuk 1 bulan pertama
|
|
1009
|
-
</p>
|
|
1003
|
+
<p class="text-xs ${textColorClass}">untuk 1 bulan pertama</p>
|
|
1010
1004
|
</div>`
|
|
1011
1005
|
}
|
|
1012
1006
|
|
|
1013
1007
|
private swgRegonText() {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
? 'text-dark-7'
|
|
1017
|
-
: 'text-grey-600'}"
|
|
1018
|
-
>
|
|
1008
|
+
const textColorClass = this.isDark ? 'text-dark-7' : 'text-grey-600'
|
|
1009
|
+
return html`<p class="text-xs leading-4 md:max-w-[137px] ${textColorClass}">
|
|
1019
1010
|
Berlangganan lebih mudah dengan Google
|
|
1020
1011
|
</p>`
|
|
1021
1012
|
}
|
|
1022
1013
|
|
|
1023
1014
|
private swgPackageSection() {
|
|
1015
|
+
const { isDark } = this
|
|
1016
|
+
const isAudio = this.type === 'audio'
|
|
1017
|
+
|
|
1018
|
+
const containerClass = `flex flex-col space-y-2 md:space-x-2 md:space-y-0 md:flex-row justify-between items-center py-3 px-4 rounded-lg md:mx-0 w-full h-[76px] md:h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3${
|
|
1019
|
+
isDark ? ' bg-grey-600' : ' bg-white'
|
|
1020
|
+
}${isAudio ? ' md:mt-2.5' : ' md:mt-4'}`
|
|
1021
|
+
|
|
1022
|
+
const buttonClass = `border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center${
|
|
1023
|
+
isDark ? ' bg-grey-600' : ' bg-grey-100 border-grey-100'
|
|
1024
|
+
}`
|
|
1025
|
+
|
|
1026
|
+
const textColorClass = isDark ? 'text-dark-7' : 'text-grey-500'
|
|
1027
|
+
|
|
1028
|
+
const googleImageSrc = isDark
|
|
1029
|
+
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/paywall-asset/google-white.png'
|
|
1030
|
+
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/paywall-asset/google.png'
|
|
1031
|
+
|
|
1024
1032
|
return html`
|
|
1025
|
-
<div
|
|
1026
|
-
class="flex flex-col space-y-2 md:space-x-2 md:space-y-0 md:flex-row justify-between items-center ${this
|
|
1027
|
-
.isDark
|
|
1028
|
-
? 'bg-grey-600'
|
|
1029
|
-
: 'bg-white'} py-3 px-4 rounded-lg md:mx-0 w-full h-[76px] md:h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4"
|
|
1030
|
-
>
|
|
1033
|
+
<div class="${containerClass}">
|
|
1031
1034
|
${this.isEntitledForIntroductoryPrice
|
|
1032
1035
|
? this.introductoryPrice()
|
|
1033
1036
|
: this.swgRegonText()}
|
|
1034
1037
|
<div>
|
|
1035
|
-
<button
|
|
1036
|
-
class="${this.isDark
|
|
1037
|
-
? 'bg-grey-600'
|
|
1038
|
-
: 'bg-grey-100 border-grey-100'} border space-x-2 justify-center border-grey-400 rounded-md px-[22px] md:px-6 shadow-sm flex h-max flex-row flex-nowrap py-[5.6px] md:py-1.5 items-center"
|
|
1039
|
-
id="subscribe-with-google"
|
|
1040
|
-
>
|
|
1038
|
+
<button class="${buttonClass}" id="subscribe-with-google">
|
|
1041
1039
|
<p
|
|
1042
|
-
class="${
|
|
1043
|
-
? 'text-dark-7'
|
|
1044
|
-
: 'text-grey-500'} text-[11px] md:text-xs whitespace-nowrap w-full"
|
|
1040
|
+
class="text-[11px] md:text-xs whitespace-nowrap w-full ${textColorClass}"
|
|
1045
1041
|
>
|
|
1046
1042
|
Subscribe with
|
|
1047
1043
|
</p>
|
|
1048
1044
|
<img
|
|
1049
1045
|
class="object-scale-down h-[17px] md:h-5"
|
|
1050
|
-
src=${
|
|
1051
|
-
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/paywall-asset/google-white.png'
|
|
1052
|
-
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/paywall-asset/google.png'}
|
|
1046
|
+
src=${googleImageSrc}
|
|
1053
1047
|
alt="subscribe with google"
|
|
1054
1048
|
/>
|
|
1055
1049
|
</button>
|
|
@@ -1069,22 +1063,30 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1069
1063
|
}
|
|
1070
1064
|
|
|
1071
1065
|
private freeTrialPopUp() {
|
|
1066
|
+
const { isDark } = this
|
|
1067
|
+
|
|
1068
|
+
const googlePlayBadgeSrc = isDark
|
|
1069
|
+
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20Google%20Play_Dark%20Mode.svg'
|
|
1070
|
+
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20Google%20Play_Light%20Mode.svg'
|
|
1071
|
+
|
|
1072
|
+
const appStoreBadgeSrc = isDark
|
|
1073
|
+
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20App%20Store_Dark%20Mode.svg'
|
|
1074
|
+
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20App%20Store_Light%20Mode.svg'
|
|
1075
|
+
|
|
1072
1076
|
return html`
|
|
1073
1077
|
<div
|
|
1074
1078
|
id="freeTrialPopup"
|
|
1075
1079
|
class="fixed w-full h-full inset-0 flex justify-center items-center z-50 bg-black bg-opacity-75 hidden"
|
|
1076
1080
|
>
|
|
1077
1081
|
<div
|
|
1078
|
-
class="${
|
|
1082
|
+
class="rounded w-11/12 sm:w-3/4 md:w-1/2 lg:w-1/3 2xl:w-1/4 p-6 text-center ${isDark
|
|
1079
1083
|
? 'bg-dark-4'
|
|
1080
|
-
: 'bg-white'}
|
|
1084
|
+
: 'bg-white'}"
|
|
1081
1085
|
>
|
|
1082
1086
|
<div class="w-full flex justify-end px-2">
|
|
1083
1087
|
<button
|
|
1084
1088
|
@click=${this.closeFreeTrialPopup}
|
|
1085
|
-
class="w-8 h-8 pl-4 ${
|
|
1086
|
-
? 'text-grey-300'
|
|
1087
|
-
: 'text-grey-400'}"
|
|
1089
|
+
class="w-8 h-8 pl-4 ${isDark ? 'text-grey-300' : 'text-grey-400'}"
|
|
1088
1090
|
>
|
|
1089
1091
|
${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}
|
|
1090
1092
|
</button>
|
|
@@ -1098,16 +1100,16 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1098
1100
|
</div>
|
|
1099
1101
|
</div>
|
|
1100
1102
|
<p
|
|
1101
|
-
class="font-bold text-lg ${
|
|
1103
|
+
class="font-bold text-lg mt-4 ${isDark
|
|
1102
1104
|
? 'text-white'
|
|
1103
|
-
: 'text-grey-600'}
|
|
1105
|
+
: 'text-grey-600'}"
|
|
1104
1106
|
>
|
|
1105
1107
|
Coba Gratis Kompas.id di Aplikasi
|
|
1106
1108
|
</p>
|
|
1107
1109
|
<div
|
|
1108
|
-
class="${
|
|
1110
|
+
class="hidden lg:block lg:flex flex rounded mt-4 px-8 py-4 items-center ${isDark
|
|
1109
1111
|
? 'bg-dark-3 border border-dark-9'
|
|
1110
|
-
: 'bg-white border border-grey-300'}
|
|
1112
|
+
: 'bg-white border border-grey-300'}"
|
|
1111
1113
|
>
|
|
1112
1114
|
<div class="w-1/3 flex mr-6">
|
|
1113
1115
|
<img
|
|
@@ -1116,18 +1118,18 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1116
1118
|
/>
|
|
1117
1119
|
</div>
|
|
1118
1120
|
<div
|
|
1119
|
-
class="w-2/3 text-base ${
|
|
1121
|
+
class="w-2/3 text-base text-left ${isDark
|
|
1120
1122
|
? 'text-dark-7'
|
|
1121
|
-
: 'text-grey-600'}
|
|
1123
|
+
: 'text-grey-600'}"
|
|
1122
1124
|
>
|
|
1123
1125
|
Coba gratis 3 hari Kompas.id melalui aplikasi. Pindai kode QR
|
|
1124
1126
|
dengan ponsel atau tablet untuk mengunduh aplikasi.
|
|
1125
1127
|
</div>
|
|
1126
1128
|
</div>
|
|
1127
1129
|
<div
|
|
1128
|
-
class="text-base ${
|
|
1130
|
+
class="text-base text-center lg:hidden px-2 md:px-8 ${isDark
|
|
1129
1131
|
? 'text-dark-7'
|
|
1130
|
-
: 'text-grey-600'}
|
|
1132
|
+
: 'text-grey-600'}"
|
|
1131
1133
|
>
|
|
1132
1134
|
Dapatkan akses gratis selama 3 hari ke konten dan fitur premium
|
|
1133
1135
|
Kompas.id di aplikasi.
|
|
@@ -1136,33 +1138,21 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1136
1138
|
<a
|
|
1137
1139
|
href="https://play.google.com/store/apps/details?id=id.kompas.app"
|
|
1138
1140
|
target="_blank"
|
|
1139
|
-
><img
|
|
1140
|
-
src="${this.isDark
|
|
1141
|
-
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20Google%20Play_Dark%20Mode.svg'
|
|
1142
|
-
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20Google%20Play_Light%20Mode.svg'}"
|
|
1143
|
-
alt="Google Play Badge"
|
|
1141
|
+
><img src="${googlePlayBadgeSrc}" alt="Google Play Badge"
|
|
1144
1142
|
/></a>
|
|
1145
1143
|
<a
|
|
1146
1144
|
href="https://apps.apple.com/id/app/kompas-id/id1242195037?l=id"
|
|
1147
1145
|
target="_blank"
|
|
1148
|
-
><img
|
|
1149
|
-
src="${this.isDark
|
|
1150
|
-
? 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20App%20Store_Dark%20Mode.svg'
|
|
1151
|
-
: 'https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/Button_Download%20App%20Store_Light%20Mode.svg'}"
|
|
1152
|
-
alt="iOS App Store Badge"
|
|
1146
|
+
><img src="${appStoreBadgeSrc}" alt="iOS App Store Badge"
|
|
1153
1147
|
/></a>
|
|
1154
1148
|
</div>
|
|
1155
1149
|
<button
|
|
1156
1150
|
onclick="window.open('https://app.komp.as/langganan', '_blank')"
|
|
1157
|
-
class="h-12 ${
|
|
1151
|
+
class="h-12 rounded-md mt-4 flex w-full items-center justify-center lg:hidden ${isDark
|
|
1158
1152
|
? 'bg-green-300'
|
|
1159
|
-
: 'bg-green-500'}
|
|
1153
|
+
: 'bg-green-500'}"
|
|
1160
1154
|
>
|
|
1161
|
-
<h6
|
|
1162
|
-
class="${this.isDark
|
|
1163
|
-
? 'text-dark-5'
|
|
1164
|
-
: 'text-white'} font-bold p-4"
|
|
1165
|
-
>
|
|
1155
|
+
<h6 class="font-bold p-4 ${isDark ? 'text-dark-5' : 'text-white'}">
|
|
1166
1156
|
Unduh Sekarang
|
|
1167
1157
|
</h6>
|
|
1168
1158
|
</button>
|
|
@@ -1177,9 +1167,10 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1177
1167
|
if (packages.freeTrial) {
|
|
1178
1168
|
return html`
|
|
1179
1169
|
<div
|
|
1180
|
-
class="flex flex-wrap items-center justify-between ${this
|
|
1170
|
+
class="flex flex-wrap items-center justify-between py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4 ${this
|
|
1171
|
+
.isDark
|
|
1181
1172
|
? 'bg-grey-600'
|
|
1182
|
-
: 'bg-white'}
|
|
1173
|
+
: 'bg-white'}"
|
|
1183
1174
|
>
|
|
1184
1175
|
<div class="flex flex-col">
|
|
1185
1176
|
<div class="flex items-center">
|
|
@@ -1197,13 +1188,13 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1197
1188
|
</div>
|
|
1198
1189
|
<button
|
|
1199
1190
|
@click=${this.openFreeTrialPopup}
|
|
1200
|
-
class="h-8 ${!this.isDark &&
|
|
1201
|
-
'bg-white'}
|
|
1191
|
+
class="h-8 border border-green-500 rounded ${!this.isDark &&
|
|
1192
|
+
'bg-white'}"
|
|
1202
1193
|
>
|
|
1203
1194
|
<h6
|
|
1204
|
-
class="text-xs md:text-sm ${this.isDark
|
|
1195
|
+
class="text-xs md:text-sm font-bold px-4 ${this.isDark
|
|
1205
1196
|
? 'text-green-300'
|
|
1206
|
-
: 'text-green-500'}
|
|
1197
|
+
: 'text-green-500'}"
|
|
1207
1198
|
>
|
|
1208
1199
|
Coba Gratis
|
|
1209
1200
|
</h6>
|
|
@@ -1219,27 +1210,34 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1219
1210
|
*/
|
|
1220
1211
|
|
|
1221
1212
|
render() {
|
|
1213
|
+
const isEpaper = this.type === 'epaper'
|
|
1214
|
+
const isAudio = this.type === 'audio'
|
|
1215
|
+
const { isDark } = this
|
|
1216
|
+
const { isLogin } = this
|
|
1217
|
+
|
|
1218
|
+
const wrapperBodyClass = `wrapper-body
|
|
1219
|
+
${isEpaper ? 'bg-transparent mx-2' : ''}
|
|
1220
|
+
${
|
|
1221
|
+
isAudio
|
|
1222
|
+
? 'fixed w-full h-full inset-0 flex justify-center items-center z-index-max bg-black bg-opacity-75'
|
|
1223
|
+
: ''
|
|
1224
|
+
}`
|
|
1225
|
+
.trim()
|
|
1226
|
+
.replace(/\s+/g, ' ')
|
|
1227
|
+
|
|
1228
|
+
const containerClass = `flex w-full flex-col items-center justify-center rounded-xl pt-6 relative ${
|
|
1229
|
+
isDark ? 'bg-dark-3' : 'bg-blue-100'
|
|
1230
|
+
} ${isAudio ? 'md:pt-5' : 'md:pt-8'}`
|
|
1231
|
+
|
|
1232
|
+
const borderClass = isDark ? 'border-dark-8' : 'border-blue-200'
|
|
1233
|
+
|
|
1222
1234
|
return html`
|
|
1223
|
-
<div
|
|
1224
|
-
class="${this.type === 'epaper'
|
|
1225
|
-
? 'bg-transparent wrapper-body mx-2'
|
|
1226
|
-
: 'wrapper-body'}
|
|
1227
|
-
${this.type === 'audio'
|
|
1228
|
-
? `fixed w-full h-full inset-0 flex justify-center items-center z-50 bg-black bg-opacity-75`
|
|
1229
|
-
: 'wrapper-body'}"
|
|
1230
|
-
>
|
|
1235
|
+
<div class="${wrapperBodyClass}">
|
|
1231
1236
|
<div
|
|
1232
1237
|
class="flex flex-col justify-center items-center w-full max-w-screen-sm my-5 px-2 relative"
|
|
1233
1238
|
>
|
|
1234
|
-
${
|
|
1235
|
-
|
|
1236
|
-
: nothing}
|
|
1237
|
-
<div
|
|
1238
|
-
class="flex w-full flex-col items-center justify-center ${this
|
|
1239
|
-
.isDark
|
|
1240
|
-
? 'bg-dark-3'
|
|
1241
|
-
: 'bg-blue-100'} rounded-xl pt-6 md:pt-8 relative"
|
|
1242
|
-
>
|
|
1239
|
+
${isEpaper || isAudio ? this.topNavigator(this.type) : nothing}
|
|
1240
|
+
<div class="${containerClass}">
|
|
1243
1241
|
${this.headerSection(
|
|
1244
1242
|
this.type,
|
|
1245
1243
|
this.paywallData?.informations?.title ?? ''
|
|
@@ -1251,12 +1249,12 @@ export class KompasIdPaywallBody extends LitElement {
|
|
|
1251
1249
|
this.paywallData?.packages ?? ({} as Packages)
|
|
1252
1250
|
)}
|
|
1253
1251
|
${this.informationPackages()}
|
|
1254
|
-
${!
|
|
1252
|
+
${!isLogin
|
|
1255
1253
|
? html`
|
|
1256
1254
|
<div
|
|
1257
|
-
class="border-b ${
|
|
1258
|
-
? '
|
|
1259
|
-
: '
|
|
1255
|
+
class="border-b w-1/5 flex justify-center ${borderClass} ${isAudio
|
|
1256
|
+
? 'my-4 md:my-3'
|
|
1257
|
+
: 'my-4'}"
|
|
1260
1258
|
></div>
|
|
1261
1259
|
${this.registrationSection(this.type)}
|
|
1262
1260
|
`
|