+ Vielleicht kommen wir gerade ungelegen, aber dennoch: Klicken Sie jetzt bitte nicht weg! Am heutigen + {{ currentDayName }}, den {{ currentDate }}, bitten wir Sie, die Unabhängigkeit von Wikipedia zu unterstützen. +
+
+ {{campaignDaySentence}}
+
+ Die durchschnittliche Spende beträgt {{ averageDonation }}, doch bereits 5 € helfen uns weiter. Hat Wikipedia + Ihnen in diesem Jahr Wissen im Wert einer Tasse Kaffee geschenkt? +
++ Dann entscheiden Sie sich, eine der seltenen Ausnahmen zu sein, und geben Sie etwas zurück. Vielen Dank! +
++ Hat Wikipedia Ihnen Wissen im Wert einer Tasse Kaffee geschenkt? +
++ Dann entscheiden Sie sich, etwas zurückzugeben. Danke! +
+Jedes Jahr sind wir auf Menschen wie Sie angewiesen. Jährliche Spenden helfen uns besonders und ermöglichen langfristige Weiterentwicklungen.
+Sie gehen kein Risiko ein: Jederzeit formlos zu sofort kündbar.
`, + 'upgrade-to-yearly-no': 'Nein, ich spende einmalig {{amount}}', + 'upgrade-to-yearly-yes': 'Ja, ich spende {{amount}} jährlich', + 'campaign-day-only-n-days': 'Heute sind es nur noch {{days}} Tage bis zum Ende unserer Spendenkampagne.', + 'double-progress-close': 'Das wird knapp.', + 'missing-amount': 'Uns fehlen noch', + 'custom-amount-placeholder': 'Wahlbetrag' +}; + +export default messages; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_11/styles/Banner.scss b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/Banner.scss new file mode 100644 index 000000000..1e7d13842 --- /dev/null +++ b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/Banner.scss @@ -0,0 +1,22 @@ +@use 'src/themes/Svingle/variables/fonts'; + +.wmde-banner { + &-wrapper { + font-size: 14px; + font-family: fonts.$ui; + box-shadow: 0 3px 0.6em rgba( 60 60 60 / 40% ); + background-color: var( --main-background ); + } + + &--pending { + .wmde-banner-wrapper { + box-shadow: none; + } + } + + &--closed { + .wmde-banner-wrapper { + display: none; + } + } +} diff --git a/banners/desktop/C24_WMDE_Desktop_DE_11/styles/FallbackBanner.scss b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/FallbackBanner.scss new file mode 100644 index 000000000..a0d40542d --- /dev/null +++ b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/FallbackBanner.scss @@ -0,0 +1,121 @@ +@use 'src/themes/Svingle/variables/fonts'; + +$breakpoint: 800px; + +.wmde-banner { + &-fallback { + width: 100%; + height: 150px; + display: flex; + flex-direction: column; + background: var( --fallback-background ); + box-shadow: 0 3px 0.6em rgba( 60 60 60 / 40% ); + + @media ( min-width: $breakpoint ) { + height: auto; + min-height: 250px; + padding: 4px; + } + + &-small, + &-large { + display: flex; + flex-direction: column; + flex: 1 1 auto; + } + + &-small { + align-items: center; + border: 4px solid var( --fallback-border ); + border-radius: 4px; + padding: 8px; + + .wmde-banner-selection-input-text, + .wmde-banner-selection-input-input { + font-family: fonts.$content; + font-size: 14px; + font-weight: normal; + } + } + + &-large { + align-items: stretch; + } + + &-usage-link { + color: var( --fallback-uof-link ); + } + + &-message { + flex: 1 1 auto; + display: flex; + flex-direction: column; + border: 4px solid var( --fallback-message-border ); + border-radius: 4px; + padding: 8px 0; + } + + &-bank-item { + display: block; + + &-label { + font-weight: bold; + } + } + + .wmde-banner-close { + height: 16px; + width: 16px; + top: 8px; + right: 8px; + + @media ( min-width: $breakpoint ) { + height: 30px; + width: 30px; + top: 12px; + right: 12px; + } + } + + .wmde-banner-message { + flex: 1 1 auto; + display: flex; + flex-direction: column; + padding: 8px 0; + color: var( --fallback-message-color ); + background-color: var( --fallback-message-background ); + margin: 15px; + + p { + margin-bottom: 0; + } + } + + .wmde-banner-slider-container { + padding: 0 0 8px; + margin: 0; + } + + .wmde-banner-slide-content { + font-size: 14px; + p { + margin-bottom: 8px; + } + } + + .wmde-banner-slider-navigation-previous, + .wmde-banner-slider-navigation-next { + align-items: end; + } + + .wmde-banner-slider-pagination-dot { + cursor: default; + } + } + + &--pending { + .wmde-banner-fallback { + box-shadow: none; + } + } +} diff --git a/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MainBanner.scss b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MainBanner.scss new file mode 100644 index 000000000..a0bcd9bca --- /dev/null +++ b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MainBanner.scss @@ -0,0 +1,53 @@ +$banner-height: 357px !default; +$form-width: 300px !default; + +.wmde-banner { + + .previous { + --slider-chevron: var( --previous-button-fill ); + } + + &-main { + min-height: $banner-height; + display: flex; + flex-direction: column; + padding: 12px 24px 0; + } + + &-content { + display: flex; + flex-direction: row; + flex-grow: 1; + } + + &-message { + padding: 3px 15px; + color: var( --message-color ); + background-color: var( --message-background ); + border: none; + border-radius: 9px; + margin-bottom: 15px; + } + + &-column-left { + position: relative; + display: flex; + flex-direction: column; + justify-content: center; + flex: 1 1 auto; + margin-bottom: 0; + overflow-y: hidden; + margin-right: 30px; + padding: 0; + border: none; + } + + &-column-right { + order: 2; + flex: 0 0 $form-width; + display: flex; + flex-direction: column; + width: $form-width; + padding: 10px 0 0; + } +} diff --git a/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MinimisedBanner.scss b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MinimisedBanner.scss new file mode 100644 index 000000000..fd1480727 --- /dev/null +++ b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/MinimisedBanner.scss @@ -0,0 +1,111 @@ +@use 'src/themes/Svingle/variables/globals'; + +.wmde-banner { + &-minimised { + padding: 12px 24px 0; + + &-content { + display: flex; + + &-message { + flex: 1 1 auto; + display: flex; + flex-direction: column; + justify-content: center; + padding: 11px 15px 11px 34px; + color: var( --color-white ); + background-color: var( --color-secondary ); + border: none; + border-radius: 9px; + font-size: 14px; + + svg { + float: left; + margin: 10px 0 0 -22px; + } + } + + &-button { + flex: 0 0 auto; + display: flex; + flex-direction: column; + justify-content: end; + padding-left: 30px; + } + } + + &-title { + font-size: 18px; + font-weight: bold; + } + + &-submit-button { + width: 300px; + background: var( --color-primary ); + color: var( --color-white ); + font-weight: bold; + line-height: 36px; + border: 0; + border-radius: 18px; + padding: 0 10px; + transition: background-color 500ms globals.$banner-easing; + cursor: pointer; + + &:hover, + &:focus { + background: var( --color-primary-hover ); + } + } + + &-button-group { + position: absolute; + z-index: 2; + top: 12px; + right: 12px; + height: 26px; + border: 2px solid var( --color-secondary ); + border-radius: 13px; + padding: 0 10px; + display: flex; + align-items: center; + + .wmde-banner-close { + height: 16px; + width: 16px; + position: static; + + svg path { + fill: var( --color-secondary ); + } + } + } + + &-minimise, + &-maximise { + background: none; + border: none; + cursor: pointer; + color: var( --color-secondary ); + padding-right: 8px; + margin-right: 8px; + border-right: 1px solid #bfbfbf; + font-size: 14px; + font-weight: bold; + + svg { + width: 20px; + + path { + fill: var( --color-secondary ); + } + } + } + + &-minimise { + svg { + transform: rotate( 180deg ); + margin-left: 3px; + } + } + } +} diff --git a/banners/desktop/C24_WMDE_Desktop_DE_11/styles/styles.scss b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/styles.scss new file mode 100644 index 000000000..ec3e1c14d --- /dev/null +++ b/banners/desktop/C24_WMDE_Desktop_DE_11/styles/styles.scss @@ -0,0 +1,56 @@ +// This is the file where we import the theme-specific component styles +@use '../../../../src/themes/Svingle/swatches/skin_default' with ( + $slider: true, + $select-group: true, + $upgrade-to-yearly: true, + $fallback-banner: true, + $progress-bar: true, + $soft-close: true, +); +@use 'src/components/BannerConductor/banner-transition'; +@use 'src/themes/UseOfFunds/swatches/skin_default' as uof-default; +@use 'Banner'; +@use 'src/themes/UseOfFunds/UseOfFunds'; +@use 'MainBanner' with ( + $banner-height: 357px, + $form-width: 300px +); +@use 'src/themes/Svingle/defaults'; +@use 'src/themes/Svingle/ButtonClose/ButtonClose'; +@use 'src/themes/Svingle/ProgressBar/ProgressBar'; +@use 'src/themes/Svingle/DonationForm/DonationForm'; +@use 'src/themes/Svingle/DonationForm/MultiStepDonation'; +@use 'src/themes/Svingle/DonationForm/SubComponents/SelectGroup'; +@use 'src/themes/Svingle/DonationForm/SubComponents/SelectGroupRadios' with ( + $font-size: 14px +); +@use 'src/themes/Svingle/DonationForm/SubComponents/SelectCustomAmountRadio' with ( + $font-size: 14px +); +@use 'src/themes/Svingle/DonationForm/SubComponents/SmsBox'; +@use 'src/themes/Svingle/DonationForm/Forms/MainDonationForm'; +@use 'src/themes/Svingle/DonationForm/Forms/UpgradeToYearlyButtonForm' with ( + $font-size: 14px +); +@use 'src/themes/Svingle/DonationForm/Forms/CustomAmountForm'; +@use 'src/themes/Svingle/Footer/FooterAlreadyDonated'; +@use 'src/themes/Svingle/Footer/SelectionInput'; +@use 'src/themes/Svingle/Message/Message'; +@use 'src/themes/Svingle/SoftClose/SoftClose'; +@use 'src/themes/Svingle/Slider/KeenSlider' with ( + $margin-bottom: 5px +); + +/** + * Fallback banner with "Fijitiv" theme + * All selectors in Fijitiv theme are prefixed with the ".wmde-banner-fallback" class selector, + so they override the "default" styles with the same selector + */ +@use 'FallbackBanner'; +@use 'src/themes/Fijitiv/FallbackBanner/FallbackButton'; +@use 'src/themes/Fijitiv/FallbackBanner/LargeFooter'; +@use 'src/themes/Fijitiv/FallbackBanner/SmallFooter'; +@use 'src/themes/Fijitiv/ProgressBar/ProgressBar' as FallbackProgressBar with ( + $progress-bar-margin: 0 15px +); +@use 'src/themes/Fijitiv/Slider/KeenSlider' as FallbackSlider; diff --git a/campaign_info.toml b/campaign_info.toml index 7e485150c..38cd22372 100644 --- a/campaign_info.toml +++ b/campaign_info.toml @@ -6,9 +6,9 @@ [desktop] name = "Desktop" icon = "desktop" -campaign = "C24_WMDE_Desktop_DE_10" -description = "Based on the CTRL banner of desktop-de-09" -campaign_tracking = "10-ba-241104" +campaign = "C24_WMDE_Desktop_DE_11" +description = "Based on the CTRL banner of C24_WMDE_Desktop_DE_10, VAR has double progress bar" +campaign_tracking = "11-ba-241107" preview_link = "/wiki/Wikipedia:Hauptseite?devbanner={{banner}}&banner=B22_WMDE_local_prototype" preview_link_darkmode = "/wiki/Wikipedia:Hauptseite?devbanner={{banner}}&banner=B22_WMDE_local_prototype&vectornightmode=1" preview_url = 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite?banner={{banner}}&devMode' @@ -17,14 +17,14 @@ use_of_funds_source = "MediaWiki:WMDE_Fundraising/UseOfFunds_2024_DE" # Banners of the campaign, key after "banners" can be anything [desktop.banners.ctrl] -filename = "./banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts" -pagename = "B24_WMDE_Desktop_DE_10_ctrl" -tracking = "org-10-241104-ctrl" +filename = "./banners/desktop/C24_WMDE_Desktop_DE_11/banner_ctrl.ts" +pagename = "B24_WMDE_Desktop_DE_11_ctrl" +tracking = "org-11-241107-ctrl" [desktop.banners.var] -filename = "./banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts" -pagename = "B24_WMDE_Desktop_DE_10_var" -tracking = "org-10-241104-var" +filename = "./banners/desktop/C24_WMDE_Desktop_DE_11/banner_var.ts" +pagename = "B24_WMDE_Desktop_DE_11_var" +tracking = "org-11-241107-var" [desktop.test_matrix] platform = ["edge", "firefox_win10", "chrome_win10", "safari", "firefox_macos", "chrome_macos", "firefox_linux", "chrome_linux"] diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_11/components/BannerCtrl.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_11/components/BannerCtrl.spec.ts new file mode 100644 index 000000000..36fc9588d --- /dev/null +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_11/components/BannerCtrl.spec.ts @@ -0,0 +1,176 @@ +import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { mount, VueWrapper } from '@vue/test-utils'; +import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.vue'; +import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { newDynamicContent } from '@test/banners/dynamicCampaignContent'; +import { useOfFundsContent } from '@test/banners/useOfFundsContent'; +import { formItems } from '@test/banners/formItems'; +import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; +import { useOfFundsFeatures } from '@test/features/UseOfFunds'; +import { + bannerContentAnimatedTextFeatures, + bannerContentDateAndTimeFeatures, + bannerContentDisplaySwitchFeatures, + bannerContentFeatures +} from '@test/features/BannerContent'; +import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; +import { useFormModel } from '@src/components/composables/useFormModel'; +import { resetFormModel } from '@test/resetFormModel'; +import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; +import { bannerMainFeatures } from '@test/features/MainBanner'; +import { formActionSwitchFeatures } from '@test/features/form_action_switch/MainDonation_UpgradeToYearlyButton'; +import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; +import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; +import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; +import { Tracker } from '@src/tracking/Tracker'; + +const formModel = useFormModel(); +const translator = ( key: string ): string => key; +let tracker: Tracker; + +describe( 'BannerVar.vue', () => { + + beforeEach( () => { + resetFormModel( formModel ); + vi.useFakeTimers(); + tracker = { + trackEvent: vi.fn() + }; + } ); + + afterEach( () => { + vi.restoreAllMocks(); + vi.useRealTimers(); + } ); + + const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper