Skip to content

Commit

Permalink
make image responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
axherrm committed Dec 19, 2023
1 parent a89320d commit f753436
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 4 deletions.
19 changes: 16 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
<main>
<div #background style="width: 100vw; height: 100vh; display: flex; position: fixed; z-index: -100">
<img ngSrc="./assets/avatar.png" alt="Photo of Axel Herrmann" width="6000" height="3200"
style="min-width:100vw; min-height:100vh; width: auto; height: auto; object-fit: cover"
>
<!-- <img-->
<!-- srcset= "../assets/avatar_600.png 600w,-->
<!-- ../assets/avatar_1000x533.png 1000w,-->
<!-- ../assets/avatar_1500x800.png 1500w,-->
<!-- ../assets/avatar_2000x1066.png 2000w,-->
<!-- ../assets/avatar_2500x1333.png 2500w,-->
<!-- ../assets/avatar_3000x1600.png 3000w,-->
<!-- ../assets/avatar_6000x3200.png 6000w"-->
<!-- sizes="100vw"-->
<!-- src="../assets/avatar_600.png"-->
<!-- alt=""-->
<!-- style="min-width:100vw; min-height:100vh; width: auto; height: auto; object-fit: cover;"-->
<!-- />-->
<img width="6000" height="3200"
ngSrc="assets/avatar" ngSrcset="600w, 1000w, 1500w, 2000w, 2500w, 3000w, 6000w"
alt="" style="min-width:100vw; min-height:100vh; width: auto; height: auto; object-fit: cover;"/>
</div>

<div #lang_selector style="right: calc(2vh + 64px); top: 2vh; position: fixed; z-index: 1000">
Expand Down
11 changes: 10 additions & 1 deletion src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { ApplicationConfig } from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import {IMAGE_LOADER, ImageLoaderConfig} from "@angular/common";

export const appConfig: ApplicationConfig = {
providers: [provideAnimations()]
providers: [
provideAnimations(),
{
provide: IMAGE_LOADER,
useValue: (config: ImageLoaderConfig) => {
return `${location.origin}/${config.src}_${config.width}.png`;
}
}
]
};
Empty file removed src/assets/.gitkeep
Empty file.
Binary file added src/assets/avatar_1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/avatar_1500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/avatar_2000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/avatar_2500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/avatar_3000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/avatar_600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit f753436

Please sign in to comment.