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
4852aff8
Commit
4852aff8
authored
11 months ago
by
Ina Martini
Browse files
Options
Downloads
Patches
Plain Diff
refactor: add HelpComponent
parent
7c997450
No related branches found
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/views/HomeView.vue
+6
-37
6 additions, 37 deletions
src/views/HomeView.vue
with
6 additions
and
37 deletions
src/views/HomeView.vue
+
6
−
37
View file @
4852aff8
<
template
>
<div
class=
"flex flex-col items-center max-h-[60vh] md:flex-row md:max-h-[80vh] mx-auto"
>
<div
class=
"flex flex-col basis-1/3 order-last md:order-first md:basis-1/4 md:pl-1 mt-10"
>
<img
v-if=
"newSpeechAvailable"
alt=
"Varsel"
class=
"jump scale-x-[-1] w-1/12 h-1/12 ml-52 cursor-pointer z-10"
src=
"@/assets/varsel.png"
/>
<div
class=
"flex items-center"
>
<a
@
click=
"openInteractiveSpare"
class=
"hover:bg-transparent z-20"
>
<img
alt=
"Spare"
class=
"scale-x-[-1] 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>
<SpareComponent></SpareComponent>
<div
class=
"flex flex-row gap-2 items-center mx-auto my-4 md:flex-col md:gap-4 md:m-8"
>
<ButtonAddGoalOrChallenge
:buttonText=
"'Legg til sparemål'"
:type=
"'goal'"
/>
<ButtonAddGoalOrChallenge
...
...
@@ -26,23 +12,14 @@
</div>
<savings-path
:challenges=
"challenges"
:goal=
"goal"
></savings-path>
</div>
<
InteractiveSpare
<
HelpComponent
:speech=
"speech"
:direction=
"'right'"
:pngSize=
"15"
:isModalOpen=
"isModalOpen"
class=
"opacity-0 h-0 w-0 md:opacity-100 md:h-auto md:w-auto"
></InteractiveSpare>
<div
class=
"fixed bottom-5 left-5"
>
<div
@
click=
"openHelp"
class=
"hover:cursor-pointer"
>
<img
alt=
"Hjelp"
class=
"w-1/12"
src=
"@/assets/hjelp.png"
/>
</div>
</div>
@
openHelp=
"openHelp"
></HelpComponent>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
onMounted
,
ref
}
from
'
vue
'
import
InteractiveSpare
from
'
@/components/InteractiveSpare.vue
'
import
ButtonAddGoalOrChallenge
from
'
@/components/ButtonAddGoalOrChallenge.vue
'
import
type
{
Challenge
}
from
'
@/types/challenge
'
import
type
{
Goal
}
from
'
@/types/goal
'
...
...
@@ -50,12 +27,13 @@ import { useGoalStore } from '@/stores/goalStore'
import
{
useChallengeStore
}
from
'
@/stores/challengeStore
'
import
SavingsPath
from
'
@/components/SavingsPath.vue
'
import
router
from
'
@/router
'
import
SpareComponent
from
"
@/components/SpareComponent.vue
"
;
import
HelpComponent
from
"
@/components/HelpComponent.vue
"
;
const
goalStore
=
useGoalStore
()
const
challengeStore
=
useChallengeStore
()
const
isModalOpen
=
ref
(
false
)
const
speech
=
ref
<
string
[]
>
([])
const
newSpeechAvailable
=
ref
(
false
)
const
challenges
=
ref
<
Challenge
[]
>
([])
const
goals
=
ref
<
Goal
[]
>
([])
...
...
@@ -84,14 +62,6 @@ const firstLoggedInSpeech = () => {
router
.
replace
({
name
:
'
home
'
,
query
:
{
firstLogin
:
'
false
'
}
})
}
}
const
openInteractiveSpare
=
()
=>
{
// Check if there's new speech available before opening the modal.
if
(
newSpeechAvailable
.
value
)
{
isModalOpen
.
value
=
true
// Open the modal
newSpeechAvailable
.
value
=
false
// Reset the flag since the speech will now be displayed
}
}
const
openHelp
=
()
=>
{
speech
.
value
=
[
'
Heisann, jeg er Spare!
'
,
...
...
@@ -99,7 +69,6 @@ const openHelp = () => {
'
Du kan legge til sparemål og spareutfordringer!
'
,
'
Sammen kan vi spare penger og nå dine mål!
'
]
isModalOpen
.
value
=
true
}
</
script
>
...
...
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