Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
07ba850f
Commit
07ba850f
authored
11 months ago
by
Ina Martini
Browse files
Options
Downloads
Patches
Plain Diff
refactor: add spareComponent
parent
b15874ae
No related branches found
Branches containing commit
No related tags found
3 merge requests
!66
Final merge
,
!49
Create spare component
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SpareComponent.vue
+73
-0
73 additions, 0 deletions
src/components/SpareComponent.vue
with
73 additions
and
0 deletions
src/components/SpareComponent.vue
0 → 100644
+
73
−
0
View file @
07ba850f
<
template
>
<div>
<!-- This image shows only if new speech is available -->
<img
v-if=
"notification"
alt=
"Varsel"
class=
"jump scale-x-[-1] w-1/12 h-1/12 ml-52 cursor-pointer z-10"
src=
"@/assets/varsel.png"
/>
<!-- This is the clickable image that will trigger the modal to open -->
<div
class=
"flex items-center"
:class=
"
{
'flex-row': imageDirection === 'right',
'flex-row-reverse': imageDirection === 'left'
}">
<a
@
click=
"handleSpareClick"
class=
"hover:bg-transparent z-20"
>
<img
alt=
"Spare"
class=
"md:h-5/6 md:w-5/6 w-2/3 h-2/3 cursor-pointer ml-14 md:ml-10"
src=
"@/assets/spare.png"
/>
</a>
</div>
<!-- InteractiveSpare modal component -->
<InteractiveSpare
:isModalOpen=
"isModalOpen"
:speech=
"speech"
:png-size=
"pngSize"
:direction=
"direction"
:notification=
"notification"
></InteractiveSpare>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
InteractiveSpare
from
"
@/components/InteractiveSpare.vue
"
import
{
defineProps
,
ref
}
from
"
vue
"
const
isModalOpen
=
ref
(
false
)
defineProps
([
'
speech
'
,
'
pngSize
'
,
'
direction
'
,
'
imageDirection
'
,
'
notification
'
])
const
emit
=
defineEmits
([
'
openSpare
'
]);
function
handleSpareClick
()
{
emit
(
'
openSpare
'
);
isModalOpen
.
value
=
true
;
}
</
script
>
<
style
>
@keyframes
jump
{
0
%,
100
%
{
transform
:
translateY
(
0
);
}
50
%
{
transform
:
translateY
(
-10px
);
}
}
.jump
{
animation
:
jump
0.6s
infinite
ease-in-out
;
}
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment