Skip to content

Commit

Permalink
2023-06-11T16:10:45
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 11, 2023
1 parent 4409c06 commit 605bbd9
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 182 deletions.
18 changes: 8 additions & 10 deletions luci-theme-argon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[immortalwrt]: https://github.com/immortalwrt/immortalwrt

<div align="center">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon_title2.svg">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon_title4.svg">

# A brand new OpenWrt LuCI theme

Expand All @@ -56,7 +56,7 @@ It also supports automatic and manual switching between light and dark modes.
[Contributors](#contributors)
[Credits](#credits)

<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon2.gif">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon4.gif">
</div>

## Key Features
Expand All @@ -77,15 +77,15 @@ The table below will provide a detailed introduction:
| Branch | Version | Description | Matching source |
| ------ | ------- | ---------------------------------- | --------------------------------------------------------- |
| master | v2.x.x | Support the latest version of LuCI | [Official OpenWrt][official][ImmortalWrt][immortalwrt] |
| 18.06 | v1.x.x | Support the 18.06 version of LuCI | [Lean LEDE][lede] |
| 18.06 | v1.x.x | Support the 18.06 version of LuCI | [Lean's LEDE][lede] |

## Version History

The latest version is v2.3.1 [Click here][en-us-release-log] to view the full version history record.

## Getting started

### Build for Lean LEDE project
### Build for Lean's LEDE project

```bash
cd lede/package/lean
Expand All @@ -104,10 +104,10 @@ make menuconfig #choose LUCI->Theme->Luci-theme-argon
make -j1 V=s
```

### Install for Lean LEDE project
### Install for LuCI 18.06 ( Lean's LEDE )

```bash
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.7.7/luci-theme-argon_1.7.7_all.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.8.2/luci-theme-argon_1.8.2-20230609_all.ipk
opkg install luci-theme-argon*.ipk
```

Expand All @@ -116,7 +116,7 @@ opkg install luci-theme-argon*.ipk
```bash
opkg install luci-compat
opkg install luci-lib-ipkg
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.3/luci-theme-argon_2.3_all.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.3.1/luci-theme-argon_2.3.1_all.ipk
opkg install luci-theme-argon*.ipk
```

Expand All @@ -127,12 +127,10 @@ wget --no-check-certificate https://github.com/jerrykuku/luci-app-argon-config/r
opkg install luci-app-argon-config*.ipk
```

## Wanted

## Notice

- Chrome browser is highly recommended. There are some new css3 features used in this theme, currently only Chrome has the best compatibility.
- Currently, the mainline version of the IE series has bugs that need to be addressed.
- Microsoft has officially retired Internet Explorer, RIP IE🙏<del>Currently, the mainline version of the IE series has bugs that need to be addressed.</del>
- FireFox does not enable the backdrop-filter by default, [see here](https://developer.mozilla.org/zh-CN/docs/Web/CSS/backdrop-filter) for the opening method.

## Screenshots
Expand Down
14 changes: 7 additions & 7 deletions luci-theme-argon/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[immortalwrt]: https://github.com/immortalwrt/immortalwrt

<div align="center">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon_title2.svg">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon_title4.svg">

# 一个全新的 OpenWrt 主题

Expand Down Expand Up @@ -77,15 +77,15 @@ Argon 是**一款干净整洁的 OpenWrt LuCI 主题**,
| 分支 | 版本 | 介绍 | 匹配源码 |
| ------ | ------ | --------------------------- | ----------------------------------------------------- |
| master | v2.x.x | 支持最新和比较新版本的 LuCI | [官方 OpenWrt][official][ImmortalWrt][immortalwrt] |
| 18.06 | v1.x.x | 支持 18.06 版本的 LuCI | [Lean LEDE][lede] |
| 18.06 | v1.x.x | 支持 18.06 版本的 LuCI | [Lean's LEDE][lede] |

## 版本历史

当前最新的版本为 v2.3.1 [点击这里][zh-cn-release-log]查看完整的版本历史日志.

## 快速开始

### 使用 Lean LEDE 构建
### 使用 Lean's LEDE 构建

```bash
cd lede/package/lean
Expand All @@ -104,10 +104,10 @@ make menuconfig #choose LUCI->Theme->Luci-theme-argon
make -j1 V=s
```

### 在 18.06 的 LuCI 上安装
### 在 18.06 的 LuCI 上安装 ( Lean's LEDE )

```bash
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.7.7/luci-theme-argon_1.7.7_all.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.8.2/luci-theme-argon_1.8.2-20230609_all.ipk
opkg install luci-theme-argon*.ipk
```

Expand All @@ -116,7 +116,7 @@ opkg install luci-theme-argon*.ipk
```bash
opkg install luci-compat
opkg install luci-lib-ipkg
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.3/luci-theme-argon_2.3_all.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.3.1/luci-theme-argon_2.3.1_all.ipk
opkg install luci-theme-argon*.ipk
```

Expand All @@ -130,7 +130,7 @@ opkg install luci-app-argon-config*.ipk
## 注意

- 强烈建议使用 Chrome 浏览器。这个主题中使用了一些新的 css3 功能,目前只有 Chrome 浏览器有最好的兼容性。
- 目前,IE 系列的主线版本有需要解决的错误。
- 微软已正式退役 Internet Explorer,安息吧 IE🙏<del>目前,IE 系列的主线版本有需要解决的错误。</del>
- FireFox 默认不启用 backdrop-filter,[见这里](https://developer.mozilla.org/zh-CN/docs/Web/CSS/backdrop-filter)的打开方法。

## 屏幕截图
Expand Down
6 changes: 6 additions & 0 deletions luci-theme-edge/htdocs/luci-static/edge/cascade.css
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ header .fill .status * {
left: 0.8rem;
padding-top: 3px;
transition: all 0.3s;
content: "\e915";
color: #5e72e4;
}

.main .main-left .nav li .menu::after {
Expand Down Expand Up @@ -1005,6 +1007,10 @@ header .fill .status * {
padding: 0rem 0.5rem;
}

.main .main-left .nav li.slide .slide-menu.active {
display: block;
}

.main .main-left .nav li .slide-menu li {
position: relative;
border-radius: 2px;
Expand Down
2 changes: 1 addition & 1 deletion luci-theme-edge/htdocs/luci-static/edge/js/jquery.min.js

Large diffs are not rendered by default.

64 changes: 0 additions & 64 deletions luci-theme-edge/htdocs/luci-static/edge/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,73 +65,9 @@ document.addEventListener('luci-loaded', function(ev) {
return true;
}

$(".main > .main-left > .nav > .slide > .menu").each(function () {
var ulNode = $(this);
ulNode.next().find("a").each(function () {
var that = $(this);
var href = that.attr("href");

if (href.indexOf(nodeUrl) != -1) {
ulNode.click();
ulNode.next(".slide-menu").stop(true, true);
lastNode = that.parent();
lastNode.addClass("active");
ret = true;
return true;
}
});
});
return ret;
}

/**
* menu click
*/
/**
* menu click
*/
$(".main > .main-left > .nav > .slide > .menu").click(function () {
var ul = $(this).next(".slide-menu");
var menu = $(this);
$(".main > .main-left > .nav > .slide > .menu").each(function () {
var ulNode = $(this);
ulNode.removeClass("active");
ulNode.next(".slide-menu").stop(true).slideUp("fast")
});
if (!ul.is(":visible")) {
menu.addClass("active");
ul.addClass("active");
ul.stop(true).slideDown("fast");
} else {
ul.stop(true).slideUp("fast", function () {
menu.removeClass("active");
ul.removeClass("active");
});
}
return false;
});

/**
* hook menu click and add the hash
*/
$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function () {
if (lastNode != undefined) lastNode.removeClass("active");
$(this).parent().addClass("active");
$(".main > .loading").fadeIn("fast");
return true;
});

/**
* fix menu click
*/
$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function () {
if (lastNode != undefined) lastNode.removeClass("active");
$(this).addClass("active");
$(".main > .loading").fadeIn("fast");
window.location = $($(this).find("a")[0]).attr("href");
return false;
});

/**
* get current node and open it
*/
Expand Down
158 changes: 158 additions & 0 deletions luci-theme-edge/htdocs/luci-static/resources/menu-edge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
'use strict';
'require baseclass';
'require ui';

return baseclass.extend({
__init__: function () {
ui.menu.load().then(L.bind(this.render, this));
},

render: function (tree) {
var node = tree,
url = '',
children = ui.menu.getChildren(tree);

for (var i = 0; i < children.length; i++) {
var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0);

if (isActive)
this.renderMainMenu(children[i], children[i].name);
}

if (L.env.dispatchpath.length >= 3) {
for (var i = 0; i < 3 && node; i++) {
node = node.children[L.env.dispatchpath[i]];
url = url + (url ? '/' : '') + L.env.dispatchpath[i];
}

if (node)
this.renderTabMenu(node, url);
}

document.querySelector('a.showSide')
.addEventListener('click', ui.createHandlerFn(this, 'handleSidebarToggle'));
document.querySelector('.darkMask')
.addEventListener('click', ui.createHandlerFn(this, 'handleSidebarToggle'));
},

handleMenuExpand: function (ev) {
var a = ev.target, slide = a.parentNode, slide_menu = a.nextElementSibling;
var collapse = false;

document.querySelectorAll('.main .main-left .nav > li >ul.active').forEach(function (ul) {
$(ul).stop(true).slideUp("fast", function () {
ul.classList.remove('active');
ul.previousElementSibling.classList.remove('active');
});
if (!collapse && ul === slide_menu) {
collapse = true;
}

});

if (!slide_menu)
return;


if (!collapse) {
$(slide).find(".slide-menu").slideDown("fast",function(){
slide_menu.classList.add('active');
a.classList.add('active');
});
a.blur();
}
ev.preventDefault();
ev.stopPropagation();
},

renderMainMenu: function (tree, url, level) {
var l = (level || 0) + 1,
ul = E('ul', { 'class': level ? 'slide-menu' : 'nav' }),
children = ui.menu.getChildren(tree);

if (children.length == 0 || l > 2)
return E([]);

for (var i = 0; i < children.length; i++) {
var isActive = ((L.env.dispatchpath[l] == children[i].name) && (L.env.dispatchpath[l - 1] == tree.name)),
submenu = this.renderMainMenu(children[i], url + '/' + children[i].name, l),
hasChildren = submenu.children.length,
slideClass = hasChildren ? 'slide' : null,
menuClass = hasChildren ? 'menu' : 'food';
if (isActive) {
ul.classList.add('active');
slideClass += " active";
menuClass += " active";
}

ul.appendChild(E('li', { 'class': slideClass }, [
E('a', {
'href': L.url(url, children[i].name),
'click': (l == 1) ? ui.createHandlerFn(this, 'handleMenuExpand') : null,
'class': menuClass,
'data-title': hasChildren ? children[i].title.replace(" ", "_") : children[i].title.replace(" ", "_"),
}, [_(children[i].title)]),
submenu
]));
}

if (l == 1) {
document.querySelector('#mainmenu').appendChild(ul);
document.querySelector('#mainmenu').style.display = '';

}
return ul;
},

renderTabMenu: function (tree, url, level) {
var container = document.querySelector('#tabmenu'),
l = (level || 0) + 1,
ul = E('ul', { 'class': 'tabs' }),
children = ui.menu.getChildren(tree),
activeNode = null;

if (children.length == 0)
return E([]);

for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l + 2] == children[i].name),
activeClass = isActive ? ' active' : '',
className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass);

ul.appendChild(E('li', { 'class': className }, [
E('a', { 'href': L.url(url, children[i].name) }, [_(children[i].title)])
]));

if (isActive)
activeNode = children[i];
}

container.appendChild(ul);
container.style.display = '';

if (activeNode)
container.appendChild(this.renderTabMenu(activeNode, url + '/' + activeNode.name, l));

return ul;
},

handleSidebarToggle: function (ev) {
var showside = document.querySelector('a.showSide'),
sidebar = document.querySelector('#mainmenu'),
darkmask = document.querySelector('.darkMask'),
scrollbar = document.querySelector('.main-right');

if (showside.classList.contains('active')) {
showside.classList.remove('active');
sidebar.classList.remove('active');
scrollbar.classList.remove('active');
darkmask.classList.remove('active');
}
else {
showside.classList.add('active');
sidebar.classList.add('active');
scrollbar.classList.add('active');
darkmask.classList.add('active');
}
}
});
1 change: 1 addition & 0 deletions luci-theme-edge/luasrc/view/themes/edge/footer.htm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// thanks for Jo-Philipp Wich <jow@openwrt.org>
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
</script>
<script type="text/javascript">L.require('menu-edge')</script>
<script src="<%=media%>/js/script.js?v=2.1"></script>

</body>
Expand Down
Loading

0 comments on commit 605bbd9

Please sign in to comment.