Fix some bugs

This commit is contained in:
Schmelczer András 2020-01-12 20:26:32 +01:00
parent 1893b774e7
commit fd14613db7
123 changed files with 187 additions and 31 deletions

0
src/framework/container-page.ts Normal file → Executable file
View file

0
src/framework/events/event-broadcaster.ts Normal file → Executable file
View file

0
src/framework/events/page-event.ts Normal file → Executable file
View file

0
src/framework/framework.scss Normal file → Executable file
View file

0
src/framework/helper/create-element.ts Normal file → Executable file
View file

0
src/framework/helper/get-height.ts Normal file → Executable file
View file

2
src/framework/helper/last.ts Normal file → Executable file
View file

@ -1,2 +1,2 @@
export const last = <T>(list: Array<T>): T =>
export const last = <T>(list: ArrayLike<T>): T =>
list.length >= 1 ? list[list.length - 1] : undefined;

0
src/framework/helper/mix-colors.ts Normal file → Executable file
View file

0
src/framework/helper/polyfills.ts Normal file → Executable file
View file

0
src/framework/helper/random.ts Normal file → Executable file
View file

0
src/framework/helper/sum.ts Normal file → Executable file
View file

0
src/framework/model/misc.ts Normal file → Executable file
View file

0
src/framework/page-element.ts Normal file → Executable file
View file

0
src/framework/primitives/implementations/anchor.ts Normal file → Executable file
View file

10
src/framework/primitives/implementations/image.ts Normal file → Executable file
View file

