View Issue Details

IDProjectCategoryView StatusLast Update
0002520Composrcore_notificationspublic2021-03-15 01:22
ReporterPatrick SchmalstigAssigned ToSalman 
SeverityFeature-request 
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0002520: Implement blinking notifications CSS
DescriptionSee http://compo.sr/forum/topicview/browse/designing/make-notification-icons.htm
TagsRoadmap: v11
Time estimation (hours)1
Sponsorship open

Activities

Chris Graham

2019-02-22 16:39

administrator   ~0005922

Salman - there's a feature__notification_blink_numbers branch that needs merging that includes these changes. If you feel any further changes are needed, go ahead and do them.

Chris Graham

2021-03-15 00:39

administrator   ~0006996

Took a video for reference.

vid.mp4 (42,765 bytes)

Chris Graham

2021-03-15 00:40

administrator   ~0006997

Attached a diff for reference.

diff.diff (4,905 bytes)
diff --git a/themes/default/css/notifications.css b/themes/default/css/notifications.css
index fdfe04931..bb5a62951 100644
--- a/themes/default/css/notifications.css
+++ b/themes/default/css/notifications.css
@@ -5,6 +5,32 @@
 
 /* Web UI */
 
+#noti_Container {
+       position:relative;
+       width:16px;
+       height:16px;
+}
+.noti_bubble {
+       position:absolute;
+       top: -6px;
+       right:-9px;
+       padding:1px 2px 1px 2px;
+       background-color:red;
+       color:white;
+       font-weight:bold;
+       font-size:0.55em;
+       border-radius:30px;
+       box-shadow:1px 1px 1px gray;
+}
+
+@keyframes countanimation {
+       0%   {opacity: 0.5;}
+       25%  {opacity: 0;}
+       50%  {opacity: 0.5;}
+       75%  {opacity: 1;}
+       100% {opacity: 0.5;}
+}
+
 #web_notifications_button, #pts_button {
        color: {$GET,heading_text};
        display: inline-block;
@@ -17,6 +43,9 @@
        vertical-align: middle;
        background-repeat: no-repeat;
        outline: 0;
+       animation-name: countanimation;
+       animation-duration: 2s;
+       animation-iteration-count: infinite;
 }
 #web_notifications_button {
        background-image: url('{$IMG;,icons/24x24/tool_buttons/notifications}');
@@ -44,6 +73,7 @@
 
 .count_0 {
        {$BETA_CSS_PROPERTY,opacity: 0.5;}
+       {$BETA_CSS_PROPERTY,animation-iteration-count: 0; -webkit-animation-play-state: paused; animation-play-state: paused;}
 }
 
 .notification {
diff --git a/themes/default/javascript/notification_poller.js b/themes/default/javascript/notification_poller.js
index f2d4ad681..6b565b3d3 100644
--- a/themes/default/javascript/notification_poller.js
+++ b/themes/default/javascript/notification_poller.js
@@ -101,6 +101,7 @@ function _poll_for_notifications(raw_ajax_result)
                        unread=raw_ajax_result.getElementsByTagName('unread_web_notifications');
                        set_inner_html(spot,get_inner_html(display[0]));
                        set_inner_html(button.childNodes[0],get_inner_html(unread[0]));
+                       set_inner_html(document.getElementById('web_notifications_num'),get_inner_html(unread[0]));
                        button.className='count_'+get_inner_html(unread[0]);
                }
        }
@@ -115,6 +116,7 @@ function _poll_for_notifications(raw_ajax_result)
                        unread=raw_ajax_result.getElementsByTagName('unread_pts');
                        set_inner_html(spot,get_inner_html(display[0]));
                        set_inner_html(button.childNodes[0],get_inner_html(unread[0]));
+                       set_inner_html(document.getElementById('pts_num'),get_inner_html(unread[0]));
                        button.className='count_'+get_inner_html(unread[0]);
                }
        }
