diff --git a/src/data/portfolio.ts b/src/data/create-portfolio.ts similarity index 89% rename from src/data/portfolio.ts rename to src/data/create-portfolio.ts index 3877ac3..6803680 100644 --- a/src/data/portfolio.ts +++ b/src/data/create-portfolio.ts @@ -20,8 +20,9 @@ import { photosTimelineElement } from './projects/photos'; import { platformGameTimelineElement } from './projects/platform-game'; import { sdf2dTimelineElement } from './projects/sdf2d'; import { towersTimelineElement } from './projects/towers'; +import { CV, Email, GitHubLink, LinkedIn } from './shared'; -export const create = (): Array => [ +export const createPortfolio = (): Array => [ new Main( new PageBackground(1, 1), new PageHeader({ @@ -62,12 +63,12 @@ export const create = (): Array => [ }), Footer({ title: `Learn more`, - curriculaVitae: [{ name: `Download my CV`, url: cvEnglish }], - email: `andras@schmelczer.dev`, - linkedInLink: `https://www.linkedin.com/in/andras-schmelczer`, - linkedInText: 'Find me on LinkedIn', - gitHubLink: `https://github.com/schmelczer`, - gitHubText: 'Find me on GitHub', + links: [ + CV(cvEnglish), + GitHubLink('https://github.com/schmelczer'), + LinkedIn('https://www.linkedin.com/in/andras-schmelczer'), + Email('mailto:andras@schmelczer.dev'), + ], lastEditText: `Last modified on `, }) ), diff --git a/src/data/shared.ts b/src/data/shared.ts index 8684a33..a91b7e0 100644 --- a/src/data/shared.ts +++ b/src/data/shared.ts @@ -1,16 +1,24 @@ import cvIcon from '../../static/icons/cv.svg'; -import githubIcon from '../../static/icons/github.svg'; +import emailIcon from '../../static/icons/email.svg'; +import gitHubIcon from '../../static/icons/github.svg'; +import linkedInIcon from '../../static/icons/linkedin.svg'; import openIcon from '../../static/icons/open.svg'; import packageIcon from '../../static/icons/package.svg'; import pythonIcon from '../../static/icons/python.svg'; import youtubeIcon from '../../static/icons/youtube.svg'; import { ImageAnchorFactory } from '../page/basics/image-anchor/image-anchor.html'; +import { ImageButtonFactory } from '../page/basics/image-button/image-button.html'; -export const GitHub = ImageAnchorFactory(githubIcon, 'Open on GitHub'); -export const NPM = ImageAnchorFactory(packageIcon, 'Open on npm'); -export const PyPi = ImageAnchorFactory(pythonIcon, 'Open on PyPi'); -export const Open = ImageAnchorFactory(openIcon, 'Open in new tab'); -export const Thesis = ImageAnchorFactory(cvIcon, 'Download thesis', { +export const GitHub = ImageButtonFactory(gitHubIcon, 'Open on GitHub'); +export const NPM = ImageButtonFactory(packageIcon, 'Open on npm'); +export const PyPi = ImageButtonFactory(pythonIcon, 'Open on PyPi'); +export const Open = ImageButtonFactory(openIcon, 'Open in new tab'); +export const Thesis = ImageButtonFactory(cvIcon, 'Download thesis', { shouldDownload: true, }); -export const Youtube = ImageAnchorFactory(youtubeIcon, 'Open on YouTube'); +export const Youtube = ImageButtonFactory(youtubeIcon, 'Open on YouTube'); + +export const CV = ImageAnchorFactory(cvIcon, 'Download my CV'); +export const GitHubLink = ImageAnchorFactory(gitHubIcon, 'Find me on GitHub'); +export const LinkedIn = ImageAnchorFactory(linkedInIcon, 'Find me on LinkedIn'); +export const Email = ImageAnchorFactory(emailIcon, 'andras@schmelczer.dev'); diff --git a/src/index.ts b/src/index.ts index 15e2602..3eb05d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import '../static/no-change/favicons/favicon.ico'; import '../static/no-change/favicons/site.webmanifest'; import '../static/no-change/og-image.jpg'; import '../static/no-change/robots.txt'; -import { create as createPortfolio } from './data/portfolio'; +import { createPortfolio } from './data/create-portfolio'; import { addSupportForTabNavigation } from './helper/add-support-for-tab-navigation'; import { removeUnnecessaryOutlines } from './helper/remove-unnecessary-outlines'; import { scrollToFragment } from './helper/scroll-to-fragment'; diff --git a/src/page/basics/image-anchor/image-anchor.html.ts b/src/page/basics/image-anchor/image-anchor.html.ts index 8f8b534..41c9628 100644 --- a/src/page/basics/image-anchor/image-anchor.html.ts +++ b/src/page/basics/image-anchor/image-anchor.html.ts @@ -9,15 +9,10 @@ export const ImageAnchorFactory = ) => (href: url) => ` - -
+ -

${title}

- `; diff --git a/src/page/basics/image-anchor/image-anchor.scss b/src/page/basics/image-anchor/image-anchor.scss index 1d5f683..519b4d4 100644 --- a/src/page/basics/image-anchor/image-anchor.scss +++ b/src/page/basics/image-anchor/image-anchor.scss @@ -1,25 +1,21 @@ @use '../../../style/mixins' as *; .image-anchor { - @include image-button(var(--icon-size)); + display: flex; + align-items: center; - .svg-container { - position: relative; - margin: auto; - @include square(var(--icon-size)); - - svg { - stroke: var(--normal-text-color); - transition: stroke var(--transition-time), transform var(--transition-time); - } + &:not(:first-child) { + padding-top: var(--line-height); } - p { - @include main-font(); - padding-bottom: var(--small-margin); - font-size: 0.9rem; - font-style: italic; - padding: 0 8px 8px 8px; - text-align: center; + svg { + @include square(var(--icon-size)); + margin-right: calc(var(--small-margin) / 2); + stroke: var(--normal-text-color); + } + + a { + @include link; + font-size: 1.4rem; } } diff --git a/src/page/basics/image-button/image-button.html.ts b/src/page/basics/image-button/image-button.html.ts new file mode 100644 index 0000000..10a3c2d --- /dev/null +++ b/src/page/basics/image-button/image-button.html.ts @@ -0,0 +1,23 @@ +import { url } from '../../../types/url'; +import './image-button.scss'; + +export const ImageButtonFactory = + ( + svg: string, + title: string, + { shouldDownload = false }: { shouldDownload?: boolean } = {} + ) => + (href: url) => + ` + +
+ ${svg} +
+

${title}

+
+`; diff --git a/src/page/basics/image-button/image-button.scss b/src/page/basics/image-button/image-button.scss new file mode 100644 index 0000000..a2d89ea --- /dev/null +++ b/src/page/basics/image-button/image-button.scss @@ -0,0 +1,25 @@ +@use '../../../style/mixins' as *; + +.image-button { + @include image-button(var(--icon-size)); + + .svg-container { + position: relative; + margin: auto; + @include square(var(--icon-size)); + + svg { + stroke: var(--normal-text-color); + transition: stroke var(--transition-time), transform var(--transition-time); + } + } + + p { + @include main-font(); + padding-bottom: var(--small-margin); + font-size: 0.9rem; + font-style: italic; + padding: 0 8px 8px 8px; + text-align: center; + } +} diff --git a/src/page/footer/footer.html.ts b/src/page/footer/footer.html.ts index a54ee33..91b2549 100644 --- a/src/page/footer/footer.html.ts +++ b/src/page/footer/footer.html.ts @@ -1,9 +1,4 @@ -import cvIcon from '../../../static/icons/cv.svg'; -import emailIcon from '../../../static/icons/email.svg'; -import githubIcon from '../../../static/icons/github.svg'; -import linkedinIcon from '../../../static/icons/linkedin.svg'; import { html } from '../../types/html'; -import { url } from '../../types/url'; import './footer.scss'; // @ts-ignore: injected by webpack @@ -11,54 +6,25 @@ const LAST_EDIT = new Date(__CURRENT_DATE__); export const Footer = ({ title, - email, - curriculaVitae, - linkedInLink, - linkedInText, - gitHubLink, - gitHubText, + links, lastEditText, }: { title: string; - email: string; - curriculaVitae: Array<{ - name: string; - url: url; - }>; - linkedInLink: url; - linkedInText: string; - gitHubLink: url; - gitHubText: string; + links: Array; lastEditText: string; }): html => ` `; diff --git a/src/page/footer/footer.scss b/src/page/footer/footer.scss index eef3f9a..f6fd419 100644 --- a/src/page/footer/footer.scss +++ b/src/page/footer/footer.scss @@ -1,57 +1,24 @@ @use '../../style/mixins' as *; -footer#footer { +#footer { text-align: center; margin-top: var(--large-margin); - a { - @include link; - } - h2 { @include title-font(); } - ul { - margin-top: var(--normal-margin); - list-style: none; + .links { + margin: var(--normal-margin) 0 0 var(--normal-margin); display: inline-block; - text-align: left; - - li { - @include center-children(); - justify-content: flex-start; - - &:not(:first-child) { - padding-top: var(--line-height); - } - - svg { - @include square(var(--icon-size)); - margin-right: calc(var(--small-margin) / 2); - stroke: var(--normal-text-color); - } - - a { - font-size: 1.4rem; - } - } } - aside.other { - @include center-children(); - flex-direction: column; - margin: var(--large-margin) auto 0 auto; - padding-bottom: var(--line-height); - width: var(--body-width); + aside { + margin: var(--large-margin) auto var(--line-height) auto; p { - display: inline; - &, - * { - @include special-text-font(); - color: var(--normal-text-color); - } + @include special-text-font(); + color: var(--normal-text-color); opacity: 0.75; } }