mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #5593 from Ocelot-Social-Community/5580-make-donation-bar-configurable
feat: 🍰 Make Donation Progress Bar Color Configurable
This commit is contained in:
commit
18e9d5488a
@ -2,7 +2,10 @@
|
|||||||
<div class="progress-bar-component">
|
<div class="progress-bar-component">
|
||||||
<div class="progress-bar">
|
<div class="progress-bar">
|
||||||
<div class="progress-bar__goal"></div>
|
<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%">
|
<div class="progress-bar__border" style="width: 100%">
|
||||||
<span v-if="label" class="progress-bar__label">{{ label }}</span>
|
<span v-if="label" class="progress-bar__label">{{ label }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -14,6 +17,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { PROGRESS_BAR_COLOR_TYPE } from '~/constants/donation.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
goal: {
|
goal: {
|
||||||
@ -32,6 +37,11 @@ export default {
|
|||||||
progressBarWidth() {
|
progressBarWidth() {
|
||||||
return `width: ${(this.progress / this.goal) * 100}%;`
|
return `width: ${(this.progress / this.goal) * 100}%;`
|
||||||
},
|
},
|
||||||
|
progressBarColorClass() {
|
||||||
|
return PROGRESS_BAR_COLOR_TYPE === 'gradient'
|
||||||
|
? 'color-repeating-linear-gradient'
|
||||||
|
: 'color-uni'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -66,6 +76,13 @@ export default {
|
|||||||
left: 0px;
|
left: 0px;
|
||||||
height: 26px; // styleguide-button-size
|
height: 26px; // styleguide-button-size
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
border-radius: $border-radius-base;
|
||||||
|
|
||||||
|
&.color-uni {
|
||||||
|
background: $color-primary-light;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.color-repeating-linear-gradient {
|
||||||
background: repeating-linear-gradient(
|
background: repeating-linear-gradient(
|
||||||
120deg,
|
120deg,
|
||||||
$color-primary 0px,
|
$color-primary 0px,
|
||||||
@ -74,7 +91,7 @@ export default {
|
|||||||
$color-primary-light 75px,
|
$color-primary-light 75px,
|
||||||
$color-primary 95px
|
$color-primary 95px
|
||||||
);
|
);
|
||||||
border-radius: $border-radius-base;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-bar__border {
|
.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