Skip to content

Commit

Permalink
chore: Refine the popup window size and sidebar remember logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhua committed Nov 11, 2024
1 parent 6ed085e commit e9b6ed7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ui/ariang/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
</a>
</li>
</ul>
</li> --></ul></div><div class="pull-right ng-cloak" ng-if="globalStatusContext.isEnabled"><a class="global-status" title="{{('Click to pin' | translate)}}" ng-pop-chart ng-data="globalStatusContext.data" ng-theme="currentTheme" ng-container="body" ng-placement="top" ng-trigger="click hover" ng-popover-class="global-status-chart"><span class="realtime-speed"><i class="icon-download fa fa-arrow-down"></i> <span ng-bind="(globalStat.downloadSpeed | readableVolume) + '/s'"></span> </span><span class="realtime-speed"><i class="icon-upload fa fa-arrow-up"></i> <span ng-bind="(globalStat.uploadSpeed | readableVolume) + '/s'"></span></span></a></div></nav></footer><ng-setting-dialog setting="quickSettingContext"></ng-setting-dialog></div><script src="js/jquery-3.7.1.min.js"></script><script src="js/angular-packages-1.8.3.min.js"></script><script src="js/bootstrap-4.6.2.min.js"></script><script src="js/moment-with-locales-2.29.4.min.js"></script><script src="js/echarts-common-3.8.5.min.js"></script><script src="js/plugins-2104250bca.min.js"></script><script src="js/aria-ng-860b712940.min.js"></script></body></html>
</li> --></ul></div><div class="pull-right ng-cloak" ng-if="globalStatusContext.isEnabled"><a class="global-status" title="{{('Click to pin' | translate)}}" ng-pop-chart ng-data="globalStatusContext.data" ng-theme="currentTheme" ng-container="body" ng-placement="top" ng-trigger="click hover" ng-popover-class="global-status-chart"><span class="realtime-speed"><i class="icon-download fa fa-arrow-down"></i> <span ng-bind="(globalStat.downloadSpeed | readableVolume) + '/s'"></span> </span><span class="realtime-speed"><i class="icon-upload fa fa-arrow-up"></i> <span ng-bind="(globalStat.uploadSpeed | readableVolume) + '/s'"></span></span></a></div></nav></footer><ng-setting-dialog setting="quickSettingContext"></ng-setting-dialog></div><script src="js/jquery-3.7.1.min.js"></script><script src="js/angular-packages-1.8.3.min.js"></script><script src="js/bootstrap-4.6.2.min.js"></script><script src="js/moment-with-locales-2.29.4.min.js"></script><script src="js/echarts-common-3.8.5.min.js"></script><script src="js/plugins-bb70e85dac.min.js"></script><script src="js/aria-ng-3aaabaa96c.min.js"></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

37 changes: 8 additions & 29 deletions ui/ariang/popup.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
<!-- /**
<!--
/**
* @author Alex Hua
* @date 2019.01.02
*
* © Copyright 2019 Alex Hua
*/ --><html><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><head><style type="text/css">html,
*/
--><html><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><head><style type="text/css">html,
body {
border: 0px;
margin: 0px;
padding: 0px;
}

@media (-webkit-min-device-pixel-ratio: 1) {
#AriaNG {
height: 580px;
width: 790px;
}
}

@media (-webkit-min-device-pixel-ratio: 1.1) {
#AriaNG {
height: 540px;
width: 710px;
}
}

@media (-webkit-min-device-pixel-ratio: 1.25) {
#AriaNG {
height: 465px;
width: 640px;
}
}

@media (-webkit-min-device-pixel-ratio: 1.5) {
#AriaNG {
height: 400px;
width: 520px;
}
}</style></head><body><iframe id="AriaNG" src="index.html" frameborder="0" scrolling="no"></iframe></body></html>
#AriaNG {
height: 580px;
width: 790px;
}</style><script src="popup.js"></script></head><body><iframe id="AriaNG" src="index.html" frameborder="0" scrolling="no"></iframe></body></html>
11 changes: 11 additions & 0 deletions ui/ariang/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chrome && chrome.tabs.getZoomSettings(zoomSettings => {
zoomFactor = zoomSettings.defaultZoomFactor || 1;
const element = document.getElementById('AriaNG');
if (element && zoomFactor > 0 && zoomFactor != 1) {
const adjustedWidth = Math.floor(element.offsetWidth / zoomFactor);
const adjustedHeight = Math.floor(element.offsetHeight / zoomFactor);

element.style.width = adjustedWidth + 'px';
element.style.height = adjustedHeight + 'px';
}
})

0 comments on commit e9b6ed7

Please sign in to comment.