Skip to content

Commit

Permalink
feat: add about section
Browse files Browse the repository at this point in the history
  • Loading branch information
axherrm committed Jan 26, 2024
1 parent 5a5fb24 commit f1b3503
Show file tree
Hide file tree
Showing 29 changed files with 1,418 additions and 29 deletions.
854 changes: 846 additions & 8 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cv",
"version": "0.0.0",
"version": "0.1.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -17,6 +17,7 @@
"@angular/platform-browser": "^17.0.7",
"@angular/platform-browser-dynamic": "^17.0.7",
"@angular/router": "^17.0.7",
"@angular/material": "^17.0.7",
"@studio-freight/lenis": "^1.0.33",
"gsap": "^3.12.2",
"js-circle-progress": "^1.0.0-beta.0",
Expand Down
12 changes: 7 additions & 5 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ <h2 id="main-subheading" [innerHTML]="dataService.languagePack.subheading"></h2>
</div>
</div>

<div id="perspective-div" style="perspective: 10000px">
<div id="perspective-div" style="perspective: 10000px; display: flex; flex-direction: column; align-items: center">
<!-- [class.rotated]="sidebar.hovered" -->
<div class="content-container">
<heading-card #education_card id="education-start" [heading]="dataService.languagePack.education" type="light" styleClass="alarm-clock-animated"></heading-card>
<p-timeline id="eduction-tl" [value]="dataService.education" align="alternate" [style]="{'width': '70%', 'display': 'inline-block'}">
<p-timeline id="eduction-tl" [value]="dataService.education" align="alternate" [style]="{'width': '87.5%', 'display': 'inline-block'}">
<ng-template pTemplate="marker">
<span class="dot"></span>
</ng-template>
Expand All @@ -47,7 +47,7 @@ <h2 id="main-subheading" [innerHTML]="dataService.languagePack.subheading"></h2>
</p-timeline>

<heading-card id="experience-start" [heading]="dataService.languagePack.experience" type="dark" styleClass="alarm-clock-animated"></heading-card>
<p-timeline id="experience-tl" [value]="dataService.experience" align="alternate" [style]="{'width': '70%', 'display': 'inline-block'}">
<p-timeline id="experience-tl" [value]="dataService.experience" align="alternate" [style]="{'width': '87.5%', 'display': 'inline-block'}">
<ng-template pTemplate="marker">
<span class="dot"></span>
</ng-template>
Expand All @@ -62,11 +62,13 @@ <h2 id="main-subheading" [innerHTML]="dataService.languagePack.subheading"></h2>
</p-timeline>

<heading-card id="skills-start" [heading]="dataService.languagePack.skills" type="3" styleClass="alarm-clock-animated"></heading-card>
<div style="width: var(--main-content-width); margin: 0 var(--main-content-side-margin); display: flex; flex-direction: column; flex-wrap: nowrap; gap: 1rem">
<div style="width: 75%; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 1rem">
<skills-card class="alarm-clock-animated" *ngFor="let skillCategory of dataService.skillCategories" [category]="skillCategory"></skills-card>
</div>

<heading-card id="about-start" [heading]="dataService.languagePack.about" type="3" styleClass="alarm-clock-animated"></heading-card>
<heading-card id="about-start" [heading]="dataService.languagePack.about" type="3" styleClass="alarm-clock-animated" style="margin-top: 5vh"></heading-card>

<about [content]="dataService.about" [langPack]="dataService.languagePack"></about>

<div class="spacer" style="width: 100vw; height: 50vh"></div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
}

.content-container {
width: var(--main-content-width);
display: flex;
flex-direction: column;
text-align: center;
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {HeadingCardComponent} from "./components/heading-card/heading-card.compo
import {SkillsCardComponent} from "./components/skills-card/skills-card.component";
import {NavbarDotComponent} from "./components/navbar-dot/navbar-dot.component";
import {SidebarComponent} from "./sections/sidebar/sidebar.component";
import {AboutCardComponent} from "./components/about-card/about-card.component";
import {AboutComponent} from "./sections/about/about.component";

gsap.registerPlugin(ScrollTrigger);

Expand All @@ -33,7 +35,9 @@ import "./js/lenis.js";
HeadingCardComponent,
SkillsCardComponent,
NavbarDotComponent,
SidebarComponent
SidebarComponent,
AboutCardComponent,
AboutComponent
],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
Expand Down
26 changes: 26 additions & 0 deletions src/app/components/about-card/about-card.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="card">
<div class="card-content">
<!--TODO: cut off text properly-->
<div #text>
<span class="heading" [innerHTML]="content.heading"></span>
<span class="text" [innerHTML]="content.text"></span>
<ng-content></ng-content>
</div>
</div>
</div>
<div class="about-control-container">
<div class="title-card">
<div class="icon-row">
<div class="icon-container"><span class="pi pi-info-circle icon"></span></div>
</div>
<div class="title" [innerHTML]="content.title"></div>
</div>

