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

adds faded text effect to long parent objectives in courses/sessions #8167

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
.program-year-objectives {
@include m.detail-container(c.$orange);
@include m.objectives;

.fade-text-control {
background-image: linear-gradient(to bottom, transparent, c.$slightWhite);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,69 @@
{{#each (sort-by "title" @parents) as |parent|}}
{{#if @editable}}
<li data-test-parent>
<button
type="button"
class="link-button"
{{on "click" @manage}}
data-test-manage
<FadeText
@text={{html-safe (remove-html-tags parent.title)}}
as |displayText expand collapse updateTextDims isFaded expanded|
>
<button
type="button"
class="link-button"
{{on "click" @manage}}
data-test-manage
>
{{html-safe (remove-html-tags parent.title)}}
</button>
<div class="display-text-wrapper{{if isFaded ' is-faded'}}">
<div
class="display-text"
{{on-resize updateTextDims}}
>
{{displayText}}
</div>
</div>
{{#if @showIcon}}
<FaIcon
data-test-edit-icon
@icon="pen-to-square"
class="enabled"
/>
{{/if}}
</button>
{{#if isFaded}}
<div
class="fade-text-control"
data-test-fade-text-control
{{! template-lint-disable no-invalid-interactive}}
{{on "click" @manage}}
>
<button
class="expand-text-button"
type="button"
aria-label={{t "general.expand"}}
title={{t "general.expand"}}
data-test-expand
{{on "click" expand}}
>
<FaIcon @icon="angles-down" />
</button>
</div>
{{else}}
{{#if expanded}}
<button
class="expand-text-button"
aria-label={{t "general.collapse"}}
title={{t "general.collapse"}}
type="button"
data-test-collapse
{{on "click" collapse}}
>
<FaIcon @icon="angles-up" />
</button>
{{/if}}
{{/if}}
</FadeText>
</li>
{{else}}
<li data-test-parent>
{{html-safe (remove-html-tags parent.title)}}
<FadeText @text={{html-safe (remove-html-tags parent.title)}} />
</li>
{{/if}}
{{else}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,69 @@
{{#each (sort-by-position @parents) as |parent|}}
{{#if @editable}}
<li data-test-parent>
<button
type="button"
class="link-button"
{{on "click" @manage}}
data-test-manage
<FadeText
@text={{html-safe (remove-html-tags parent.title)}}
as |displayText expand collapse updateTextDims isFaded expanded|
>
<button
type="button"
class="link-button"
{{on "click" @manage}}
data-test-manage
>
{{html-safe (remove-html-tags parent.title)}}
</button>
<div class="display-text-wrapper{{if isFaded ' is-faded'}}">
<div
class="display-text"
{{on-resize updateTextDims}}
>
{{displayText}}
</div>
</div>
{{#if @showIcon}}
<FaIcon
data-test-edit-icon
@icon="pen-to-square"
class="enabled"
/>
{{/if}}
</button>
{{#if isFaded}}
<div
class="fade-text-control"
data-test-fade-text-control
{{! template-lint-disable no-invalid-interactive}}
{{on "click" @manage}}
>
<button
class="expand-text-button"
type="button"
aria-label={{t "general.expand"}}
title={{t "general.expand"}}
data-test-expand
{{on "click" expand}}
>
<FaIcon @icon="angles-down" />
</button>
</div>
{{else}}
{{#if expanded}}
<button
class="expand-text-button"
aria-label={{t "general.collapse"}}
title={{t "general.collapse"}}
type="button"
data-test-collapse
{{on "click" collapse}}
>
<FaIcon @icon="angles-up" />
</button>
{{/if}}
{{/if}}
</FadeText>
</li>
{{else}}
<li data-test-parent>
{{html-safe (remove-html-tags parent.title)}}
<FadeText @text={{html-safe (remove-html-tags parent.title)}} />
</li>
{{/if}}
{{else}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "../colors" as c;
@use "../mixins" as m;

.fade-text {
.display-text-wrapper {
Expand All @@ -17,6 +18,7 @@
position: relative;

button {
@include m.ilios-link-button;
position: relative;
top: 110px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
display: inline-block;
}

.fade-text-control {
button {
background: c.$tealBlue;
border-radius: 3px;
color: c.$white;
padding: 0.3em 1em;
}
}

&.dragging-item {
opacity: 0.3;
}
Expand Down