Skip to content

Commit

Permalink
Robot: fixed workpiece location
Browse files Browse the repository at this point in the history
  • Loading branch information
techtasie committed Oct 29, 2024
1 parent 9959d7e commit 0997ac5
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/components/spectator/entities/RobotEntity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
<div class="robot">
<PopupWrapper>
<template #reference>
<img
:src="`/robots/robot-${robot.team_color}.svg`"
class="clickable"
draggable="false"
/>
<font-awesome-icon icon="fa-info-circle" class="info" />
<WorkpieceEntity
v-if="holdingWorkpiece"
:workpiece="holdingWorkpiece"
class="workpiece"
/>
<div class="robot-container">
<img
:src="`/robots/robot-${robot.team_color}.svg`"
class="clickable"
draggable="false"
/>
<font-awesome-icon icon="fa-info-circle" class="info" />
<WorkpieceEntity
v-if="holdingWorkpiece"
:workpiece="holdingWorkpiece"
class="workpiece"
/>
</div>
</template>
<RobotPopup
:robot="robot"
Expand Down Expand Up @@ -113,10 +115,16 @@ watch(
);
.robot {
.robot-container {
position: absolute;
width: 100%;
height: 100%;
transform: rotate(calc((v-bind('robot.pose[2]') + 90) * 1deg));
}
img {
height: 100%;
width: 100%;
transform: rotate(calc((v-bind('robot.pose[2]') + 90) * 1deg));
}
.info {
Expand All @@ -131,9 +139,9 @@ watch(
.workpiece {
position: absolute;
top: 120%;
left: 50%;
--add-transform: rotate(calc((v-bind('robot.pose[2]')) * -1deg));
top: 0;
right: 0;
--add-transform: translateX(100%) translateY(100%) rotate(calc((v-bind('robot.pose[2]')) * -1deg - 90deg));
}
}
}
Expand Down

0 comments on commit 0997ac5

Please sign in to comment.