Fix some bugs
This commit is contained in:
parent
1893b774e7
commit
fd14613db7
123 changed files with 187 additions and 31 deletions
0
src/page/about/about.html.ts
Normal file → Executable file
0
src/page/about/about.html.ts
Normal file → Executable file
0
src/page/about/about.scss
Normal file → Executable file
0
src/page/about/about.scss
Normal file → Executable file
0
src/page/about/about.ts
Normal file → Executable file
0
src/page/about/about.ts
Normal file → Executable file
5
src/page/background/animation.ts
Normal file → Executable file
5
src/page/background/animation.ts
Normal file → Executable 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
0
src/page/background/background.html.ts
Normal file → Executable file
0
src/page/background/background.scss
Normal file → Executable file
0
src/page/background/background.scss
Normal file → Executable file
12
src/page/background/background.ts
Normal file → Executable file
12
src/page/background/background.ts
Normal file → Executable 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
0
src/page/background/blob.ts
Normal file → Executable file
0
src/page/background/vec2.ts
Normal file → Executable file
0
src/page/background/vec2.ts
Normal file → Executable file
0
src/page/background/vec3.ts
Normal file → Executable file
0
src/page/background/vec3.ts
Normal file → Executable file
0
src/page/content/content.html.ts
Normal file → Executable file
0
src/page/content/content.html.ts
Normal file → Executable file
0
src/page/content/content.scss
Normal file → Executable file
0
src/page/content/content.scss
Normal file → Executable file
0
src/page/content/content.ts
Normal file → Executable file
0
src/page/content/content.ts
Normal file → Executable file
0
src/page/footer/footer.html.ts
Normal file → Executable file
0
src/page/footer/footer.html.ts
Normal file → Executable file
0
src/page/footer/footer.scss
Normal file → Executable file
0
src/page/footer/footer.scss
Normal file → Executable file
0
src/page/footer/footer.ts
Normal file → Executable file
0
src/page/footer/footer.ts
Normal file → Executable file
0
src/page/image-viewer/image-viewer.html.ts
Normal file → Executable file
0
src/page/image-viewer/image-viewer.html.ts
Normal file → Executable file
0
src/page/image-viewer/image-viewer.scss
Normal file → Executable file
0
src/page/image-viewer/image-viewer.scss
Normal file → Executable file
9
src/page/image-viewer/image-viewer.ts
Normal file → Executable file
9
src/page/image-viewer/image-viewer.ts
Normal file → Executable 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
0
src/page/index.ts
Normal file → Executable file
0
src/page/theme-switcher/theme-switcher.html.ts
Normal file → Executable file
0
src/page/theme-switcher/theme-switcher.html.ts
Normal file → Executable file
12
src/page/theme-switcher/theme-switcher.scss
Normal file → Executable file
12
src/page/theme-switcher/theme-switcher.scss
Normal file → Executable 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
0
src/page/theme-switcher/theme-switcher.ts
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.html.ts
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.html.ts
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.scss
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.scss
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.ts
Normal file → Executable file
0
src/page/timeline/timeline-element/timeline-element.ts
Normal file → Executable file
0
src/page/timeline/timeline.html.ts
Normal file → Executable file
0
src/page/timeline/timeline.html.ts
Normal file → Executable file
0
src/page/timeline/timeline.scss
Normal file → Executable file
0
src/page/timeline/timeline.scss
Normal file → Executable file
0
src/page/timeline/timeline.ts
Normal file → Executable file
0
src/page/timeline/timeline.ts
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue