Skip to content

Commit

Permalink
Add past page log and sitemapper
Browse files Browse the repository at this point in the history
  • Loading branch information
xypnox committed Jul 31, 2024
1 parent aac489e commit 87311d0
Show file tree
Hide file tree
Showing 11 changed files with 549 additions and 6 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"iconify-icon": "^1.0.8",
"localforage": "^1.10.0",
"lodash.debounce": "^4.0.8",
"lodash.groupby": "^4.6.0",
"nanoid": "^5.0.4",
"remark-breaks": "^4.0.0",
"sharp": "^0.32.6",
Expand All @@ -50,6 +51,7 @@
"devDependencies": {
"@iconify-json/ph": "^1.1.13",
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.groupby": "^4.6.9",
"@types/node": "^20.9.3",
"@types/tinycolor2": "^1.4.6",
"@types/xml2js": "^0.4.14",
Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions src/components/now.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const ItemWrapper = styled("div")`
`

const ProfileImage = styled("div")`
max-width: 30em;
max-height: 30em;
--scale1: 0.85;
--scale2: 0.7;
@keyframes rotating {
Expand Down Expand Up @@ -243,8 +245,15 @@ export const Now = () => {
gap={2}
>
<Show when={data.photo}>
<ProfileImage>
<img src={data.photo} alt={data.photoAlt} title={data.photoAlt} />
<ProfileImage >
<img
style={{
// width: '100%',
'max-width': '30em',
// height: '100%',
'max-height': '30em',
}}
src={data.photo} alt={data.photoAlt} title={data.photoAlt} />
{/* <img src={'/logo.svg'} alt={data.photoAlt} title={data.photoAlt} /> */}
<div class="fixed-ring" />
<div class="glow-1" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/profileLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { TootFeed as TootFeedSolid } from "../components/tootfeed.tsx";
}
</div>
<div class="profile-feed">
<TootFeedSolid client:load max={6} />
<TootFeedSolid client:visible max={6} />
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/projectImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const ImageInfo = styled("div")`
padding-left: 1.25rem;
}
li {
font-size: var(--font-size-base);
font-size: var(--font-size-md);
margin: 0;
}
@media (max-width: 1200px) {
Expand Down
196 changes: 196 additions & 0 deletions src/content/past.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
type CommonEvent = {
category: 'personal' | 'work' | 'consult' | 'education' | 'award'
icon: string // use iconify icons
title: string
url?: string
column?: number
start: string
}
type PastEvent = {
type: 'event'
end?: string
url?: string
current?: boolean
} & CommonEvent | {
type: 'milestone'
url?: string
} & CommonEvent

export const data: {
description: string
events: PastEvent[]
} = {
description: 'A chronological log of the events of my life.',
events: [
// WORK
{
type: 'event',
category: 'consult',
icon: 'ph:briefcase',
title: 'Calry',
// column: 2,
start: '2023-10-01',
current: true,
url: '/project/calry'
},
{
type: 'event',
category: 'work',
icon: 'ph:briefcase',
title: 'Calry',
// column: 2,
start: '2023-03-01',
end: '2023-08-30',
url: '/project/calry'
},
{
type: 'event',
category: 'work',
icon: 'ph:briefcase',
title: 'Flataway',
start: '2024-07-01',
current: true,
},
{
type: 'event',
category: 'consult',
icon: 'ph:briefcase',
title: 'rifa.ai',
start: '2024-05-01',
current: true,
},
{
type: 'event',
category: 'consult',
icon: 'ph:briefcase',
title: 'Fifthtry',
start: '2024-03-01',
end: '2024-03-31',
},
{
type: 'event',
category: 'personal',
icon: '',
title: 'notes',
start: '2022-03-01',
current: true,
url: '/project/notes'
},
{
type: 'event',
category: 'personal',
icon: '',
title: 'xip',
start: '2024-02-01',
current: true,
url: 'https://xip.netlify.app/',
},
{
type: 'event',
category: 'work',
icon: 'ph:briefcase',
title: 'Finbox',
start: '2019-05-01',
end: '2019-07-31',
url: '/project/finbox/'
},
{
type: 'event',
category: 'work',
icon: 'ph:briefcase',
title: 'Workduck',
start: '2021-04-01',
end: '2023-01-01',
url: '/project/workduck/'
},
{
type: 'event',
category: 'work',
icon: 'ph:briefcase',
title: 'Fifthtry',
start: '2020-07-01',
end: '2020-09-31',
url: '/project/fifthtry/'
},

// Education

{
type: 'event',
category: 'education',
icon: '',
title: 'Physics, KGP',
start: '2017-06-01',
end: '2022-08-01'
},
{
type: 'event',
category: 'education',
icon: '',
title: 'KOSS',
start: '2018-02-01',
end: '2022-08-01'
},
// <iconify-icon icon="ph:trophy-duotone"></iconify-icon>
{
type: 'milestone',
category: 'award',
icon: 'ph:trophy-duotone',
title: 'GrameenSetu',
start: '2022-08-01',
url: '/project/grameen-setu/'
},
{
type: 'milestone',
category: 'award',
icon: 'ph:trophy-duotone',
title: 'MARG',
start: '2021-08-01',
url: '/project/marg/'
},
]
}


// This includes the layout positions in grid of the past events
type PastEventRender = PastEvent & {
gridStart: number
gridSpan?: number
}

const monthDistance = (date: Date, date2 = new Date()) => {
// Take year into consideration
const t = date2.getTime() - date.getTime()
return t / (1000 * 60 * 60 * 24 * 30)
}

export const pastEventRender: PastEventRender[] = data.events.map((event, index) => {
if (event.type === 'milestone') {
return {
...event,
gridStart: Number(monthDistance(new Date(event.start)).toFixed(0)),
}
}
// End distance in months
const endDistance = monthDistance(new Date(event.start), event.end ? new Date(event.end) : new Date()).toFixed(0)

return {
...event,
gridStart: event.end !== undefined
? Number(monthDistance(new Date(event.end)).toFixed(0))
: Number(monthDistance(new Date()).toFixed(0)),
gridSpan: Number(endDistance),
}
})

export const legends = [2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024].map(year => (
{
title: year.toString(),
gridStart: year === 2024 ? 1 : (Number(monthDistance(new Date(`${year}-12-31`)).toFixed(0))),
gridSpan: year === 2024
? Number(new Date().getMonth())
: 12,
}
))

export const totalMonths = Number(monthDistance(new Date('2017-01-01')).toFixed(0))
2 changes: 1 addition & 1 deletion src/pages/now.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TootFeed as TootFeedSolid } from "../components/tootfeed.tsx";
<main>
<NowSolid client:load />
<div class="separator">❦ </div>
<TootFeedSolid title="And some musings" description="with the curtesy of" client:load />
<TootFeedSolid title="And some musings" description="with the curtesy of" client:visible />
</main>
</Layout>

Expand Down
Loading

0 comments on commit 87311d0

Please sign in to comment.