]>
Commit | Line | Data |
---|---|---|
1 | const NAVS = { | |
2 | home: /^\/$/, | |
3 | pb: /^\/(?:pb|sol)\//, | |
4 | ct: /^\/(?:ct|st|ed)\//, | |
5 | log: /^\/log\//, | |
6 | us: /^\/us\//, | |
7 | account: /^\/account$/, | |
8 | contribute: /^\/contribute$/, | |
9 | }; | |
10 | ||
11 | $(function(){ | |
12 | const path = location.pathname; | |
13 | for (const nav in NAVS) | |
14 | if(path.match(NAVS[nav])) | |
15 | q('#nav-' + nav).classList.add('active'); | |
16 | }); |