diff --git a/themes/default/templates/BLOCK_TOP_NOTIFICATIONS.tpl b/themes/default/templates/BLOCK_TOP_NOTIFICATIONS.tpl
index 7c9a79682..21814b421 100644
--- a/themes/default/templates/BLOCK_TOP_NOTIFICATIONS.tpl
+++ b/themes/default/templates/BLOCK_TOP_NOTIFICATIONS.tpl
@@ -21,7 +21,11 @@
                        </ul>
                </div></div>
        </div>
-       <a title="{!NOTIFICATIONS}" id="web_notifications_button" class="count_{NUM_UNREAD_WEB_NOTIFICATIONS%}" onclick="return toggle_web_notifications(event);" href="{$PAGE_LINK*,_SEARCH:notifications:browse}"><span aria-label="{!COUNT_TOTAL} {!NOTIFICATIONS}">{NUM_UNREAD_WEB_NOTIFICATIONS*}</span></a>
+       <a title="{!NOTIFICATIONS}" id="web_notifications_button" class="leave_native_tooltip count_{NUM_UNREAD_WEB_NOTIFICATIONS%}" onclick="return toggle_web_notifications(event);" href="{$PAGE_LINK*,_SEARCH:notifications:browse}"><span aria-label="{!COUNT_TOTAL} {!NOTIFICATIONS}">{NUM_UNREAD_WEB_NOTIFICATIONS*}</span>
+               <div id="noti_Container">
+                       <div class="noti_bubble" id="web_notifications_num">{NUM_UNREAD_WEB_NOTIFICATIONS*}</div>
+               </div>
+       </a>
 {+END}
 
 {+START,IF,{$NOT,{$CONFIG_OPTION,pt_notifications_as_web}}}{+START,IF,{$CNS}}
@@ -42,7 +46,11 @@
                        </ul>
                </div></div>
        </div>
-       <a title="{!cns:PRIVATE_TOPICS}" id="pts_button" class="count_{NUM_UNREAD_PTS%}" onclick="return toggle_pts(event);" href="{$PAGE_LINK*,_SEARCH:members:view#tab__pts}"><span aria-label="{!COUNT_TOTAL} {!cns:PRIVATE_TOPICS}">{NUM_UNREAD_PTS*}</span></a>
+       <a title="{!cns:PRIVATE_TOPICS}" id="pts_button" class="leave_native_tooltip count_{NUM_UNREAD_PTS%}" onclick="return toggle_pts(event);" href="{$PAGE_LINK*,_SEARCH:members:view#tab__pts}"><span aria-label="{!COUNT_TOTAL} {!cns:PRIVATE_TOPICS}">{NUM_UNREAD_PTS*}</span>
+               <div id="noti_Container">
+                       <div class="noti_bubble" id="pts_num">{NUM_UNREAD_PTS*}</div>
+               </div>
+       </a>
 {+END}{+END}
 
 <script>// <![CDATA[
diff.diff (4,905 bytes)

Chris Graham

2021-03-15 01:22

administrator   ~0006998

Thanks. Sorry this took forever Patrick. I had to pretty much reimplement it as v11 had been diverging so much and was a moving target.

Issue History

Date Modified Username Field Change
2016-04-27 02:56 Patrick Schmalstig New Issue
2016-04-27 21:19 Chris Graham Time estimation (hours) => 1
2019-02-22 16:39 Chris Graham Assigned To => Salman
2019-02-22 16:39 Chris Graham Status non-assigned => assigned
2019-02-22 16:39 Chris Graham Note Added: 0005922
2019-06-27 19:01 Chris Graham Tag Attached: Roadmap: v11
2021-03-15 00:39 Chris Graham File Added: vid.mp4
2021-03-15 00:39 Chris Graham Note Added: 0006996
2021-03-15 00:40 Chris Graham File Added: diff.diff
2021-03-15 00:40 Chris Graham Note Added: 0006997
2021-03-15 01:22 Chris Graham Status assigned => resolved
2021-03-15 01:22 Chris Graham Resolution open => fixed
2021-03-15 01:22 Chris Graham Note Added: 0006998