From eb90ad28347135ce9d01dcb44efc30015795ee83 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Wed, 7 Dec 2022 10:11:29 +0800 Subject: [PATCH] repos square --- public/home/home.js | 14 ++------ web_src/vuepages/langs/config/zh-CN.js | 4 +-- .../pages/repos/components/RecommendRepos.vue | 13 +++---- .../pages/repos/components/ReposItem.vue | 35 +++++++++++++------ .../pages/repos/components/ReposList.vue | 2 -- .../pages/repos/components/SearchBar.vue | 9 ++--- .../pages/repos/components/SquareTop.vue | 6 ++-- 7 files changed, 46 insertions(+), 37 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index aeb51b184..df18b7891 100755 --- a/public/home/home.js +++ b/public/home/home.js @@ -622,20 +622,12 @@ function displayRepo(json){ for (var i = 0, iLen = repos.length; i < iLen; i++) { if (i >= 4) break; var repo = repos[i]; - // ${repo["NumStars"]}${repo["NumForks"]}
html += `
-
- ${repo["Avatar"] ? `` : ``} +
+ ${repo["Avatar"] ? `` : ``} ${repo["Alias"]}
${repo["Description"]}
- `; - // if (repo["Topics"] != null) { - // for(var j = 0; j < repo["Topics"].length; j++){ - // var topic = repo["Topics"][j]; - // var url = "/explore/repos?q=" + (topic) + "&topic=" - // html += `${topic}`; - // } - // } + `; html += `
`; diff --git a/web_src/vuepages/langs/config/zh-CN.js b/web_src/vuepages/langs/config/zh-CN.js index 9072540d5..900391263 100644 --- a/web_src/vuepages/langs/config/zh-CN.js +++ b/web_src/vuepages/langs/config/zh-CN.js @@ -315,8 +315,8 @@ const zh = { mostAiTasks: 'AI任务最多', mostModels: '模型最多', dataset: '数据集', - model: '模型:', - aiTask: 'AI任务:', + model: '模型', + aiTask: 'AI任务', updated: '最后更新于', contributors: '贡献者', searchRepositories: '搜项目', diff --git a/web_src/vuepages/pages/repos/components/RecommendRepos.vue b/web_src/vuepages/pages/repos/components/RecommendRepos.vue index 2b960c79c..1f7b74ecd 100644 --- a/web_src/vuepages/pages/repos/components/RecommendRepos.vue +++ b/web_src/vuepages/pages/repos/components/RecommendRepos.vue @@ -44,12 +44,13 @@ export default { for (var i = 0, iLen = repos.length; i < iLen; i++) { if (i >= 4) break; var repo = repos[i]; - html += `
-
- ${repo["Avatar"] ? `` : ``} - ${repo["Alias"]} -
${repo["Description"]}
-
+ html += `
+
+ ${repo["Avatar"] ? `` : ``} + ${repo["Alias"]} +
${repo["Description"]}
+
+
`; } html += '
' diff --git a/web_src/vuepages/pages/repos/components/ReposItem.vue b/web_src/vuepages/pages/repos/components/ReposItem.vue index 50785f18d..c7214d6b3 100644 --- a/web_src/vuepages/pages/repos/components/ReposItem.vue +++ b/web_src/vuepages/pages/repos/components/ReposItem.vue @@ -12,6 +12,16 @@ / + + +
@@ -23,19 +33,19 @@ {{ data.NumStars }} - {{ data.NumForks }} -
-
+
+
-
+
{{ $t('repos.dataset') }}: @@ -64,8 +74,9 @@ :style="{ backgroundColor: data.PrimaryLanguage.Color }">{{ data.PrimaryLanguage.Language }}
- {{ $t('repos.contributors') }}  - {{ data.TotalContributorCountShow }} + + {{ $t('repos.contributors') }}  + @@ -138,6 +149,7 @@ export default { width: 38px; height: 38px; margin-right: 10px; + border-radius: 100%; } .content { @@ -169,13 +181,13 @@ export default { font-size: 18px; color: rgba(16, 16, 16, 1); font-weight: bold; + margin-right: 3px; } .content .title-r { - width: 240px; display: flex; align-items: center; - font-size: 12px; + font-size: 13px; font-weight: bold; color: rgb(26, 40, 51, 0.9); justify-content: flex-end; @@ -192,9 +204,10 @@ export default { } .content .descr { + font-weight: 300; font-size: 14px; color: rgba(16, 16, 16, 0.8); - margin-bottom: 12px; + margin-bottom: 16px; overflow: hidden; text-overflow: ellipsis; word-break: break-all; @@ -228,7 +241,8 @@ export default { .content .repo-datas { display: flex; align-items: center; - margin: 24px 0; + margin-top: 20px; + margin-bottom: 10px; } .content .repo-datas-item { @@ -257,6 +271,7 @@ export default { align-items: center; justify-content: space-between; border-top: 1px solid rgba(157, 197, 226, 0.2); + margin-top: 10px; padding-top: 10px; font-size: 12px; color: rgba(16, 16, 16, 0.6); diff --git a/web_src/vuepages/pages/repos/components/ReposList.vue b/web_src/vuepages/pages/repos/components/ReposList.vue index 92840d7bd..abb40e295 100644 --- a/web_src/vuepages/pages/repos/components/ReposList.vue +++ b/web_src/vuepages/pages/repos/components/ReposList.vue @@ -57,7 +57,6 @@ export default { } }); const contributors = item.Contributors || []; - const contributorsCnt = item.TotalContributorCount <= 6 ? Math.min(contributors.length, item.TotalContributorCount) : item.TotalContributorCount; return { ...item, NameShow: this.handlerSearchStr(item.Alias, this.q), @@ -68,7 +67,6 @@ export default { topicShow: this.handlerSearchStr(_item, this.q) } }), - TotalContributorCountShow: contributorsCnt <= 10 ? contributorsCnt.toString() : '10+', } }); this.total = res.Data.Total; diff --git a/web_src/vuepages/pages/repos/components/SearchBar.vue b/web_src/vuepages/pages/repos/components/SearchBar.vue index 50013e867..12fcca398 100644 --- a/web_src/vuepages/pages/repos/components/SearchBar.vue +++ b/web_src/vuepages/pages/repos/components/SearchBar.vue @@ -34,11 +34,12 @@ :style="{ backgroundColor: topicColors[index % topicColors.length] }" v-for="(item, index) in topics" :key="index">{{ item.v }} {{ $t('repos.allFields') + style="font-weight:bold;" + :style="{ backgroundColor: selectTopic == '' ? selectedColor : defaultColor, color: selectTopic == '' ? 'white' : '#40485b' }">{{ + $t('repos.allFields') }} - {{ item.v }}
diff --git a/web_src/vuepages/pages/repos/components/SquareTop.vue b/web_src/vuepages/pages/repos/components/SquareTop.vue index 0a0c5e824..c40c0a1e3 100644 --- a/web_src/vuepages/pages/repos/components/SquareTop.vue +++ b/web_src/vuepages/pages/repos/components/SquareTop.vue @@ -105,6 +105,7 @@ export default { html += `${topics[k]}` } html += `
+ `; } html += ``; @@ -276,6 +277,7 @@ img:not([src]) { background: rgba(255, 255, 255, 0.6); margin-bottom: 20px; box-sizing: border-box; + position: relative; } /deep/._repo_nowrap { @@ -303,13 +305,13 @@ img:not([src]) { /deep/._repo_sw_card_title { font-weight: 700; - font-size: 16px; + font-size: 14px; color: rgba(26, 40, 51, 1); margin-bottom: 10px; } /deep/._repo_sw_card_descr { - font-size: 14px; + font-size: 12px; color: rgba(80, 85, 89, 1); margin-bottom: 10px; min-height: 42px;