Skip to content

Commit d1b1c2b

Browse files
authored
Merge branch 'develop' into ari/detect-domain-changes
2 parents c9d203a + 1f440c2 commit d1b1c2b

22 files changed

Lines changed: 143 additions & 158 deletions

assets/css/admin.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ button.prpl-info-icon {
306306
.prpl-wrap button.prpl-button-secondary,
307307
.prpl-wrap a.prpl-button-primary,
308308
.prpl-wrap a.prpl-button-secondary,
309-
#progress_planner_dashboard_widget_score a.prpl-button-primary { /* To be used in WP Dashboard widget */
309+
#progress_planner_dashboard_widget_score a.prpl-button-primary,
310+
#progress_planner_dashboard_widget_score a.prpl-button-secondary { /* To be used in WP Dashboard widget */
310311
display: block;
311312
margin: 1rem 0;
312313
padding: 0.75rem 1.25rem;
@@ -360,13 +361,23 @@ button.prpl-info-icon {
360361
}
361362

362363
.prpl-wrap input.prpl-button-secondary,
363-
.prpl-wrap button.prpl-button-secondary {
364+
.prpl-wrap button.prpl-button-secondary,
365+
.prpl-wrap a.prpl-button-secondary,
366+
#progress_planner_dashboard_widget_score a.prpl-button-secondary {
364367
background: var(--prpl-color-selection-controls-inactive);
365368

369+
&::after {
370+
background: var(--prpl-color-selection-controls-inactive);
371+
}
372+
366373
&:not([disabled]):hover,
367374
&:not([disabled]):focus {
368375
background: var(--prpl-color-ui-icon);
369376
box-shadow: 3px 3px 10px var(--prpl-color-ui-icon);
377+
378+
&::after {
379+
background: var(--prpl-color-ui-icon);
380+
}
370381
}
371382
}
372383

assets/css/page-widgets/latest-badge.css

Lines changed: 0 additions & 31 deletions
This file was deleted.

assets/css/page-widgets/suggested-tasks.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
&.prpl-column-content {
155155
padding: 20px;
156156
border-radius: var(--prpl-border-radius-big);
157-
background-color: var(--background-content);
157+
background-color: var(--prpl-background-content);
158158
}
159159

160160
.prpl-note {

assets/css/variables-color.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
/* Topics */
4646
--prpl-color-monthly: #faa310;
47+
--prpl-color-monthly-2: #faa310;
4748
--prpl-color-streak: var(--prpl-color-monthly);
4849
--prpl-color-content-badge: var(--prpl-color-monthly);
4950
--prpl-background-monthly: #fff9f0;
@@ -93,4 +94,7 @@
9394
--prpl-color-text-placeholder: var(--prpl-color-ui-icon);
9495
--prpl-color-text-dropdown: var(--prpl-color-text);
9596
--prpl-color-field-shadow: var(--prpl-color-shadow-paper);
97+
98+
/* Badge */
99+
--prpl-color-icon-missed-badge: var(--prpl-color-alert-error);
96100
}

assets/css/web-components/prpl-badge.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ prpl-badge {
7676
justify-content: center;
7777
width: 20px;
7878
height: 20px;
79-
background-color: var(--prpl-color-alert-error);
79+
background-color: var(--prpl-color-icon-missed-badge);
8080
border: 2px solid #fff;
8181
border-radius: 50%;
8282
position: absolute;

assets/js/web-components/prpl-big-counter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ customElements.define(
1313
content = content || this.getAttribute( 'content' );
1414
backgroundColor =
1515
backgroundColor || this.getAttribute( 'background-color' );
16-
backgroundColor = backgroundColor || 'var(--background-content)';
16+
backgroundColor =
17+
backgroundColor || 'var(--prpl-background-content)';
1718

1819
const el = this;
1920

assets/js/web-components/prpl-gauge.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ customElements.define(
2020
maxDeg: '180deg',
2121
background: 'var(--prpl-background-monthly)',
2222
color: 'var(--prpl-color-monthly)',
23+
color2: 'var(--prpl-color-monthly-2)',
2324
start: '270deg',
2425
cutout: '57%',
2526
contentFontSize: 'var(--prpl-font-size-6xl)',
@@ -64,10 +65,25 @@ customElements.define(
6465
props.brandingId =
6566
this.getAttribute( 'branding-id' ) || props.brandingId;
6667

68+
let colorTransitions;
69+
70+
// If the progress is less than 50%, we have only one color, no gradient.
71+
if ( props.value <= 0.5 ) {
72+
colorTransitions = `${ props.color } calc(${ props.maxDeg } * ${ props.value })`;
73+
} else {
74+
// Otherwise we show first color for 0.5 and then the second color.
75+
colorTransitions = `${ props.color } calc(${
76+
props.maxDeg
77+
} * ${ 0.5 })`;
78+
colorTransitions += `, ${ props.color2 } calc(${ props.maxDeg } * ${ props.value })`;
79+
}
80+
// Add the remaining color.
81+
colorTransitions += `, var(--prpl-color-gauge-remain) calc(${ props.maxDeg } * ${ props.value }) ${ props.maxDeg }`;
82+
6783
this.innerHTML = `
6884
<div style="padding: ${ props.contentPadding };
6985
background: ${ props.background }; border-radius:var(--prpl-border-radius-big); aspect-ratio: 2 / 1; overflow: hidden; position: relative; margin-bottom: ${ props.marginBottom };">
70-
<div style="width: 100%; aspect-ratio: 1 / 1; border-radius: 100%; position: relative; background: radial-gradient(${ props.background } 0 ${ props.cutout }, transparent ${ props.cutout } 100%), conic-gradient(from ${ props.start }, ${ props.color } calc(${ props.maxDeg } * ${ props.value }), var(--prpl-color-gauge-remain) calc(${ props.maxDeg } * ${ props.value }) ${ props.maxDeg }, transparent ${ props.maxDeg }); text-align: center;">
86+
<div style="width: 100%; aspect-ratio: 1 / 1; border-radius: 100%; position: relative; background: radial-gradient(${ props.background } 0 ${ props.cutout }, transparent ${ props.cutout } 100%), conic-gradient(from ${ props.start }, ${ colorTransitions }, transparent ${ props.maxDeg }); text-align: center;">
7187
<span style="font-size: var(--prpl-font-size-small); position: absolute; top: 50%; color: var(--prpl-color-text); width: 10%; text-align: center; left:0;">0</span>
7288
<span style="font-size: ${ props.contentFontSize }; ${ contentSpecificStyles } display: block; font-weight: 600; text-align: center; position: absolute; color: var(--prpl-color-text); width: 100%; line-height: 1.2;">
7389
<span style="display:inline-block;width: 50%;">

classes/admin/class-enqueue.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ private function get_badge_urls() {
312312
$monthly_badge = \progress_planner()->get_badges()->get_badge( Monthly::get_badge_id_from_date( new \DateTime() ) );
313313

314314
if ( $monthly_badge ) {
315-
$badge_urls['month'] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $monthly_badge->get_id();
315+
$badge_urls['month'] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $monthly_badge->get_id() . '&branding_id=' . (int) \progress_planner()->get_ui__branding()->get_branding_id();
316316
}
317317

318318
// Get the content and maintenance badge URLs.
@@ -321,12 +321,12 @@ private function get_badge_urls() {
321321
foreach ( $set_badges as $badge ) {
322322
$progress = $badge->get_progress();
323323
if ( $progress['progress'] > 100 ) {
324-
$badge_urls[ $context ] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $badge->get_id();
324+
$badge_urls[ $context ] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $badge->get_id() . '&branding_id=' . (int) \progress_planner()->get_ui__branding()->get_branding_id();
325325
}
326326
}
327327
if ( ! isset( $badge_urls[ $context ] ) ) {
328328
// Fallback to the first badge in the set if no badge is completed.
329-
$badge_urls[ $context ] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $set_badges[0]->get_id();
329+
$badge_urls[ $context ] = \progress_planner()->get_remote_server_root_url() . '/wp-json/progress-planner-saas/v1/badge-svg/?badge_id=' . $set_badges[0]->get_id() . '&branding_id=' . (int) \progress_planner()->get_ui__branding()->get_branding_id();
330330
}
331331
}
332332

classes/admin/class-page.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public function get_widgets() {
5858
\progress_planner()->get_admin__widgets__badge_streak_maintenance(),
5959
\progress_planner()->get_admin__widgets__challenge(),
6060
\progress_planner()->get_admin__widgets__activity_scores(),
61-
\progress_planner()->get_admin__widgets__latest_badge(),
6261
\progress_planner()->get_admin__widgets__content_activity(),
6362
\progress_planner()->get_admin__widgets__whats_new(),
6463
];

classes/admin/widgets/class-latest-badge.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)