Skip to content

Commit 8229219

Browse files
committed
Add icons to dialog proposal details page
1 parent ab72637 commit 8229219

4 files changed

Lines changed: 46 additions & 36 deletions

File tree

web/themes/custom/hoeringsportal/assets/css/module/_animated-svg.scss

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,72 @@
1-
svg {
1+
a:has(svg) {
22
/* prettier-ignore */
33
--ease-spring-lazy: linear(0, 0.008 1.1%, 0.034 2.3%, 0.134 4.9%, 0.264 7.3%, 0.683 14.3%, 0.797 16.5%, 0.89 18.6%, 0.967 20.7%, 1.027 22.8%, 1.073 25%, 1.104 27.3%, 1.123 30.6%, 1.119 34.3%, 1.018 49.5%, 0.988 58.6%, 0.985 65.2%, 1 84.5%, 1);
44
/* prettier-ignore */
55
--ease-spring-glide: linear(0, 0.012 0.9%, 0.05 2%, 0.411 9.2%, 0.517 11.8%, 0.611 14.6%, 0.694 17.7%, 0.765 21.1%, 0.824 24.8%, 0.872 28.9%, 0.91 33.4%, 0.939 38.4%, 0.977 50.9%, 0.994 68.4%, 1);
66
--path-fill-color: white;
77
--path-stroke-color: var(--bs-secondary);
8+
--sp2: 4px;
89

9-
cursor: pointer;
10+
display: flex;
11+
gap: var(--sp2);
1012

11-
/* Comment */
12-
g.comment {
13-
path {
14-
transform-origin: bottom left;
15-
stroke-width: 1.5px;
16-
transition: stroke 200ms var(--ease-spring-glide);
13+
svg {
14+
/* Comment */
15+
g.comment {
16+
path {
17+
transform-origin: bottom left;
18+
stroke-width: 1.5px;
19+
transition: stroke 200ms var(--ease-spring-glide);
20+
}
1721
}
1822

19-
&:hover {
23+
/* Reply */
24+
g.reply {
2025
path {
21-
animation: pop 400ms var(--ease-spring-lazy);
22-
transition: fill 200ms 300ms var(--ease-spring-lazy);
23-
fill: var(--bs-primary);
26+
transform-origin: center right;
27+
stroke-width: 1.5px;
28+
transition: stroke 200ms var(--ease-spring-glide);
29+
}
30+
}
31+
32+
/* Thumbs up */
33+
g.thumbs-up {
34+
path {
35+
stroke-width: 1.5px;
2436
stroke: var(--bs-secondary);
2537
}
38+
39+
path:first-of-type {
40+
transform-origin: center left;
41+
transition: stroke 200ms var(--ease-spring-glide);
42+
}
2643
}
2744
}
2845

29-
/* Reply */
30-
g.reply {
31-
path {
32-
transform-origin: center right;
33-
stroke-width: 1.5px;
34-
transition: stroke 200ms var(--ease-spring-glide);
46+
/* Hover on <a> */
47+
&:hover {
48+
/* Comment hover */
49+
g.comment {
50+
path {
51+
animation: pop 400ms var(--ease-spring-lazy);
52+
transition: fill 200ms 300ms var(--ease-spring-lazy);
53+
fill: var(--bs-primary);
54+
stroke: var(--bs-secondary);
55+
}
3556
}
3657

37-
&:hover {
58+
/* Reply hover */
59+
g.reply {
3860
path {
3961
animation: stretchX 400ms var(--ease-spring-lazy);
4062
transition: fill 200ms 300ms var(--ease-spring-lazy);
4163
fill: var(--bs-primary);
4264
stroke: var(--bs-secondary);
4365
}
4466
}
45-
}
46-
47-
/* Thumbs up */
48-
g.thumbs-up {
49-
path {
50-
stroke-width: 1.5px;
51-
stroke: var(--bs-secondary);
52-
}
53-
54-
path:first-of-type {
55-
transform-origin: center left;
56-
transition: stroke 200ms var(--ease-spring-glide);
57-
}
5867

59-
&:hover {
68+
/* Thumbs-up hover */
69+
g.thumbs-up {
6070
path:last-child {
6171
transition: fill 200ms 300ms var(--ease-spring-lazy);
6272
fill: var(--bs-primary);

web/themes/custom/hoeringsportal/templates/comment/field--comment.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @see comment_preprocess_field()
2727
*/
2828
#}
29-
<section{{ attributes.addClass('comments') }}>
29+
<section{{ attributes.addClass('comments') }} id="comments">
3030
{% if comment_form %}
3131
<h2{{ content_attributes }}>{{ 'Add new comment'|t }}</h2>
3232
{{ comment_form }}

web/themes/custom/hoeringsportal/templates/content/flag--support-proposal.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
{# Set nofollow to prevent search bots from crawling anonymous flag links #}
3838
{% set attributes = attributes.setAttribute('rel', 'nofollow') %}
3939
<div class="{{classes|join(' ')}}">
40-
<a{{ attributes }}><i class="fa-solid fa-thumbs-up me-2"></i>{{ flagcount(flag, flaggable) }} {{ 'like this'|t }}</a>
40+
<a{{ attributes }}>{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-thumbs-up.svg.html.twig') }}{{ flagcount(flag, flaggable) }} {{ 'like this'|t }}</a>
4141
</div>

web/themes/custom/hoeringsportal/templates/content/node--dialogue-proposal--full.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<span class="flag-wrapper">{{ content.flag_support_proposal }}</span>
2525
</div>
2626
<div>
27-
<span class="me-2"><i class="me-2 fa-solid fa-comments"></i>{{ node.field_comments.comment_count }}</span><span>{{ 'Comments'|t }}</span>
27+
<a href="#comments" class="text-decoration-none text-secondary">{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-comment.svg.html.twig') }}<span>{{ node.field_comments.comment_count }}</span><span>{{ 'Comments'|t }}</span></a>
2828
</div>
2929
</div>
3030
</div>

0 commit comments

Comments
 (0)