Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Irmantas Kaukas <irmastnt@gmail.com>
- Loading branch information
1 parent
6cc1ada
commit 238b979
Showing
9 changed files
with
306 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
apps/dsp-app/src/app/project/image-settings/image-display-absolute.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-image-display-absolute', | ||
template: ` <div class="frame"> | ||
<div class="text">Example image with width: {{ bigWidth }}px</div> | ||
<div | ||
[ngStyle]="{ width: (widthPx / bigWidth) * 300 + 'px', height: (widthPx / bigWidth) * 200 + 'px' }" | ||
class="back-rectangle"> | ||
<div class="arrow left-arrow"></div> | ||
<div class="arrow right-arrow"></div> | ||
<div class="helper"> | ||
{{ widthPx }} | ||
px | ||
</div> | ||
</div> | ||
</div>`, | ||
styles: [ | ||
` | ||
.frame { | ||
background: gray; | ||
width: 300px; | ||
height: 200px; | ||
position: relative; | ||
} | ||
.text { | ||
width: 100%; | ||
text-align: center; | ||
position: absolute; | ||
top: 20px; | ||
} | ||
.back-rectangle { | ||
background: darkgray; | ||
bottom: 0; | ||
right: 0; | ||
position: absolute; | ||
} | ||
.helper { | ||
position: absolute; | ||
bottom: -40px; | ||
right: 0; | ||
text-align: center; | ||
width: 100%; | ||
min-width: 100px; | ||
} | ||
.arrow { | ||
position: absolute; | ||
height: 1px; /* Adjust the height of the stick */ | ||
background-color: red; /* Adjust the color of the stick */ | ||
right: 0; | ||
bottom: -20px; | ||
width: 100%; | ||
} | ||
.left-arrow::before, | ||
.right-arrow::before { | ||
content: ''; | ||
position: absolute; | ||
top: -5px; | ||
width: 0; | ||
height: 0; | ||
border-top: 5px solid transparent; /* Adjust the height of the arrow */ | ||
border-bottom: 5px solid transparent; /* Adjust the height of the arrow */ | ||
} | ||
.left-arrow::before { | ||
right: 0; | ||
border-left: 10px solid red; /* Adjust the width and color of the arrow */ | ||
} | ||
.right-arrow::before { | ||
left: 0; | ||
border-right: 10px solid red; /* Adjust the width and color of the arrow */ | ||
} | ||
`, | ||
], | ||
}) | ||
export class ImageDisplayAbsoluteComponent { | ||
@Input() widthPx: number; | ||
readonly bigWidth = 2048; | ||
} |
74 changes: 74 additions & 0 deletions
74
apps/dsp-app/src/app/project/image-settings/image-display-ratio.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-image-display-ratio', | ||
template: ` <div class="frame"> | ||
<div [ngStyle]="{ width: ratio * 300 + 'px', height: ratio * 200 + 'px' }" class="back-rectangle"> | ||
<div class="arrow left-arrow"></div> | ||
<div class="arrow right-arrow"></div> | ||
<div class="helper">Ratio: {{ Math.ceil(ratio * 100) }}%</div> | ||
</div> | ||
</div>`, | ||
styles: [ | ||
` | ||
.frame { | ||
background: gray; | ||
width: 300px; | ||
height: 200px; | ||
position: relative; | ||
} | ||
.back-rectangle { | ||
background: darkgray; | ||
bottom: 0; | ||
right: 0; | ||
position: absolute; | ||
} | ||
.helper { | ||
min-width: 100px; | ||
position: absolute; | ||
bottom: -30px; | ||
right: 0; | ||
text-align: center; | ||
width: 100%; | ||
} | ||
.arrow { | ||
position: absolute; | ||
height: 1px; /* Adjust the height of the stick */ | ||
background-color: red; /* Adjust the color of the stick */ | ||
right: 0; | ||
bottom: 0px; | ||
width: 119%; | ||
transform: rotate(33deg); | ||
transform-origin: bottom right; | ||
} | ||
.left-arrow::before, | ||
.right-arrow::before { | ||
content: ''; | ||
position: absolute; | ||
top: -5px; | ||
width: 0; | ||
height: 0; | ||
border-top: 5px solid transparent; /* Adjust the height of the arrow */ | ||
border-bottom: 5px solid transparent; /* Adjust the height of the arrow */ | ||
} | ||
.left-arrow::before { | ||
right: 0; | ||
border-left: 10px solid red; /* Adjust the width and color of the arrow */ | ||
} | ||
.right-arrow::before { | ||
left: 0; | ||
border-right: 10px solid red; /* Adjust the width and color of the arrow */ | ||
} | ||
`, | ||
], | ||
}) | ||
export class ImageDisplayRatioComponent { | ||
@Input() ratio: number; | ||
protected readonly Math = Math; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 20 additions & 27 deletions
47
apps/dsp-app/src/app/project/image-settings/image-settings.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
@use '../../../styles/responsive' as *; | ||
|
||
@use '../../../styles/responsive' as *; | ||
|
||
.content { | ||
.form-content { | ||
width: 100%; | ||
} | ||
.mat-mdc-slider { | ||
width: 100%; | ||
} | ||
|
||
.content-sidebar { | ||
display: inline-block; | ||
width: 50%; | ||
} | ||
.action-buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.content-container { | ||
display: inline-block; | ||
padding-right: 32px; | ||
vertical-align: top; | ||
max-width: 298px; | ||
@media (min-width: 1000px) { | ||
.flex-with-gap { | ||
display: flex; | ||
gap: 48px | ||
} | ||
} | ||
|
||
.section { | ||
padding-bottom: 32px; | ||
} | ||
.mb-2 { | ||
margin-bottom: 16px; | ||
} | ||
|
||
.mat-mdc-slider { | ||
width: 100%; | ||
} | ||
.mb-6 { | ||
margin-bottom: 48px; | ||
} | ||
|
||
.action-buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
.mt-2 { | ||
margin-top: 16px; | ||
} |
Oops, something went wrong.