Skip to content

Commit

Permalink
Hide timeout circle if idleStrokeDashoffset is 81; Updated styles; #128
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaaarc committed May 23, 2018
1 parent bfc0511 commit f77e7f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/apis/TimestampController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function actionIndex()
// stroke-dashoffset="0px" => 100 // which means 100 percent of time has elpased, auto logout will redirect the user
$seconds = (time() - $userOnlineModel->last_timestamp);
$percentage = round(($seconds / $this->module->userIdleTimeout) * 100);
$offsetPercent = round((82/100) * $percentage);
$strokeOffset = 82 - $offsetPercent;
$offsetPercent = round((81/100) * $percentage);
$strokeOffset = 81 - $offsetPercent;

// return users, verify force reload.
$data = [
Expand Down
2 changes: 1 addition & 1 deletion src/resources/dist/css/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/resources/scss/components/_user-timeout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
}

.user-timeout-timer {
stroke-dasharray: 82px;
stroke-dasharray: 81px;
transition: .25s ease-in-out stroke-dashoffset, .25s ease-in-out stroke;
}
2 changes: 1 addition & 1 deletion src/views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<!-- needs to be fixed end -->
<div class="mainnav-timeout">
<svg class="user-timeout" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<circle class="user-timeout-timer" cx="15" cy="15" r="13" fill="none" stroke="#FFF" stroke-width="2" transform="translate(15, 15) rotate(-90) translate(-15, -15)" stroke-dashoffset="{{idleStrokeDashoffset}}px"></circle>
<circle class="user-timeout-timer" cx="15" cy="15" r="13" fill="none" stroke="#FFF" stroke-width="2" transform="translate(15, 15) rotate(-90) translate(-15, -15)" ng-show="idleStrokeDashoffset < 81" stroke-dashoffset="{{idleStrokeDashoffset+'px'||'81px'}}"></circle>
</svg>
</div>

Expand Down

0 comments on commit f77e7f9

Please sign in to comment.