Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
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-2024-07
frontend
Commits
b050d1ed
Commit
b050d1ed
authored
1 year ago
by
Victor Ekholt Gunrell Kaste
Browse files
Options
Downloads
Patches
Plain Diff
feat: Adde greyscale to completed challenges
parent
802e349a
No related branches found
No related tags found
No related merge requests found
Pipeline
#275350
failed
1 year ago
Stage: install_dependencies
Stage: lint
Stage: build_project
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
+34
-15
34 additions, 15 deletions
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
with
34 additions
and
15 deletions
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
+
34
−
15
View file @
b050d1ed
...
@@ -4,6 +4,7 @@ interface Step {
...
@@ -4,6 +4,7 @@ interface Step {
showPanel
:
boolean
;
showPanel
:
boolean
;
description
:
string
;
description
:
string
;
percentFinished
:
number
;
percentFinished
:
number
;
unFinished
:
boolean
;
}
}
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -13,18 +14,28 @@ export default {
...
@@ -13,18 +14,28 @@ export default {
title
:
'
Spain trip
'
as
string
,
title
:
'
Spain trip
'
as
string
,
//This will be changed to info gathered from backend
//This will be changed to info gathered from backend
steps
:
[
steps
:
[
{
title
:
'
Challenge 1
'
,
showPanel
:
false
,
description
:
'
Save 50kr on coffee in 3 days
'
,
percentFinished
:
22
},
{
title
:
'
Challenge 1
'
,
showPanel
:
false
,
description
:
'
Save 50kr on coffee in 3 days
'
,
percentFinished
:
22
,
unFinished
:
false
},
{
title
:
'
Challenge 2
'
,
showPanel
:
false
,
description
:
'
Save 500kr on food in 7 days
'
,
percentFinished
:
73
},
{
title
:
'
Challenge 2
'
,
showPanel
:
false
,
description
:
'
Save 500kr on food in 7 days
'
,
percentFinished
:
73
,
unFinished
:
false
},
{
title
:
'
Challenge 3
'
,
showPanel
:
false
,
description
:
'
Save 350kr on clothes in 5 days
'
,
percentFinished
:
50
},
{
title
:
'
Challenge 3
'
,
showPanel
:
false
,
description
:
'
Save 350kr on clothes in 5 days
'
,
percentFinished
:
50
,
unFinished
:
true
},
{
title
:
'
Challenge 4
'
,
showPanel
:
false
,
description
:
'
Save 150kr on coffee in 4 days
'
,
percentFinished
:
10
},
{
title
:
'
Challenge 4
'
,
showPanel
:
false
,
description
:
'
Save 150kr on coffee in 4 days
'
,
percentFinished
:
10
,
unFinished
:
true
},
{
title
:
'
Challenge 5
'
,
showPanel
:
false
,
description
:
'
Save 50kr on coffee in 3 days
'
,
percentFinished
:
90
}
{
title
:
'
Challenge 5
'
,
showPanel
:
false
,
description
:
'
Save 50kr on coffee in 3 days
'
,
percentFinished
:
90
,
unFinished
:
true
}
]
]
,
,
bluePanelMaxHeight
:
'
auto
'
as
string
bluePanelMaxHeight
:
'
auto
'
as
string
};
};
},
},
mounted
()
{
mounted
()
{
this
.
togglePanel
(
this
.
steps
[
2
]);
setTimeout
(()
=>
{
this
.
togglePanel
(
this
.
steps
[
2
]);
},
500
);
},
computed
:
{
computeImageFilter
()
{
return
(
step
:
Step
)
=>
{
return
step
.
unFinished
?
'
none
'
:
'
grayscale(100%)
'
;
};
}
},
},
methods
:
{
methods
:
{
togglePanel
(
step
:
Step
)
{
togglePanel
(
step
:
Step
)
{
...
@@ -40,12 +51,8 @@ export default {
...
@@ -40,12 +51,8 @@ export default {
if
(
step
.
showPanel
)
{
if
(
step
.
showPanel
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
const
panel
=
document
.
getElementById
(
`panel-
${
this
.
steps
.
indexOf
(
step
)}
`
);
const
panel
=
document
.
getElementById
(
`panel-
${
this
.
steps
.
indexOf
(
step
)}
`
);
console
.
log
(
panel
);
if
(
panel
)
{
if
(
panel
)
{
setTimeout
(()
=>
{
panel
.
scrollIntoView
({
behavior
:
'
smooth
'
,
block
:
'
center
'
});
panel
.
scrollIntoView
({
behavior
:
'
smooth
'
,
block
:
'
center
'
});
console
.
log
(
'
I should have scrolled
'
);
},
100
);
// Wait for 1 second before scrolling
}
}
});
});
}
}
...
@@ -56,11 +63,24 @@ export default {
...
@@ -56,11 +63,24 @@ export default {
<
template
>
<
template
>
<div
class=
"col-lg-8"
>
<div
class=
"col-lg-8"
>
<div
class=
"SavingGoalTitle text-center"
>
{{
title
}}
</div>
<div
class=
"SavingGoalTitle text-center"
>
{{
title
}}
<br>
<p
class=
"d-inline-flex gap-1"
>
<button
class=
"btn btn-primary"
type=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#collapseExample"
aria-expanded=
"false"
aria-controls=
"collapseExample"
style=
"font-size: 25px;"
>
See more info
</button>
</p>
<div
class=
"collapse"
id=
"collapseExample"
>
<div
class=
"card card-body bg-primary mx-auto"
style=
"width: 80%;"
>
Total saved: 20kr
</div>
</div>
</div>
<ul
class=
"timeline"
>
<ul
class=
"timeline"
>
<li
v-for=
"(step, index) in steps"
:key=
"index"
:class=
"
{ 'timeline-inverted': index % 2 !== 0 }">
<li
v-for=
"(step, index) in steps"
:key=
"index"
:class=
"
{ 'timeline-inverted': index % 2 !== 0 }">
<div
class=
"timeline-image z-1"
@
click=
"togglePanel(step)"
>
<div
class=
"timeline-image z-1"
@
click=
"togglePanel(step)"
>
<img
class=
"circular-image"
:src=
"step.showPanel ? altImage : image"
alt=
""
>
<img
class=
"circular-image"
:src=
"step.showPanel ? altImage : image"
:style=
"
{ filter: computeImageFilter(step) }"
alt="">
</div>
</div>
<div
class=
"timeline-panel z-3"
:id=
"'panel-' + index"
v-show=
"step.showPanel"
>
<div
class=
"timeline-panel z-3"
:id=
"'panel-' + index"
v-show=
"step.showPanel"
>
<div
class=
"timeline-heading"
>
<div
class=
"timeline-heading"
>
...
@@ -95,9 +115,8 @@ export default {
...
@@ -95,9 +115,8 @@ export default {
<
style
scoped
>
<
style
scoped
>
.col-lg-8
{
.col-lg-8
{
width
:
63
%
;
width
:
58
%
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
max-height
:
1000px
;
}
}
.SavingGoalTitle
{
.SavingGoalTitle
{
...
...
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