<div class="show-more-button" (click)="toggleExtension()">
<div class="show-more">
<span *ngIf="!extended; else showLess">{{ langPack.showMore }}</span>
<ng-template #showLess>{{ langPack.showLess }}</ng-template>
</div>
<span class="icon pi pi-arrow-down" [class.extended]="extended"></span>
</div>
</div>
116 changes: 116 additions & 0 deletions src/app/components/about-card/about-card.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
:host {
display: flex;
flex-direction: var(--flex-row);
gap: 2rem;
transition: max-height 0.8s cubic-bezier(0.9, 0, 0.9, 1.0);
}

.about-container {
max-height: 20rem;
display: flex;
gap: 2rem;
}

.card {
width: auto;
min-width: 40rem;
border-radius: 1.5rem;
padding: 2rem;
background: #262626;

.card-content {
color: white;
height: 100%;
font-family: 'Inter', sans-serif;
font-weight: 200;
text-align: justify;
font-size: 1.4rem;
line-height: 1.8rem;
overflow: hidden
}
}

.about-control-container {
min-width: 16rem;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 2rem
}

.title-card {
border-radius: 1.5rem;
padding: 2rem;
background: #262626;

.icon-row {
display: flex;
justify-content: flex-end;
flex-direction: var(--flex-row);
margin-bottom: 3rem;

.icon-container {
background: black;
height: 3rem;
width: 3rem;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;

.icon {
color: white;
font-size: 1.5rem;
}
}
}

.title {
color: white;
font-family: 'Inter', sans-serif;
font-weight: 400;
letter-spacing: 0.1rem;
font-size: 1.9rem;
text-align: var(--title-align);
}
}

.heading {
font-weight: 200;
font-size: 2rem;
line-height: 2rem;
letter-spacing: 0.1rem;
background: -webkit-linear-gradient(left, #a445b2, #fa4299);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

.show-more-button {
border-radius: 1.5rem;
padding: 2rem;
background: #262626;
display: flex;
flex-wrap: nowrap;
flex-direction: var(--flex-row);
gap: .5rem;
align-items: center;
justify-content: space-between;
cursor: pointer;

.show-more {
color: white;
font-family: 'Inter', sans-serif;
font-weight: 400;
letter-spacing: 0.1rem;
font-size: 1.3rem
}

.icon {
color: white;
font-size: 1.3rem;
transition: transform 1s cubic-bezier(0.6, 0, 0.6, 1.0);
&.extended {
transform: rotateX(180deg);
}
}
}
40 changes: 40 additions & 0 deletions src/app/components/about-card/about-card.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {Component, ElementRef, HostBinding, Input, ViewChild} from '@angular/core';
import {NgIf} from "@angular/common";
import {AboutCard, LanguagePack} from "../../data/model";
import {ScrollTrigger} from "gsap/ScrollTrigger";

@Component({
selector: 'about-card',
standalone: true,
imports: [
NgIf
],
templateUrl: './about-card.component.html',
styleUrl: './about-card.component.scss'
})
export class AboutCardComponent {

@Input({required: true}) content: AboutCard;
@Input({required: true}) langPack: LanguagePack;

@ViewChild("text", {read: ElementRef}) textElement: ElementRef;

@HostBinding("style.max-height") maxHeight: string = "22rem";

extended: boolean = false;

toggleExtension() {
this.extended = !this.extended;
if (this.extended) {
const height = this.textElement.nativeElement.offsetHeight;
this.maxHeight = `calc(4rem + ${height}px + 1px)`;
} else {
this.maxHeight = "22rem";
}
// smoothly reset GSAP markers
for (let i = 1; i <= 40; i++) {
setTimeout(() => ScrollTrigger.refresh(), i * 20);
}
}

}
9 changes: 9 additions & 0 deletions src/app/components/badge/badge.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="container">
<div #glow class="glow"></div>
<div *ngIf="iconRef" class="icon">
<img [src]="iconRef" alt="" height="32">
</div>
<span *ngIf="iconClass" [class]="'icon pi ' + iconClass" [style]="{'color': iconColor}"></span>
<span class="text"><ng-content></ng-content></span>
<a *ngIf="link" [href]="link" target="_blank"></a>
</div>
75 changes: 75 additions & 0 deletions src/app/components/badge/badge.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
:host {
min-width: 2.25rem;
height: 2.75rem;
line-height: 2.75rem;
border-radius: 1rem;
text-align: center;
padding: .5rem .5rem;
color: black;

display: inline-block;
position: relative;

transition-duration: 300ms;
transition-property: transform, box-shadow;
transition-timing-function: ease-out;

&:hover {
transition-duration: 150ms;
box-shadow: 0 5px 20px 5px #00000044;
}

a {
border-radius: 1rem;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}

.glow {
border-radius: 1rem;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;

background-image: radial-gradient(circle at 50% -20%, #ffffff22, #0000000f);
}

.container {
display: flex;
flex-wrap: nowrap;
gap: 0.3rem;
align-items: center;
height: 100%;
}

.icon {
max-height: 100%;
display: flex;
align-items: center;
//margin-right: 0.3rem;
//max-height: 2.25rem;
//height: 100%;
//width: auto;
font-size: 2rem;

object {
//height: 100%;
//width: auto;
}

//img {
// height: 100%;
//}
}

.text {
font-weight: 700;
font-size: 1.25rem;
transform: translateY(2px);
}
Loading

0 comments on commit f1b3503

Please sign in to comment.