提交 f69e7905 编写于 作者: X xjh22222228

fix: urls

上级 3c1c9f8f
您当前看到的是正在公测 `v5` 版本, 稳定版本发布还需要一定时间,稳定版本请转移到 [v3](https://github.com/xjh22222228/nav/tree/v3)
<p align="center">
<a href="https://nav3.cn/?g">
......@@ -105,7 +104,7 @@ server {
## 关于升级
在升级之前请保存根目录下的 `data` 文件夹,最好把 `nav.config.ts` 配置文件也保存一份以防万一, 升级完后替换即可。
在升级之前请保存根目录下的 `data` 文件夹,最好把 `nav.config.ts` 配置文件也保存一份以防万一, 升级完后替换即可。
......
......@@ -4,7 +4,7 @@ import fs from 'fs'
import config from './nav.config.js'
import path from 'path'
const { description, title, keywords, tongjiUrl } = config.default
const { description, title, keywords, baiduStatisticsUrl } = config.default
const htmlTemplate = `
<title>${title}</title>
<meta name="description" content="${description}">
......@@ -16,7 +16,7 @@ const scriptTemplate = `
var _hmt = _hmt || [];
var hm = document.createElement('script');
hm.async = true;
hm.src = 'https://hm.baidu.com/hm.js?32c73f6240df008812d40821b82ea2b7';
hm.src = '${baiduStatisticsUrl}';
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
</script>
......@@ -27,7 +27,7 @@ try {
const readHtml = fs.readFileSync(htmlPath).toString()
let t = readHtml.replace('<!-- nav.config -->', htmlTemplate)
if (tongjiUrl) {
if (baiduStatisticsUrl) {
t = t.replace('<!-- nav.script -->', scriptTemplate)
}
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
media/1.png

77.8 KB | W: | H:

media/1.png

79.4 KB | W: | H:

media/1.png
media/1.png
media/1.png
media/1.png
  • 2-up
  • Swipe
  • Onion skin
media/2.png

69.5 KB | W: | H:

media/2.png

66.6 KB | W: | H:

media/2.png
media/2.png
media/2.png
media/2.png
  • 2-up
  • Swipe
  • Onion skin
media/3.png

78.7 KB | W: | H:

media/3.png

119.4 KB | W: | H:

media/3.png
media/3.png
media/3.png
media/3.png
  • 2-up
  • Swipe
  • Onion skin
media/4.png

124.5 KB | W: | H:

media/4.png

81.8 KB | W: | H:

media/4.png
media/4.png
media/4.png
media/4.png
  • 2-up
  • Swipe
  • Onion skin
media/5.png

116.8 KB | W: | H:

media/5.png

72.2 KB | W: | H:

media/5.png
media/5.png
media/5.png
media/5.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -70,18 +70,6 @@ const c: IConfig = {
// 百度统计
baiduStatisticsUrl: 'https://hm.baidu.com/hm.js?4582be7af7e7c95ef75351e07c6c32ba',
indexLanguage: [
'英文',
'中文',
'GitHub'
],
appLanguage: [
'EN',
'CN',
'Git'
],
// 只支持 light 主题
// https://www.nav3.cn/#/index?q=grabient
backgroundLinear: [
......
......@@ -18,12 +18,14 @@ export class AppComponent {
}
goRoute() {
const { page, id, q } = queryString()
const screenWidth = window.innerWidth
const queryParams = { page, id, q }
if ('ontouchstart' in window) {
const url = (this.router.url.split('?')[0] || '').toLowerCase()
const { page, id, q } = queryString()
const queryParams = { page, id, q }
if (screenWidth < 768) {
this.router.navigate(['/app'], { queryParams })
if (!url.includes('/app')) {
this.router.navigate(['/app'], { queryParams })
}
}
}
}
......@@ -61,7 +61,7 @@ const appRoutes: Routes = [
},
{
path: '**',
redirectTo: '/' + config.theme,
redirectTo: '/' + config.theme.toLowerCase(),
},
]
......
<div class="mark dark-item-active" *ngIf="dataSource && dataSource.language && dataSource.language.length > 0">
<div class="mark dark-item-active" *ngIf="dataSource && dataSource.urls">
<div class="button-box">
<a
[href]="dataSource.language[0]"
*ngFor="let url of objectKeys(dataSource.urls)"
[href]="dataSource.urls[url]"
class="zh"
target="_blank"
*ngIf="dataSource.language[0]"
rel="noopener noreferer"
>
{{ language[0] }}
</a>
<a
[href]="dataSource.language[1]"
class="zh"
target="_blank"
*ngIf="dataSource.language[1]"
rel="noopener noreferer"
>
{{ language[1] }}
</a>
<a
[href]="dataSource.language[2]"
class="zh"
target="_blank"
*ngIf="dataSource.language[2]"
rel="noopener noreferer"
>
{{ language[2] }}
{{ url }}
</a>
</div>
</div>
......@@ -24,7 +24,7 @@
font-size: 12px;
padding: 3px 0;
border: none;
background: #2db7f5;
background: #26a2ff;
color: #fff;
border-radius: 3px;
overflow: hidden;
......@@ -48,8 +48,4 @@
opacity: .2;
}
}
.zh {
background: #26a2ff;
}
}
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
import { Component, Input } from '@angular/core'
import config from '../../../nav.config'
import { INavFourProp } from '../../types'
@Component({
......@@ -12,5 +11,5 @@ import { INavFourProp } from '../../types'
export class MultipleSiteComponent {
@Input() dataSource: INavFourProp
language: string[] = config.indexLanguage
objectKeys = Object.keys
}
......@@ -10,6 +10,9 @@ export interface INavFourProp {
desc: string
url?: string
language?: string|null|undefined[]
urls?: {
[key: string]: string
}
}
export interface INavThreeProp {
......@@ -51,7 +54,5 @@ export interface IConfig {
gitRepoUrl: string,
footerCopyright: string|null
baiduStatisticsUrl: string
indexLanguage: string[]
appLanguage: string[]
backgroundLinear: string[]
}
<section class="app-page user-select-none">
<header class="header">
<div class="header-top">
<a href="https://github.com/xjh22222228/nav" target="_blank" class="logo">
<img src="assets/logo.png" alt="logo">
</a>
<img src="assets/logo.png" class="logo" alt="logo">
<div class="open" [class.active]="open" (click)="handleToggleOpen()">
<i></i>
<i></i>
......@@ -51,20 +49,8 @@
</div>
<div class="desc" [title]="el.desc">{{ el.desc }}</div>
</a>
<div class="bottom-slide">
<div class="wrapper-button" *ngIf="el.language && el.language.length">
<a
[href]="el.url"
*ngIf="el.language.length <= 3 && (!el.language[0] || !el.language[1])"
target="_blank"
>
默认
</a>
<a [href]="el.language[0]" *ngIf="el.language[0]" target="_blank">{{ language[0] }}</a>
<a [href]="el.language[1]" *ngIf="el.language[1]" target="_blank">{{ language[1] }}</a>
<a [href]="el.language[2]" *ngIf="el.language[2]" target="_blank">{{ language[2] }}</a>
</div>
</div>
<app-multiple-site [dataSource]="el"></app-multiple-site>
</div>
</div>
</li>
......
......@@ -2,6 +2,7 @@ $bg-color: #fbfbfb;
.app-page {
padding: 45px 0;
min-height: 100vh;
background: #f6f6f6;
.header {
......@@ -22,13 +23,10 @@ $bg-color: #fbfbfb;
.logo {
display: inline-block;
img {
width: 35px;
height: 35px;
margin-top: 4px;
pointer-events: none;
}
width: 35px;
height: 35px;
margin-top: 4px;
pointer-events: none;
}
}
......@@ -102,6 +100,7 @@ $bg-color: #fbfbfb;
padding: 3px 5px;
margin: 0 3px 5px 0;
transition: background .1s linear;
color: #333;
}
.active {
......@@ -172,38 +171,10 @@ $bg-color: #fbfbfb;
margin-left: 6px;
}
.bottom-slide {
&.active .wrapper-button {
transform: translate3d(0, 0, 0);
}
}
&:hover {
.wrapper-button {
display: flex;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #fff;
text-align: center;
transition: .1s;
transform: translate3d(0, 110%, 0);
box-shadow: 0 -1px 1px #eee;
a {
flex: 1;
padding: 3px 0;
background: #2db7f5;
color: #fff;
&:active {
background: #26a2ff;
}
&:not(:nth-last-child(1)) {
margin-right: 3px;
}
::ng-deep .mark {
bottom: 0 !important;
}
}
}
......
......@@ -56,7 +56,6 @@ export default class HomeComponent {
if (q) {
this.currentList = fuzzySearch(this.websiteList, q)
console.log(this.currentList)
} else {
initList()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册