-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement VAR for C24_WMDE_Mobile_DE_13
VAR has an auto-collapse feature Ticket: https://phabricator.wikimedia.org/T381954
- Loading branch information
Showing
17 changed files
with
463 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
banners/mobile/C24_WMDE_Mobile_DE_13/components/MinimisedBanner.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<div class="wmde-banner-minimised"> | ||
<ButtonClose @close="$emit( 'close' )"> | ||
<span class="wmde-banner-close-icon"> | ||
<CloseIconMobile/> | ||
</span> | ||
</ButtonClose> | ||
|
||
<MinimisedText @show-full-page-banner="$emit( 'showFullPageBanner' )"/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue'; | ||
import CloseIconMobile from '@src/components/Icons/CloseIconMobile.vue'; | ||
import MinimisedText from '@banners/mobile/C24_WMDE_Mobile_DE_13/content/MinimisedText.vue'; | ||
defineEmits( [ 'close', 'showFullPageBanner' ] ); | ||
</script> |
10 changes: 10 additions & 0 deletions
10
banners/mobile/C24_WMDE_Mobile_DE_13/content/MinimisedText.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
<InfoIconStraight/> Hat Wikipedia Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt? | ||
<a class="wmde-banner-minimised-expand" href="#" @click.prevent="$emit( 'showFullPageBanner' )">Dann geben Sie jetzt etwas zurück! <HeartIcon/></a> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import InfoIconStraight from '@src/components/Icons/InfoIconStraight.vue'; | ||
import HeartIcon from '@src/components/Icons/HeartIcon.vue'; | ||
defineEmits( [ 'showFullPageBanner' ] ); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { TrackingEventConverterFactory } from '@src/tracking/LegacyTrackerWPORG'; | ||
import { WMDELegacyBannerEvent } from '@src/tracking/WPORG/WMDELegacyBannerEvent'; | ||
import { MobileMiniBannerExpandedEvent } from '@src/tracking/events/MobileMiniBannerExpandedEvent'; | ||
import { FormStepShownEvent } from '@src/tracking/events/FormStepShownEvent'; | ||
import { mapFormStepShownEvent } from '@src/tracking/LegacyEventTracking/mapFormStepShownEvent'; | ||
import { CloseEvent } from '@src/tracking/events/CloseEvent'; | ||
import { mapCloseEvent } from '@src/tracking/LegacyEventTracking/mapCloseEvent'; | ||
import { NotShownEvent } from '@src/tracking/events/NotShownEvent'; | ||
import { mapNotShownEvent } from '@src/tracking/LegacyEventTracking/mapNotShownEvent'; | ||
import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent'; | ||
import { WMDESizeIssueEvent } from '@src/tracking/WPORG/WMDEBannerSizeIssue'; | ||
import { createViewportInfo } from '@src/tracking/LegacyEventTracking/createViewportInfo'; | ||
import { BannerSubmitOnReturnEvent } from '@src/tracking/events/BannerSubmitOnReturnEvent'; | ||
import { MinimisedEvent } from '@src/tracking/events/MinimisedEvent'; | ||
|
||
export default new Map<string, TrackingEventConverterFactory>( [ | ||
[ CloseEvent.EVENT_NAME, mapCloseEvent ], | ||
[ MobileMiniBannerExpandedEvent.EVENT_NAME, | ||
( e: MobileMiniBannerExpandedEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ], | ||
[ FormStepShownEvent.EVENT_NAME, mapFormStepShownEvent ], | ||
[ NotShownEvent.EVENT_NAME, mapNotShownEvent ], | ||
|
||
[ BannerSubmitEvent.EVENT_NAME, ( e: BannerSubmitEvent ): WMDESizeIssueEvent => { | ||
switch ( e.feature ) { | ||
case 'MiniBanner': | ||
case 'UpgradeToYearlyForm': | ||
return new WMDESizeIssueEvent( `submit-${e.userChoice}`, createViewportInfo(), 1 ); | ||
default: | ||
return new WMDESizeIssueEvent( `submit`, createViewportInfo(), 1 ); | ||
} | ||
} ], | ||
[ BannerSubmitOnReturnEvent.EVENT_NAME, | ||
( e: BannerSubmitOnReturnEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + ( e.userChoice !== '' ? `-${e.userChoice}` : '' ), 1 ) ], | ||
[ MinimisedEvent.EVENT_NAME, | ||
( e: MinimisedEvent ): WMDELegacyBannerEvent => new WMDELegacyBannerEvent( e.eventName + `-${ e.feature }-${ e.userChoice }`, 1 ) ] | ||
] ); |
59 changes: 59 additions & 0 deletions
59
banners/mobile/C24_WMDE_Mobile_DE_13/styles/BannerVar.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@use 'src/themes/Modo/variables/globals'; | ||
@use 'src/themes/Modo/variables/fonts'; | ||
|
||
@keyframes hide-mini { | ||
0% { | ||
opacity: 1; | ||
} | ||
99% { | ||
opacity: 0; | ||
} | ||
100% { | ||
display: none; | ||
} | ||
} | ||
|
||
.wmde-banner { | ||
|
||
&-full { | ||
visibility: hidden; | ||
opacity: 0; | ||
transform: scale( 1.1 ); | ||
transition: opacity 500ms globals.$banner-easing, transform 500ms globals.$banner-easing; | ||
} | ||
|
||
&-wrapper { | ||
font-size: 16px; | ||
font-family: fonts.$ui; | ||
box-shadow: var( --mini-box-shadow ); | ||
background-color: var( --main-background ); | ||
color: var( --main-color ); | ||
|
||
&--full-page { | ||
.wmde-banner-mini { | ||
animation: hide-mini 500ms; | ||
} | ||
.wmde-banner-full { | ||
visibility: visible; | ||
opacity: 1; | ||
transform: scale( 1 ); | ||
} | ||
} | ||
|
||
&--soft-closing { | ||
.wmde-banner-minimised { | ||
display: none; | ||
} | ||
.wmde-banner-mini { | ||
display: none; | ||
} | ||
} | ||
} | ||
|
||
&--closed, | ||
&--not-shown { | ||
.wmde-banner-wrapper { | ||
display: none; | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
banners/mobile/C24_WMDE_Mobile_DE_13/styles/MinimisedBanner.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.wmde-banner { | ||
&-minimised { | ||
--info-icon-background: var( --minimised-info-background ); | ||
--info-icon-color: var( --minimised-info-color ); | ||
|
||
background: var( --minimised-background ); | ||
color: var( --minimised-color ); | ||
position: relative; | ||
padding: 5px 36px 5px 10px; | ||
font-size: 16px; | ||
line-height: 1.8; | ||
|
||
.wmde-banner-close { | ||
all: unset; | ||
border: 0; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
height: 36px; | ||
width: 36px; | ||
cursor: pointer; | ||
text-align: center; | ||
|
||
&-icon { | ||
background: var( --minimised-close-background ); | ||
display: inline-block; | ||
height: 20px; | ||
width: 20px; | ||
border-radius: 50%; | ||
} | ||
|
||
svg { | ||
position: relative; | ||
display: inline-block; | ||
width: 10px; | ||
height: 10px; | ||
top: -5px; | ||
} | ||
} | ||
|
||
a { | ||
color: var( --minimised-link-color ); | ||
font-weight: bold; | ||
svg { | ||
position: relative; | ||
top: 2px; | ||
path { | ||
fill: var( --minimised-link-color ); | ||
} | ||
} | ||
} | ||
} | ||
|
||
&-info-icon { | ||
position: relative; | ||
top: 2px; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
banners/mobile/C24_WMDE_Mobile_DE_13/styles/styles_var.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@use 'src/themes/Modo/swatches/skin_default' with ( | ||
$minimised-banner: true, | ||
$upgrade-to-yearly-button-form: true, | ||
$double-progress-bar: true, | ||
$soft-close: true, | ||
$thank-you-box: true | ||
); | ||
@use 'src/components/BannerConductor/banner-transition'; | ||
@use 'src/themes/UseOfFunds/swatches/skin_default' as uof-default; | ||
@use 'src/themes/UseOfFunds/UseOfFunds'; | ||
@use 'src/themes/Modo/defaults'; | ||
@use 'BannerVar'; | ||
@use 'MiniBanner' with ( | ||
$height: 336px, | ||
$height-l-up: 306px | ||
); | ||
@use 'MinimisedBanner'; | ||
@use 'FullPageBanner'; | ||
@use 'src/themes/Modo/Footer/Footer'; | ||
@use 'src/themes/Modo/ThankYouBox/ThankYouBox'; | ||
@use 'src/themes/Modo/Footer/SelectionInput'; | ||
@use 'src/themes/Modo/DonationForm/MultiStepDonation'; | ||
@use 'src/themes/Modo/DonationForm/Forms/UpgradeToYearlyButtonForm'; | ||
@use 'src/themes/Modo/DonationForm/SubComponents/SelectGroup'; | ||
@use 'src/themes/Modo/DonationForm/SubComponents/SelectCustomAmount'; | ||
@use 'src/themes/Modo/DonationForm/SubComponents/SmsBox'; | ||
@use 'src/themes/Modo/Slider/Slider'; | ||
@use 'src/themes/Modo/SoftClose/SoftClose'; | ||
@use 'src/themes/Modo/ProgressBar/DoubleProgressBar'; | ||
@use 'src/themes/Modo/Message/Message'; |
21 changes: 21 additions & 0 deletions
21
banners/mobile/C24_WMDE_Mobile_DE_13/useScrollMinimiser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { onMounted, onUnmounted, Ref, watch } from 'vue'; | ||
|
||
export function useScrollMinimiser( switchThreshold: number, hasMinimised: Ref<boolean>, onScrollBelowThreshold: () => void ): void { | ||
const scrollHandler = (): void => { | ||
if ( window.scrollY > switchThreshold ) { | ||
onScrollBelowThreshold(); | ||
} | ||
}; | ||
|
||
onMounted( () => { | ||
window.addEventListener( 'scroll', scrollHandler ); | ||
} ); | ||
|
||
onUnmounted( () => { | ||
window.removeEventListener( 'scroll', scrollHandler ); | ||
} ); | ||
|
||
watch( hasMinimised, () => { | ||
window.removeEventListener( 'scroll', scrollHandler ); | ||
} ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.