Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Creator: Hover Animations #5780

Merged
merged 53 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
0ecab75
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 12, 2024
d6104bc
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 12, 2024
0b62b2d
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 12, 2024
db6a39c
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 12, 2024
d5edb27
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 12, 2024
9a9b8fe
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 13, 2024
61cb3ea
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 14, 2024
916e0b8
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 14, 2024
945021c
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 14, 2024
c4af4a8
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 15, 2024
31f9cf8
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 15, 2024
c222f69
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 15, 2024
ea916a9
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 16, 2024
8b028a2
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 19, 2024
bfbe251
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 19, 2024
f033243
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 20, 2024
5af93d6
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 20, 2024
e497a2b
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 20, 2024
3520654
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 22, 2024
d470217
revert merge
dmitry-kurmanov Aug 22, 2024
044b3dd
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 22, 2024
c7afa0e
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 22, 2024
aacfbb2
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 23, 2024
c98ee79
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 23, 2024
e32c3c6
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 26, 2024
390aa90
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 26, 2024
5b23e5d
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 26, 2024
57f46e5
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 26, 2024
4787082
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 26, 2024
ef6a1e4
fixed very bad merge
dmitry-kurmanov Aug 27, 2024
01762bf
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 27, 2024
d7be1a9
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 27, 2024
3e0382e
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 27, 2024
35ed19d
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 28, 2024
f68ab5d
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 28, 2024
f2ab586
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Aug 29, 2024
7eae5aa
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 29, 2024
2567e1b
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 30, 2024
59d120f
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 30, 2024
863094b
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Aug 30, 2024
f5c1b8f
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Sep 2, 2024
421b086
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 2, 2024
3acea86
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 2, 2024
87dde73
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Sep 3, 2024
b5ab8c9
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 3, 2024
681ae32
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Sep 3, 2024
60f7b42
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 3, 2024
caade99
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 3, 2024
8807d7b
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 3, 2024
ed79a87
work for the https://github.com/surveyjs/survey-creator/issues/5764
dmitry-kurmanov Sep 3, 2024
e871e20
Merge branch 'master' into animations/5764-hover
dmitry-kurmanov Sep 3, 2024
6832440
Merge branch 'master' into animations/5764-hover
dk981234 Sep 5, 2024
40bd22f
Use class for disabling animations
dk981234 Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/survey-creator-angular/src/panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

<div [class]="adorner.css()" [key2click]="{ disableTabStop: true }"
(click)="adorner.element.isInteractiveDesignElement ? adorner.select(adorner, $event) : null">
<div class="svc-question__drop-indicator svc-question__drop-indicator--left"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--right"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--top"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--bottom"></div>
<div *ngIf="adorner.allowDragging && adorner.element.isInteractiveDesignElement" class="svc-question__drag-area"
(pointerdown)="adorner.onPointerDown($event)">
<svg class="svc-question__drag-element" [iconName]="'icon-drag-area-indicator_24x16'" [size]="24"
Expand Down
4 changes: 4 additions & 0 deletions packages/survey-creator-angular/src/question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
[attr.data-sv-drop-target-survey-element]="adorner.element.name || null" #container>

