Skip to content

Commit

Permalink
Tweak the print version
Browse files Browse the repository at this point in the history
  • Loading branch information
tyom committed Aug 9, 2024
1 parent 4090eab commit 89b51fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
11 changes: 2 additions & 9 deletions src/components/ExperienceItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
} from '$lib/utils';
import List from './List';
const PRINT_TRUNCATE_NUMBER_OF_YEARS = 4;
function shouldHideFromPrint() {
const itemStartYear = parseInt(end.year);
const yearsAgo = new Date().getFullYear() - PRINT_TRUNCATE_NUMBER_OF_YEARS;
return itemStartYear < yearsAgo;
}
export let name;
export let description = null;
export let start = {};
Expand All @@ -21,6 +13,7 @@
export let role = '';
export let isContractor = false;
export let technologies = [];
export let includeInPrint = true;
const numberOfFullMonths = getNumberOfMonthsBetweenDates(start, end);
const duration = formatMonthsToYearsAndMonths(numberOfFullMonths);
Expand All @@ -29,7 +22,7 @@
<div
class="experience-item space-y-4 break-inside-avoid-page max-w-[70ch]"
class:contractor={isContractor}
class:print:hidden={shouldHideFromPrint()}
class:print:hidden={!includeInPrint}
>
<header class="space-y-1">
<div class="text-sm font-medium">
Expand Down
6 changes: 4 additions & 2 deletions src/components/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import ExperienceItem from './ExperienceItem.svelte';
import Timeline from './Timeline.svelte';
const NUMBER_OF_ITEMS_TO_SHOW_IN_PRINT = 6;
export let title;
export let items = [];
export let showTimeline = false;
Expand Down Expand Up @@ -35,8 +37,8 @@
class="divided space-y-4 p-8 md:p-12 pt-0 md:pt-0 print:!p-0"
class:!pt-8={showTimeline}
>
{#each items as item}
<ExperienceItem {...item} />
{#each items as item, idx}
<ExperienceItem {...item} includeInPrint={idx <= NUMBER_OF_ITEMS_TO_SHOW_IN_PRINT} />
{/each}
</div>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Summary.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</script>

<div
class="summary p-8 md:p-12 print:!p-0 flex flex-1 flex-col gap-4 text-sm relative"
class="summary p-8 md:p-12 print:!p-0 flex flex-1 flex-col gap-4 text-sm"
>
<h1 class="font-bold tracking-wide leading-none text-[2.9em]">
{name}
Expand Down Expand Up @@ -97,7 +97,7 @@
{/if}
</footer>
{/if}
<div class="hidden print:block break-before-page space-y-1 mt-4">
<div class="hidden print:block break-before-page space-y-1 absolute bottom-0 left-0">
<p class="flex items-center gap-2 leading-none">
<Icon name="info" class="size-8" />
<span class="max-w-[22ch]"
Expand Down
Binary file modified static/tyom-semonov-cv.pdf
Binary file not shown.

0 comments on commit 89b51fb

Please sign in to comment.