diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image.avif b/frontend/packages/vkt/public/images/excellent_level_card_image.avif new file mode 100644 index 000000000..9dbfdd508 Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image.avif differ diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image.jpg b/frontend/packages/vkt/public/images/excellent_level_card_image.jpg new file mode 100644 index 000000000..9e6e55ad8 Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image.jpg differ diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image.webp b/frontend/packages/vkt/public/images/excellent_level_card_image.webp new file mode 100644 index 000000000..1931d85e6 Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image.webp differ diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image_2x.avif b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.avif new file mode 100644 index 000000000..b90086813 Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.avif differ diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image_2x.jpg b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.jpg new file mode 100644 index 000000000..e085ee33d Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.jpg differ diff --git a/frontend/packages/vkt/public/images/excellent_level_card_image_2x.webp b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.webp new file mode 100644 index 000000000..e63cbd4bc Binary files /dev/null and b/frontend/packages/vkt/public/images/excellent_level_card_image_2x.webp differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.avif b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.avif new file mode 100644 index 000000000..73b74a2df Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.avif differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.jpg b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.jpg new file mode 100644 index 000000000..0f9c5911c Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.jpg differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.webp b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.webp new file mode 100644 index 000000000..0d6a53d8f Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image.webp differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.avif b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.avif new file mode 100644 index 000000000..ccd41ce80 Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.avif differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.jpg b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.jpg new file mode 100644 index 000000000..f7f5f7075 Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.jpg differ diff --git a/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.webp b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.webp new file mode 100644 index 000000000..dc3e27b94 Binary files /dev/null and b/frontend/packages/vkt/public/images/good_satisfactory_level_card_image_2x.webp differ diff --git a/frontend/packages/vkt/src/pages/PublicHomePage.tsx b/frontend/packages/vkt/src/pages/PublicHomePage.tsx index 81a428420..c8167e611 100644 --- a/frontend/packages/vkt/src/pages/PublicHomePage.tsx +++ b/frontend/packages/vkt/src/pages/PublicHomePage.tsx @@ -9,6 +9,12 @@ import { useWindowProperties } from 'shared/hooks'; import { useCommonTranslation, usePublicTranslation } from 'configs/i18n'; import { AppRoutes } from 'enums/app'; +import ExcellentLevelCardImageAvif from 'public/images/excellent_level_card_image.avif'; +import ExcellentLevelCardImageJpeg from 'public/images/excellent_level_card_image.jpg'; +import ExcellentLevelCardImageWebp from 'public/images/excellent_level_card_image.webp'; +import GoodAndSatisfactoryLevelCardImageAvif from 'public/images/good_satisfactory_level_card_image.avif'; +import GoodAndSatisfactoryLevelCardImageJpeg from 'public/images/good_satisfactory_level_card_image.jpg'; +import GoodAndSatisfactoryLevelCardImageWebp from 'public/images/good_satisfactory_level_card_image.webp'; const LinkButton = ({ to, label }: { to: AppRoutes; label: string }) => { return ( @@ -26,11 +32,13 @@ const LinkButton = ({ to, label }: { to: AppRoutes; label: string }) => { const LevelCard = ({ heading, + image, contents, linkLabel, linkTo, }: { heading: string; + image: React.JSX.Element; contents: React.JSX.Element; linkLabel: string; linkTo: AppRoutes; @@ -41,7 +49,11 @@ const LevelCard = ({ elevation={2} >
-
+
+
+ {image} +
+
{heading} @@ -53,9 +65,20 @@ const LevelCard = ({ ); }; +const ExcellentLevelCardImage = () => { + return ( + + + + + + ); +}; + const ExcellentLevelCard = () => { return ( } heading="Erinomaisen taidon tutkinnot" contents={ <> @@ -71,9 +94,26 @@ const ExcellentLevelCard = () => { ); }; +const GoodAndSatisfactoryLevelCardImage = () => { + return ( + + + + + + ); +}; + const GoodAndSatisfactoryLevelCard = () => { return ( } heading="Hyvän ja tyydyttävän taidon tutkinnot" contents={ @@ -193,3 +233,16 @@ export const PublicHomePage: FC = () => { ); }; + +// Kuvien speksit: 480px x 231px +// - aspect ratio 2.08:1 +// Erinomaisen taidon kuva +// - 5500px x 3667px +// - cropattu korkeussuunnassa, mutta ei leveyssuunnassa +// -> crop to 5500px x 2647px + +// Hyvän ja tyydyttävän taidon kuva +// - 5616px x 3744px +// - aspect ratio 3:2 +// - cropattu korkeussuunnassa, mutta ei leveyssuunnassa +// -> crop to 5616px x 2702px diff --git a/frontend/packages/vkt/src/styles/pages/_public-homepage.scss b/frontend/packages/vkt/src/styles/pages/_public-homepage.scss index b4780de64..59d0b00b9 100644 --- a/frontend/packages/vkt/src/styles/pages/_public-homepage.scss +++ b/frontend/packages/vkt/src/styles/pages/_public-homepage.scss @@ -43,10 +43,35 @@ } & &__level-description-card { - padding: 2rem; + @include phone { + width: 100%; + } @include not-phone { - width: 50%; - height: 50rem; + width: 48rem; + height: 49rem; + } + + .card-contents { + padding: 2rem; + } + + .card-image-wrapper { + position: relative; + // stylelint-disable-next-line selector-max-compound-selectors + .image-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: $color-secondary; + opacity: 0.5; + } + // stylelint-disable-next-line selector-max-compound-selectors + img { + aspect-ratio: 480/231; + width: 100%; + } } } } diff --git a/frontend/packages/vkt/webpack/custom.d.ts b/frontend/packages/vkt/webpack/custom.d.ts index 3b2145ef3..cbc13e1e3 100644 --- a/frontend/packages/vkt/webpack/custom.d.ts +++ b/frontend/packages/vkt/webpack/custom.d.ts @@ -4,6 +4,21 @@ declare module '*.svg' { export default content; } +declare module '*.avif' { + const content: any; + export default content; +} + +declare module '*.jpg' { + const content: any; + export default content; +} + +declare module '*.webp' { + const content: any; + export default content; +} + declare module '*.json' { const content: any; export default content; diff --git a/frontend/webpack.common.js b/frontend/webpack.common.js index ca3c16347..de2a29f3a 100644 --- a/frontend/webpack.common.js +++ b/frontend/webpack.common.js @@ -87,6 +87,13 @@ module.exports = (appName, env, dirName, port, entryPage = "etusivu") => { filename: `${STATIC_PATH}/assets/svg/[name][ext]`, }, }, + { + test: /\.(avif|jpg|webp)$/, + type: "asset/resource", + generator: { + filename: `${STATIC_PATH}/assets/images/[name][ext]` + } + } ], }, });