<div [class]="adorner.css()" [key2click]="{ disableTabStop: true }" (click)="adorner.select(adorner, $event)">
<div class="svc-question__drop-indicator svc-question__drop-indicator--left"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--right"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--top"></div>
<div class="svc-question__drop-indicator svc-question__drop-indicator--bottom"></div>
<div *ngIf="adorner.allowDragging" class="svc-question__drag-area" (pointerdown)="adorner.onPointerDown($event)">
<svg class="svc-question__drag-element" [iconName]="'icon-drag-area-indicator_24x16'" [size]="24"
sv-ng-svg-icon></svg>
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-creator-angular/src/row.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<ng-template #template>
<div [class]="model.cssClasses">
<div class="svc-row__drop-indicator svc-row__drop-indicator--top"></div>
<div class="svc-row__drop-indicator svc-row__drop-indicator--bottom"></div>
<sv-ng-row [row]="row"></sv-ng-row>
</div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<ng-template #template>
<span [class]="className">
<span class="svc-string-editor__content">
<div class="svc-string-editor__border">
<svg [iconName]="'icon-arrow-up'" class="svc-string-editor__button svc-string-editor__button--edit" [size]="24" sv-ng-svg-icon
(click)="edit($event)" [iconName]="'icon-edit'" [size]="16"></svg>
</div>
<div class="svc-string-editor__border svc-string-editor__border--hover"></div>
<div class="svc-string-editor__border svc-string-editor__border--focus"></div>
<span class="svc-string-editor__input">
<span role="textbox" *ngIf="!locString.hasHtml" class="sv-string-editor" spellcheck="false"
(focus)="onFocus($event)" (paste)="onPaste($event)" (blur)="onBlur($event)" (input)="baseModel.onInput($event)" (keydown)="baseModel.onKeyDown($event)" (keyup)="baseModel.onKeyUp($event)" (compositionstart)="baseModel.onCompositionStart($event)" (compositionend)="baseModel.onCompositionEnd($event)" (mouseup)="baseModel.onMouseUp($event)" (click)="edit($event)" [textContent]="locString.renderedHtml" [attr.aria-placeholder]="placeholder" [attr.contenteditable]="contentEditable" #container></span>
Expand Down
4 changes: 4 additions & 0 deletions packages/survey-creator-core/src/components/creator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,8 @@ survey-creator {
.sv-drag-drop-ghost--item-value-bottom {
top: initial;
bottom: calcSize(-0.5);
}

.svc-creator--disable-animations {
--sjs-creator-transition-duration: 0ms;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
align-items: center;
margin-right: calcSize(-2);
border-radius: calcSize(4);
transition: background-color $creator-transition-duration, opacity $creator-transition-duration;

&:hover {
background-color: var(--ctr-survey-header-logo-placeholder-background-color-hovered, $primary-light);
Expand All @@ -64,6 +65,7 @@
}

.svc-logo-image-placeholder use {
transition: fill $creator-transition-duration;
fill: var(--ctr-survey-header-logo-placeholder-icon-color, $foreground-light);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@

.svc-image-item-value--new .svc-image-item-value-controls__button {
background-color: transparent;
transition: background-color $creator-transition-duration;
}

.svc-image-item-value-controls__add {
background-color: transparent;
transition: background-color $creator-transition-duration;

use {
fill: $primary;
transition: fill $creator-transition-duration;
}

&:hover,
Expand Down
10 changes: 6 additions & 4 deletions packages/survey-creator-core/src/components/item-value.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
outline: none;
height: calcSize(2);
box-sizing: content-box;
transition: background $creator-transition-duration, background-color $creator-transition-duration;

.sv-svg-icon {
display: block;
Expand All @@ -75,12 +76,13 @@

.svc-item-value-controls__drag-icon {
display: block;
transition: opacity $creator-transition-duration;
}

.svc-item-value-wrapper:hover:not(.svc-item-value--ghost),
.svc-item-value-controls__drag:hover:not(.svc-item-value--ghost) {
.svc-item-value-controls__drag-icon {
visibility: visible;
opacity: 1;
}
}

Expand All @@ -90,7 +92,7 @@
opacity: 0.25;

.svc-item-value-controls__drag-icon {
visibility: hidden;
opacity: 0;
}

use {
Expand Down Expand Up @@ -266,7 +268,7 @@
}

.svc-item-value-controls__drag-icon {
visibility: visible;
opacity: 1;
}

.svc-item-value-wrapper {
Expand All @@ -280,7 +282,7 @@
.sd-selectbase,
.svc-question__dropdown-choices {
.svc-item-value-controls__drag-icon {
visibility: visible;
opacity: 1;
}

.svc-item-value-wrapper {
Expand Down
11 changes: 7 additions & 4 deletions packages/survey-creator-core/src/components/matrix-cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

.svc-question__adorner {
.sd-table .sd-table__cell--column-title {
padding: 0 calcSize(1);
padding: 0 calcSize(1);

.svc-matrix-cell {
padding: calcSize(1.5) calcSize(1);
}
Expand All @@ -30,23 +31,25 @@
right: calcSize(0);
bottom: calcSize(0);
display: none;

&.svc-visible {
display: block;
}
}

.svc-hovered > .svc-matrix-cell--selected:not(.svc-visible) {
.svc-hovered>.svc-matrix-cell--selected:not(.svc-visible) {
border: calcSize(0.25) solid $secondary-light;
border-radius: calcSize(0.5);
display: block;
}

.svc-matrix-cell__question-controls {
display: none;
opacity: 0;
position: absolute;
top: calc(50% - 3 * #{$base-unit});
left: calc(50% - 3 * #{$base-unit});
z-index: 2;
transition: opacity $creator-transition-duration;
}

.svc-matrix-cell__question-controls-button {
Expand All @@ -66,7 +69,7 @@
}

.svc-matrix-cell:hover .svc-matrix-cell__question-controls {
display: block;
opacity: 1;
}

.svc-question__content--in-popup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ svc-page-navigator-item,
background-color: var(--ctr-page-navigator-item-background-color-hovered, $background);
border-radius: calcSize(12.5);
box-shadow: $shadow-medium;
transition:
max-width 0.1s ease-in-out,
padding 0.2s ease-in-out;
transition: opacity $creator-transition-duration;

.svc-page-navigator-item__dot {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ svc-page-navigator,
padding: calcSize(1.25);
border-radius: 50%;
cursor: pointer;
transition: background-color $creator-transition-duration;

use {
fill: var(--ctr-page-navigator-button-icon-color, $foreground-light);
transition: fill $creator-transition-duration;
}
}

Expand Down
40 changes: 32 additions & 8 deletions packages/survey-creator-core/src/components/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ svc-page {
box-sizing: border-box;
width: 100%;
outline: none;
transition: background $creator-transition-duration, box-shadow $creator-transition-duration;

.sd-page {
margin: 0;
Expand All @@ -33,15 +34,17 @@ svc-page {

.svc-page__content-actions {
position: absolute;
visibility: hidden;
opacity: 0;
top: calcSize(1);
inset-inline-end: 0; // right
padding: 0 calcSize(1.5) 0 calcSize(1);
z-index: 1;
transition: opacity $creator-transition-duration;

.sv-action-bar-separator {
margin: 0 calcSize(1);
}

h4.sd-title {
.sv-string-editor {
&[aria-placeholder]:empty:before {
Expand All @@ -56,6 +59,7 @@ svc-page {
border-radius: var(--ctr-survey-page-toolbar-item-corner-radius, 4px);
background-color: transparent;
color: var(--ctr-survey-page-toolbar-item-text-color, $foreground);
transition: background-color $creator-transition-duration;
}

.sv-action-bar-item__icon {
Expand Down Expand Up @@ -131,12 +135,14 @@ svc-page {
&::after {
display: none;
}

&.svc-page__content--selected {
box-shadow: 0 0 0 2px $secondary;
background: $secondary-backcolor-semi-light;
}

.svc-page__content-actions {
visibility: visible;
opacity: 1;
}
}

Expand All @@ -154,10 +160,12 @@ svc-page {
box-sizing: content-box;
pointer-events: none;
}

&.svc-page__content--collapsed-drag-over-inside {
box-shadow: 0 0 0 2px $primary;
background: $primary-light;
animation: collapsed-drag-over-inside-blinking 1s infinite;

&::after {
border: 2px $primary solid;
background: $primary-light;
Expand All @@ -178,6 +186,8 @@ svc-page {
&.svc-creator .svc-page .svc-page__content--selected:focus,
.svc-hovered.svc-page__content {
&.svc-page__content--selected {
box-shadow: 0 0 0 2px inset $secondary;

box-shadow: 0 0 0 2px inset var(--ctr-survey-page-border-color-selected, $secondary);
background: var(--ctr-survey-page-background-color-selected, $secondary-backcolor-semi-light);

Expand All @@ -186,6 +196,7 @@ svc-page {
}
}
}

.svc-page__content:not(.svc-page__content--new):focus,
.svc-hovered.svc-page__content:not(.svc-page__content--new) {
box-shadow: 0 0 0 2px inset $secondary-light;
Expand Down Expand Up @@ -230,6 +241,7 @@ svc-page {
cursor: pointer;
margin-inline-end: calcSize(1); // margin-right
outline: none;
transition: background-color $creator-transition-duration;

use {
fill: var(--ctr-library-contextual-button-icon-color, $foreground-light);
Expand Down Expand Up @@ -285,63 +297,75 @@ svc-page {
pointer-events: none;
}

.sv-list__item.sv-list__item--selected.sv-list__item--group > .sv-list__item-body {
.sv-list__item.sv-list__item--selected.sv-list__item--group>.sv-list__item-body {
background-color: $primary;
color: $primary-foreground;
font-weight: 600;
}

.sv-list__item.sv-list__item--selected.sv-list__item--group > .sv-list__item-body use {
.sv-list__item.sv-list__item--selected.sv-list__item--group>.sv-list__item-body use {
fill: $background;
}
}
}

.svc-page__content--collapsed {
& > * {
&>* {
display: none;
}

.svc-page__content-actions {
display: block;
}

.sd-page {
display: flex;
& > * {

&>* {
display: none;
}

.sd-title {
display: block;
}
}
}

.svc-page__content.svc-page__content--collapsed {
.sd-page {
padding-bottom: 0;
}
}

.svc-creator .svc-page {
.svc-page__content--collapse-always {
.svc-page__content-actions {
visibility: visible;
opacity: 1;

.sv-action {
visibility: hidden;
}

.sv-action.sv-action-bar-item--collapse {
visibility: visible;

.sv-action-bar-separator {
visibility: hidden;
}
}
}

&.svc-page__content--selected,
&.svc-hovered {
.svc-page__content-actions {
.sv-action {
visibility: visible;

.sv-action-bar-separator {
visibility: visible;
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions packages/survey-creator-core/src/components/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@

.sv-list__item-body {
color: var(--ctr-list-item-text-color, $foreground-dim);
transition: background-color $creator-transition-duration, color $creator-transition-duration;
}

.sv-list__item-icon use {
Expand Down
Loading
Loading