From c62541f69b8b5f0ba1e06cbba000f3e482d74871 Mon Sep 17 00:00:00 2001 From: Abban Dunne Date: Thu, 5 Dec 2024 12:53:10 +0100 Subject: [PATCH] Update Use of Funds content and design - Fix missing styles in local selector - Add a new Use of Funds page - Remove old styles and unused components Ticket: https://phabricator.wikimedia.org/T381411 --- src/components/layout/LocaleSelector.vue | 4 +- src/components/pages/DonationConfirmation.vue | 1 + src/components/pages/UseOfFunds.vue | 423 ++++++++++++++---- .../pages/use_of_funds/BenefitsIcon.vue | 105 +++++ .../pages/use_of_funds/CallToAction.vue | 49 ++ src/components/pages/use_of_funds/Company.ts | 6 - .../pages/use_of_funds/CompanyBudgets.vue | 40 -- .../pages/use_of_funds/CompanyCitation.vue | 22 - .../FundsDistributionAccordion.vue | 30 -- .../pages/use_of_funds/UseOfFundsContent.ts | 40 ++ src/components/shared/icons/ChevronDown.vue | 2 +- src/scss/use_of_funds/CompanyBudgets.scss | 47 -- src/scss/use_of_funds/FundsContent.scss | 194 -------- .../FundsDistributionAccordion.scss | 60 --- src/scss/use_of_funds/variables.scss | 4 - 15 files changed, 542 insertions(+), 485 deletions(-) create mode 100644 src/components/pages/use_of_funds/BenefitsIcon.vue create mode 100644 src/components/pages/use_of_funds/CallToAction.vue delete mode 100644 src/components/pages/use_of_funds/Company.ts delete mode 100644 src/components/pages/use_of_funds/CompanyBudgets.vue delete mode 100644 src/components/pages/use_of_funds/CompanyCitation.vue delete mode 100644 src/components/pages/use_of_funds/FundsDistributionAccordion.vue create mode 100644 src/components/pages/use_of_funds/UseOfFundsContent.ts delete mode 100644 src/scss/use_of_funds/CompanyBudgets.scss delete mode 100644 src/scss/use_of_funds/FundsContent.scss delete mode 100644 src/scss/use_of_funds/FundsDistributionAccordion.scss delete mode 100644 src/scss/use_of_funds/variables.scss diff --git a/src/components/layout/LocaleSelector.vue b/src/components/layout/LocaleSelector.vue index 000dc10da..7dc379f4e 100644 --- a/src/components/layout/LocaleSelector.vue +++ b/src/components/layout/LocaleSelector.vue @@ -137,12 +137,10 @@ useDetectOutsideClick( localeSelectorRef, handleLocaleItemBlur ); } .chevron-down-icon { + --chevron-stroke: #{colors.$primary}; width: 10px; margin-left: 4px; margin-top: 3px; - path { - stroke: colors.$primary; - } } } diff --git a/src/components/pages/DonationConfirmation.vue b/src/components/pages/DonationConfirmation.vue index 723ebb777..cb7e9c2a8 100644 --- a/src/components/pages/DonationConfirmation.vue +++ b/src/components/pages/DonationConfirmation.vue @@ -234,6 +234,7 @@ h2.icon-title { } .mobile-call-to-action { + --chevron-stroke: #{colors.$white}; position: fixed; bottom: 0; height: 64px; diff --git a/src/components/pages/UseOfFunds.vue b/src/components/pages/UseOfFunds.vue index 85dad5b8d..07b3175ff 100644 --- a/src/components/pages/UseOfFunds.vue +++ b/src/components/pages/UseOfFunds.vue @@ -1,94 +1,361 @@ - diff --git a/src/components/pages/use_of_funds/BenefitsIcon.vue b/src/components/pages/use_of_funds/BenefitsIcon.vue new file mode 100644 index 000000000..d900c0cc6 --- /dev/null +++ b/src/components/pages/use_of_funds/BenefitsIcon.vue @@ -0,0 +1,105 @@ + + + diff --git a/src/components/pages/use_of_funds/CallToAction.vue b/src/components/pages/use_of_funds/CallToAction.vue new file mode 100644 index 000000000..6b266f7a7 --- /dev/null +++ b/src/components/pages/use_of_funds/CallToAction.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/components/pages/use_of_funds/Company.ts b/src/components/pages/use_of_funds/Company.ts deleted file mode 100644 index a3641fd30..000000000 --- a/src/components/pages/use_of_funds/Company.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Company { - name: string; - budget: number; - budgetString: string; - budgetCitation?: string -} diff --git a/src/components/pages/use_of_funds/CompanyBudgets.vue b/src/components/pages/use_of_funds/CompanyBudgets.vue deleted file mode 100644 index b1726ad33..000000000 --- a/src/components/pages/use_of_funds/CompanyBudgets.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/src/components/pages/use_of_funds/CompanyCitation.vue b/src/components/pages/use_of_funds/CompanyCitation.vue deleted file mode 100644 index f6d031ef6..000000000 --- a/src/components/pages/use_of_funds/CompanyCitation.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - diff --git a/src/components/pages/use_of_funds/FundsDistributionAccordion.vue b/src/components/pages/use_of_funds/FundsDistributionAccordion.vue deleted file mode 100644 index e38e2ccbc..000000000 --- a/src/components/pages/use_of_funds/FundsDistributionAccordion.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/src/components/pages/use_of_funds/UseOfFundsContent.ts b/src/components/pages/use_of_funds/UseOfFundsContent.ts new file mode 100644 index 000000000..76d9735d5 --- /dev/null +++ b/src/components/pages/use_of_funds/UseOfFundsContent.ts @@ -0,0 +1,40 @@ +interface AccordionItem { + title: string; + content: string; +} + +interface BenefitsItem { + icon: 'hand' | 'smartphone' | 'world' | 'megaphone' | 'twentyfourseven'; + content: string; +} + +interface RevenueComparisonItem { + name: string; + budget: number; + budgetString: string; + link: string; + linkText: string; +} + +export interface UseOfFundsContent { + title: string; + summary: string; + callToAction: string; + accordion: { + items: AccordionItem[]; + summary: string; + }; + benefits: { + title: string; + items: BenefitsItem[]; + }; + revenueComparison: { + title: string; + content: string[]; + companies: { + title: string; + items: RevenueComparisonItem[]; + }; + }; + closingParagraph: string; +} diff --git a/src/components/shared/icons/ChevronDown.vue b/src/components/shared/icons/ChevronDown.vue index af9587d59..999f8a469 100644 --- a/src/components/shared/icons/ChevronDown.vue +++ b/src/components/shared/icons/ChevronDown.vue @@ -1,5 +1,5 @@ diff --git a/src/scss/use_of_funds/CompanyBudgets.scss b/src/scss/use_of_funds/CompanyBudgets.scss deleted file mode 100644 index 6c2a7628d..000000000 --- a/src/scss/use_of_funds/CompanyBudgets.scss +++ /dev/null @@ -1,47 +0,0 @@ -@use "../settings/colors"; - -.use_of_funds .company_budgets { - list-style-type: none; - padding: 0; - - &__row { - display: flex; - } - - &__col { - &--company { - flex: 0 0 80px; - } - &--graph { - flex: 1 0 auto; - display: flex; - padding: 5px 0; - align-items: center; - } - &--number { - flex: 0 0 85px; - text-align: right; - white-space: nowrap; - } - &--citation { - flex: 0 0 50px; - font-size: 14px; - text-align: right; - } - } - - &__budget_line { - background: #cecece; - min-width: 3px; - height: 10px; - } - - &__row--wikipedia { - .company_budgets__col--company { - font-weight: bold; - } - .company_budgets__budget_line { - background: colors.$primary; - } - } -} diff --git a/src/scss/use_of_funds/FundsContent.scss b/src/scss/use_of_funds/FundsContent.scss deleted file mode 100644 index 6610bce94..000000000 --- a/src/scss/use_of_funds/FundsContent.scss +++ /dev/null @@ -1,194 +0,0 @@ -@use "../settings/colors"; -@use 'sass:color'; -@import './variables'; -@import '../variables'; -$padding: 32px; -$padding_mobile: 16px; - -.use_of_funds { - background-color: #ffffff; - padding: $padding_mobile; - line-height: 1.5; - margin: -18px; - @media ( min-width: $use_of_funds_breakpoint_l ) { - padding: $padding; - } - - h2 { - font-size: 24px; - font-weight: bold; - border: 0; - padding-top: 0; - } - - h3 { - font-size: 1em; - font-weight: bold; - margin-top: 1em; - } - &__content { - font-size: 14px; - } - &__column--info { - flex: 1 1 auto; - flex-basis: 50%; - font-size: 12px; - padding-bottom: 12px; - - a { - white-space: nowrap; - } - } - &__info_text { - margin-bottom: 18px; - } - &__section--two-cols { - @media ( min-width: $use_of_funds_breakpoint_l ) { - display: flex; - } - } - &__section--orgchart { - padding-top: $padding; - @media ( min-width: $use_of_funds_breakpoint_s ) { - display: flex; - } - @media ( min-width: $use_of_funds_breakpoint_l ) { - font-size: 18px; - } - } - &__section--call_to_action { - text-align: center; - padding: $padding 0; - } - &__column { - flex: 1 1 auto; - flex-basis: 50%; - display: flex; - flex-direction: column; - } - &__section_intro { - margin-bottom: 34px; - width: 100%; - - @media ( min-width: $use_of_funds_breakpoint_s ) { - display: table; - } - h1 { - @media ( min-width: $use_of_funds_breakpoint_s ) { - display: table-cell; - width: 30%; - } - } - div { - @media ( min-width: $use_of_funds_breakpoint_s ) { - font-size: 18px; - display: table-cell; - padding-left: 72px; - } - } - } - - &__benefits_list { - background: #f4f4f4; - padding: $padding_mobile; - margin: $padding_mobile (-$padding_mobile) 0 (-$padding_mobile); - flex: 1 1 auto; - @media ( min-width: $use_of_funds_breakpoint_l ) { - padding: $padding; - margin: 0; - } - } - &__comparison { - background: #ebebeb; - padding: $padding_mobile; - flex: 1 1 auto; - margin: 0 (-$padding_mobile); - @media ( min-width: $use_of_funds_breakpoint_l ) { - padding: $padding; - margin: 0; - } - } - - &__icon-list { - margin: 0; - padding: 0; - - li { - margin: 0 0 14px 90px; - padding: 0; - position: relative; - list-style: none; - - &:before { - content: ' '; - position: absolute; - left: -90px; - width: 48px; - height: 52px; - background-repeat: no-repeat; - background-position-x: center; - } - } - - &_item--hand:before { - background: url( '/skins/laika/images/Icon_hand_holding_heart.svg' ); - } - - &_item--smartphone:before { - background: url( '/skins/laika/images/Icon_letter_W_on_smartphone.svg' ); - } - - &_item--world:before { - background: url( '/skins/laika/images/Icon_world.svg' ); - } - - &_item--megaphone:before { - background: url( '/skins/laika/images/Icon_werbung.svg' ); - } - - &_item--twentyfourseven:before { - background: url( '/skins/laika/images/Icon_24_7.svg' ); - } - } - - &__orgchart_text { - flex: 1 1 auto; - } - &__orgchart_image { - flex: 1 1 100%; - img { - padding: 0 50px; - } - } - - &__org { - display: inline-block; - } - &__org--wmf { - background-color: rgba( 184, 233, 134, 0.5 ); - } - &__org--wmfg { - background-color: rgba( 248, 231, 28, 0.5 ); - } - &__org--wmde { - background-color: rgba( 245, 166, 35, 0.5 ); - } - - &__call-to-action-button { - padding: 15px; - border: 0; - border-radius: 5px; - background: colors.$primary; - color: colors.$white; - font-size: 18px; - font-weight: bold; - cursor: pointer; - display: inline-block; - &:hover, - &:focus { - color: colors.$white; - background: color.adjust( colors.$primary, $lightness: -5% ); - text-decoration: none; - } - } -} diff --git a/src/scss/use_of_funds/FundsDistributionAccordion.scss b/src/scss/use_of_funds/FundsDistributionAccordion.scss deleted file mode 100644 index f82068ed9..000000000 --- a/src/scss/use_of_funds/FundsDistributionAccordion.scss +++ /dev/null @@ -1,60 +0,0 @@ -@import './variables'; - -.funds_distribution_accordion { - padding-bottom: 16px; - display: block; - - .funds_distribution_info_item { - summary { - list-style-type: none; - - &::-webkit-details-marker { - display: none; - } - } - - &__title { - font-weight: bold; - cursor: pointer; - border-top: 1px solid #979797; - line-height: 36px; - position: relative; - padding-left: 10px; - } - - &__text { - padding-left: 10px; - } - - &:last-child { - border-bottom: 1px solid #979797; - } - - &.active:last-child .funds_distribution_info_item__title { - border-bottom: 0; - } - - &.active:last-child .funds_distribution_info_item__text { - border-bottom: 1px solid #979797; - padding-bottom: 1em; - } - - &__title:after { - background: url( '/skins/laika/images/Chevron-left.svg' ) no-repeat center; - height: 36px; - width: 36px; - position: absolute; - content: ''; - right: 0; - opacity: 0.5; - /* stylelint-disable-next-line function-parentheses-space-inside */ - transform: rotate(-90deg); - } - - &[open] .funds_distribution_info_item__title:after { - /* stylelint-disable-next-line function-parentheses-space-inside */ - transform: rotate(90deg); - } - } -} - diff --git a/src/scss/use_of_funds/variables.scss b/src/scss/use_of_funds/variables.scss deleted file mode 100644 index aa7cb6b5d..000000000 --- a/src/scss/use_of_funds/variables.scss +++ /dev/null @@ -1,4 +0,0 @@ -$use_of_funds_breakpoint_xs: 600px; -$use_of_funds_breakpoint_s: 768px; -$use_of_funds_breakpoint_m: 800px; -$use_of_funds_breakpoint_l: 1090px;