scouting: button to switch field pov
Signed-off-by: emilym <emily.markova@gmail.com>
Change-Id: Ic5e22194c863c0a573b35b553c98c10d7be5e6d7
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index d6829c5..08f4dd4 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -38,6 +38,23 @@
f: 'Finals',
};
+const IMAGES_ARRAY = [
+ {
+ id: 'field_quadrants_image',
+ original_image:
+ '/sha256/cbb99a057a2504e80af526dae7a0a04121aed84c56a6f4889e9576fe1c20c61e/pictures/field/quadrants.jpeg',
+ reversed_image:
+ '/sha256/2c67fffbb722e9a7d0e1d270f1aad7f39a2dc8493c2e7ad1ae50bd6fa52d5bb7/pictures/field/reversed_quadrants.jpeg',
+ },
+ {
+ id: 'field_balls_image',
+ original_image:
+ '/sha256/e095cc8a75d804b0e2070e0a941fab37154176756d4c1a775e53cc48c3a732b9/pictures/field/balls.jpeg',
+ reversed_image:
+ '/sha256/fe4a4605c03598611c583d4dcdf28e06a056a17302ae91f5c527568966d95f3a/pictures/field/reversed_balls.jpeg',
+ },
+];
+
@Component({
selector: 'app-entry',
templateUrl: './entry.ng.html',
@@ -122,6 +139,14 @@
this.scrollToTop();
}
+ flipImages() {
+ for (let obj of IMAGES_ARRAY) {
+ let img = document.getElementById(obj.id) as HTMLImageElement;
+ img.src = img.src.endsWith(obj.original_image)
+ ? obj.reversed_image
+ : obj.original_image;
+ }
+ }
private scrollToTop() {
this.header.nativeElement.scrollIntoView();
}