mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Make donation progress bar color configurable
This commit is contained in:
parent
d4b921a25c
commit
b43d49bfa9
@ -2,7 +2,10 @@
|
||||
<div class="progress-bar-component">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar__goal"></div>
|
||||
<div class="progress-bar__progress" :style="progressBarWidth"></div>
|
||||
<div
|
||||
:class="['progress-bar__progress', progressBarColorClass]"
|
||||
:style="progressBarWidth"
|
||||
></div>
|
||||
<div class="progress-bar__border" style="width: 100%">
|
||||
<span v-if="label" class="progress-bar__label">{{ label }}</span>
|
||||
</div>
|
||||
@ -14,6 +17,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { PROGRESS_BAR_COLOR_TYPE } from '~/constants/donation.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
goal: {
|
||||
@ -32,6 +37,11 @@ export default {
|
||||
progressBarWidth() {
|
||||
return `width: ${(this.progress / this.goal) * 100}%;`
|
||||
},
|
||||
progressBarColorClass() {
|
||||
return PROGRESS_BAR_COLOR_TYPE === 'gradient'
|
||||
? 'color-repeating-linear-gradient'
|
||||
: 'color-uni'
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -66,15 +76,22 @@ export default {
|
||||
left: 0px;
|
||||
height: 26px; // styleguide-button-size
|
||||
max-width: 100%;
|
||||
background: repeating-linear-gradient(
|
||||
120deg,
|
||||
$color-primary 0px,
|
||||
$color-primary 30px,
|
||||
$color-primary-light 50px,
|
||||
$color-primary-light 75px,
|
||||
$color-primary 95px
|
||||
);
|
||||
border-radius: $border-radius-base;
|
||||
|
||||
&.color-uni {
|
||||
background: $color-primary-light;
|
||||
}
|
||||
|
||||
&.color-repeating-linear-gradient {
|
||||
background: repeating-linear-gradient(
|
||||
120deg,
|
||||
$color-primary 0px,
|
||||
$color-primary 30px,
|
||||
$color-primary-light 50px,
|
||||
$color-primary-light 75px,
|
||||
$color-primary 95px
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar__border {
|
||||
|
||||
1
webapp/constants/donation.js
Normal file
1
webapp/constants/donation.js
Normal file
@ -0,0 +1 @@
|
||||
export const PROGRESS_BAR_COLOR_TYPE = 'gradient' // 'uni' is the other option
|
||||
Loading…
x
Reference in New Issue
Block a user