@ -3,6 +3,7 @@ import { html, ResponsiveImage } from '../../model/misc';
import { last } from '../../helper/last';
export class Image implements Primitive {
private static readonly IMAGE_SCREEN_RATIO = 0.8;
public constructor(
private readonly image: ResponsiveImage,
private readonly alt: string
@ -13,6 +14,15 @@ export class Image implements Primitive {
${!disableInnerShadow ? `<div class="figure-container">` : ''}
<img tabindex="0"
srcset="${this.image.srcSet}"
sizes="${this.image.images
.slice(0, -1)
.map(
d =>
`(max-width: ${d.width / Image.IMAGE_SCREEN_RATIO}px) ${
d.width
}px,`
)
.join('\n') + `\n${last(this.image.images).width}px`}"
src="${last(this.image.images)?.path}"
alt="${this.alt}"
/>

0
src/framework/primitives/implementations/text.ts Normal file → Executable file
View file

0
src/framework/primitives/implementations/video.ts Normal file → Executable file
View file

0
src/framework/primitives/primitive.ts Normal file → Executable file
View file

0
src/framework/styles/animations/animations.scss Normal file → Executable file
View file

0
src/framework/styles/animations/animations.ts Normal file → Executable file
View file

0
src/framework/styles/dark-mode/dark-mode.scss Normal file → Executable file
View file

0
src/framework/styles/dark-mode/dark-mode.ts Normal file → Executable file
View file

0
src/framework/styles/index.scss Normal file → Executable file
View file

2
src/framework/styles/wrapper.scss Normal file → Executable file
View file

@ -7,7 +7,7 @@ $large-screen-light-theme-variables: () !default;
$large-screen-dark-theme-variables: () !default;
@mixin on-small-screen() {
@media (max-width: $breakpoint-width) {
@media (max-width: $breakpoint-width - 1px) {
@content;
}
}

0
src/index.html Normal file → Executable file
View file

0
src/index.ts Normal file → Executable file
View file

0
src/model/portfolio.ts Normal file → Executable file
View file

0
src/page/about/about.html.ts Normal file → Executable file
View file

0
src/page/about/about.scss Normal file → Executable file
View file

0
src/page/about/about.ts Normal file → Executable file
View file

5
src/page/background/animation.ts Normal file → Executable file
View file

@ -7,9 +7,10 @@ export class Animation<T> {
private to: T,
private intervalInMs: number,
private interpolator: (from: T, to: T, q: number) => T,
private onChange?: (currentValue: T) => void
) {}
) {
this._value = from;
}
public step(deltaTimeInMs: number) {
if (this.elapsedTime === this.intervalInMs) {

0
src/page/background/background.html.ts Normal file → Executable file
View file

0
src/page/background/background.scss Normal file → Executable file
View file

12
src/page/background/background.ts Normal file → Executable file
View file

@ -142,7 +142,7 @@ export class PageBackground extends PageElement {
blob.topLeft.add(Vec3.from(blob.size, 0))
);
if (this.isInView(topLeft) || this.isInView(bottomRight)) {
if (this.isInView(topLeft, bottomRight)) {
blob.draw(this.ctx, topLeft, bottomRight.subtract(topLeft));
}
});
@ -175,12 +175,12 @@ export class PageBackground extends PageElement {
return new Vec2(p.x * m - z / 2, p.y * m - z / 2 + scrollPosition);
}
private isInView(p: Vec2): boolean {
private isInView(topLeft: Vec2, bottomRight: Vec2): boolean {
return (
0 <= p.x &&
p.x <= this.canvas.width &&
0 <= p.y &&
p.y <= this.canvas.height
((0 <= topLeft.x && topLeft.x <= this.canvas.width) ||
(0 <= bottomRight.x && bottomRight.x < this.canvas.width)) &&
((0 <= topLeft.y && topLeft.y <= this.canvas.height) ||
(0 <= bottomRight.y && bottomRight.y <= this.canvas.height))
);
}

0
src/page/background/blob.ts Normal file → Executable file
View file

0
src/page/background/vec2.ts Normal file → Executable file
View file

0
src/page/background/vec3.ts Normal file → Executable file
View file

0
src/page/content/content.html.ts Normal file → Executable file
View file

0
src/page/content/content.scss Normal file → Executable file
View file

0
src/page/content/content.ts Normal file → Executable file
View file

0
src/page/footer/footer.html.ts Normal file → Executable file
View file

0
src/page/footer/footer.scss Normal file → Executable file
View file

0
src/page/footer/footer.ts Normal file → Executable file
View file

0
src/page/image-viewer/image-viewer.html.ts Normal file → Executable file
View file

0
src/page/image-viewer/image-viewer.scss Normal file → Executable file
View file

9
src/page/image-viewer/image-viewer.ts Normal file → Executable file
View file

@ -28,10 +28,11 @@ export class PageImageViewer extends PageElement {
private handleClick(event: Event) {
const container = this.query('#container');
Array.prototype.forEach.call(container.childNodes, (e: HTMLElement) =>
e.remove()
);
container.appendChild((event.target as HTMLElement).cloneNode());
container.firstElementChild?.remove();
const element: HTMLImageElement = new Image();
element.src = (event.target as HTMLImageElement).src;
container.appendChild(element);
PageImageViewer.show(this.element);
}

0
src/page/index.ts Normal file → Executable file
View file

0
src/page/theme-switcher/theme-switcher.html.ts Normal file → Executable file
View file

12
src/page/theme-switcher/theme-switcher.scss Normal file → Executable file
View file

@ -3,9 +3,15 @@
@include responsive using($vars) {
input[type='checkbox']#theme-switcher {
@include on-large-screen {
position: fixed;
top: map_get($vars, $normal-margin);
right: map_get($vars, $normal-margin);
position: absolute;
top: -1 * map_get($vars, $small-margin);
right: calc(
-1 * (50vw - #{map_get($vars, $body-width)} / 2) + #{map_get(
$vars,
$normal-margin
)}
);
transform: translateY(-100%);
}
@include on-small-screen {

0
src/page/theme-switcher/theme-switcher.ts Normal file → Executable file
View file

View file

View file

0
src/page/timeline/timeline-element/timeline-element.ts Normal file → Executable file
View file

0
src/page/timeline/timeline.html.ts Normal file → Executable file
View file

0
src/page/timeline/timeline.scss Normal file → Executable file
View file

0
src/page/timeline/timeline.ts Normal file → Executable file
View file

0
src/portfolio.ts Normal file → Executable file
View file

0
src/static/cv/andras_schmelczer_cv_2020_01.pdf Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-italic.eot Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-italic.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Before After
Before After

0
src/static/fonts/lato/lato-v16-latin-italic.ttf Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-italic.woff Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-italic.woff2 Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-regular.eot Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-regular.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before After
Before After

0
src/static/fonts/lato/lato-v16-latin-regular.ttf Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-regular.woff Normal file → Executable file
View file

0
src/static/fonts/lato/lato-v16-latin-regular.woff2 Normal file → Executable file
View file

View file

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before After
Before After

View file

View file

View file

0
src/static/icons/cancel.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

Before After
Before After

0
src/static/media/avoid.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before After
Before After

0
src/static/media/color.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 570 KiB

After

Width:  |  Height:  |  Size: 570 KiB

Before After
Before After

0
src/static/media/forex.gif Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 475 KiB

After

Width:  |  Height:  |  Size: 475 KiB

Before After
Before After

0
src/static/media/forex.mp4 Normal file → Executable file
View file

0
src/static/media/forex.webm Normal file → Executable file
View file

0
src/static/media/led.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Before After
Before After

0
src/static/media/led.mp4 Normal file → Executable file
View file

0
src/static/media/led.webm Normal file → Executable file
View file

0
src/static/media/me-2.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 555 KiB

After

Width:  |  Height:  |  Size: 555 KiB

Before After
Before After

0
src/static/media/me.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Before After
Before After

0
src/static/media/my-notes.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 2 MiB

After

Width:  |  Height:  |  Size: 2 MiB

Before After
Before After

0
src/static/media/og-image.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 227 KiB

After

Width:  |  Height:  |  Size: 227 KiB

Before After
Before After

0
src/static/media/og.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before After
Before After

0
src/static/media/photos.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 366 KiB

After

Width:  |  Height:  |  Size: 366 KiB

Before After
Before After

0
src/static/media/platform.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Before After
Before After

0
src/static/media/process-simulator-input.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Before After
Before After

0
src/static/media/process-simulator.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Before After
Before After

0
src/static/media/simulation.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 457 KiB

After

Width:  |  Height:  |  Size: 457 KiB

Before After
Before After

0
src/static/no-change/favicon.ico Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

0
src/static/no-change/og-image.jpg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Before After
Before After

0
src/style/_id.scss Normal file → Executable file
View file

0
src/style/a.scss Normal file → Executable file
View file

0
src/style/configured-responsive.scss Normal file → Executable file
View file

0
src/style/fonts.scss Normal file → Executable file
View file

0
src/style/include.scss Normal file → Executable file
View file

0
src/style/mixins.scss Normal file → Executable file
View file

Some files were not shown because too many files have changed in this diff Show more