Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Dec 10, 2024
2 parents 894755a + d3f2eeb commit c564ff9
Show file tree
Hide file tree
Showing 19 changed files with 310 additions and 199 deletions.
34 changes: 34 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,40 @@
display: flex;
justify-content: space-between;
}

.icon {
width: 1.25rem;
height: 1.25rem;
display: inline-block;

/* Fake hover effect for the info icon */
&.prpl-info-icon {
position: relative;

&:hover {
border-radius: 50%;
background-color: var(--prpl-color-gray-4);

&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid var(--prpl-color-gray-4);
border-radius: 50%;
box-sizing: border-box;
}

svg path {
fill: #fff;
}
}
}
}


}

.prpl-hidden {
Expand Down
174 changes: 89 additions & 85 deletions assets/css/page-widgets/suggested-tasks.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
.badge-group-monthly {
padding: calc(var(--prpl-padding) / 2);
border-radius: var(--prpl-border-radius);
margin-bottom: var(--prpl-padding);
background: var(--prpl-background-orange);
background-color: var(--prpl-background-orange);

.prpl-badge-row-wrapper {
overflow: hidden;
Expand Down Expand Up @@ -96,7 +95,7 @@
&:has(.prpl-suggested-tasks-list li) {

.prpl-widget-title {
display: block;
display: flex;
}
}

Expand All @@ -114,6 +113,13 @@
border-bottom: none;
}

prpl-suggested-task:nth-child(odd) {

.prpl-suggested-task {
background-color: #f9fafb;
}
}

.prpl-suggested-task {
margin: 0;
padding: 0.5rem 0.5rem;
Expand All @@ -122,10 +128,6 @@
align-items: center;
position: relative;

&:nth-child(odd) {
background-color: #f9fafb;
}

h3 {
font-size: 1rem;
margin: 0;
Expand Down Expand Up @@ -154,7 +156,7 @@

.prpl-suggested-task-points {
font-size: var(--prpl-font-size-xs);
font-weight: 600;
font-weight: 700;
color: var(--prpl-color-headings);
background-color: var(--prpl-color-accent-orange);
width: 1.5rem;
Expand Down Expand Up @@ -195,6 +197,12 @@
cursor: pointer;
}

.icon {
width: 1rem;
height: 1rem;
display: inline-block;
}

.prpl-suggested-task-snooze {
margin-left: 5px;

Expand Down Expand Up @@ -277,6 +285,14 @@

.prpl-suggested-task-info {
margin-left: -30px;

p {
margin-bottom: 0;
}

p:first-child {
margin-top: 0;
}
}

}
Expand All @@ -294,115 +310,103 @@
grid-auto-rows: auto;
}

.prpl-widget-wrapper {
display: flex;
flex-direction: column;
justify-content: space-between;

&.prpl-badge-streak {

.progress-label {
display: inline-block;
}

.progress-wrapper {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: calc(var(--prpl-gap) / 2);
padding: calc(var(--prpl-padding) / 2);
margin-bottom: var(--prpl-padding);

.prpl-badge {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
min-width: 0;
}

p {
margin: 0;
font-size: var(--prpl-font-size-xs);
text-align: center;
line-height: 1.2;
}

prpl-badge {
width: 100%;
transform: scale(var(--multiplier));
margin-bottom: 1rem;
}

}

.prpl-badge {

/* Change this number to adjust the rate of growth of the badges size. */
--multiplier-default: 1.05;
--multiplier: var(--multiplier-default);

+.prpl-badge {
--multiplier: calc(var(--multiplier-default) * var(--multiplier-default));

+.prpl-badge {
--multiplier: calc(var(--multiplier-default) * var(--multiplier-default) * var(--multiplier-default));
}
}
}

.prpl-widget-content {
margin-bottom: 1em;
}
}
}

.prpl-widget-title {
padding: 0.5rem 1rem;
border-radius: 0.5rem;
background: var(--prpl-background-orange);
}

.prpl-widget-wrapper-writing {
.badge-group-monthly {
background-color: transparent;
}

.prpl-widget-wrapper-content {

.prpl-widget-title {
background: var(--prpl-background-blue);
}

.badge-group-content {
background-color: transparent;
}
}

.prpl-widget-wrapper-maintenance {

.prpl-widget-title {
background: var(--prpl-background-red);
}
}

.badge-group-monthly {
background-color: transparent;
.badge-group-maintenance {
background-color: transparent;
}
}
}

.prpl-ravi-reward-container {
margin-bottom: var(--prpl-padding);
.prpl-widget-wrapper.prpl-badge-streak {
display: flex;
flex-direction: column;
justify-content: space-between;

.in-popover & {
margin-bottom: 0;

.progress-label {
display: inline-block;
}

img {
border: 1px solid var(--prpl-color-gray-2);
border-radius: var(--prpl-border-radius);
.progress-wrapper {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: calc(var(--prpl-gap) / 2);
padding: calc(var(--prpl-padding) / 2);
border-radius: var(--prpl-border-radius-big);

&:not(:first-child) {
margin-top: var(--prpl-padding);
}

&.badge-group-content {
background: var(--prpl-background-blue);
}

&.badge-group-maintenance {
background: var(--prpl-background-red);
}

.prpl-badge {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
min-width: 0;
}

&.incomplete {
filter: grayscale(1);
opacity: 0.25;
p {
margin: 0;
font-size: var(--prpl-font-size-xs);
text-align: center;
line-height: 1.2;
}

prpl-badge {
width: 100%;
margin-bottom: 1rem;
}
}

.prpl-widget-content {
margin-bottom: 1em;
}

.badge-group-monthly {
background-color: transparent;
}
}


#prpl-popover-monthly-badges-trigger {
font-size: var(--prpl-font-size-base);
color: var(--prpl-color-link);
text-decoration: underline;
margin-top: var(--prpl-padding);
}
4 changes: 4 additions & 0 deletions assets/css/page-widgets/todo.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ prpl-todo-item {
border-bottom: 1.5px solid transparent;
}

input[type="checkbox"]:checked + .content {
text-decoration: line-through;
}

.trash,
.move-up,
.move-down {
Expand Down
1 change: 1 addition & 0 deletions assets/images/icon_info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/icon_snooze.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/js/grid-masonry.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ prplDocumentReady( () => {

window.addEventListener( 'resize', prplResizeAllGridItems );

// Fire event after all images are loaded.
window.addEventListener( 'load', prplResizeAllGridItems );

const prplResizeAllGridItemsEvent = new Event( 'prplResizeAllGridItemsEvent' ); // eslint-disable-line no-unused-vars

// Listen for the event.
Expand Down
4 changes: 2 additions & 2 deletions assets/js/web-components/prpl-suggested-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ customElements.define(
data-target="info"
title="${ progressPlannerSuggestedTask.i18n.info }"
>
<span class="dashicons dashicons-info"></span>
<img src="${ progressPlannerSuggestedTask.assets.infoIcon }" alt="${ progressPlannerSuggestedTask.i18n.info }" class="icon">
<span class="screen-reader-text">${ progressPlannerSuggestedTask.i18n.info }</span>
</button>`,
snooze: `<button
Expand All @@ -48,7 +48,7 @@ customElements.define(
data-target="snooze"
title="${ progressPlannerSuggestedTask.i18n.snooze }"
>
<span class="dashicons dashicons-clock"></span>
<img src="${ progressPlannerSuggestedTask.assets.snoozeIcon }" alt="${ progressPlannerSuggestedTask.i18n.snooze }" class="icon">
<span class="screen-reader-text">${ progressPlannerSuggestedTask.i18n.snooze }</span>
</button>`,
complete: isRemoteTask
Expand Down
8 changes: 6 additions & 2 deletions classes/admin/class-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ public function localize_script( $handle ) {
$handle,
'progressPlannerSuggestedTask',
[
'nonce' => \wp_create_nonce( 'progress_planner' ),
'i18n' => [
'nonce' => \wp_create_nonce( 'progress_planner' ),
'assets' => [
'infoIcon' => PROGRESS_PLANNER_URL . '/assets/images/icon_info.svg',
'snoozeIcon' => PROGRESS_PLANNER_URL . '/assets/images/icon_snooze.svg',
],
'i18n' => [
'info' => \esc_html__( 'Info', 'progress-planner' ),
'snooze' => \esc_html__( 'Snooze', 'progress-planner' ),
'snoozeThisTask' => \esc_html__( 'Snooze this task?', 'progress-planner' ),
Expand Down
Loading

0 comments on commit c564ff9

Please sign in to comment.