Skip to content

Commit

Permalink
fix: no domain color
Browse files Browse the repository at this point in the history
  • Loading branch information
ldt1997 committed Apr 4, 2023
1 parent e11c85b commit 308f4b8
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<link rel="icon" href="/RedBookUserInfo/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>小红书个人页预览</title>
<script type="module" crossorigin src="/RedBookUserInfo/assets/index-9f45cb27.js"></script>
<link rel="stylesheet" href="/RedBookUserInfo/assets/index-61835e40.css">
<script type="module" crossorigin src="/RedBookUserInfo/assets/index-30b75115.js"></script>
<link rel="stylesheet" href="/RedBookUserInfo/assets/index-0c1f0ea7.css">
</head>
<body ontouchstart="">
<div id="app"></div>
Expand Down
12 changes: 11 additions & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ import UserContent from '../components/UserContent.vue'
<template>
<main>
<UserForm />
<UserInfo/>
<UserInfo />
<UserContent />
</main>
<footer>©️{{ new Date().getFullYear() }} ldt1997</footer>
</template>

<style>
footer {
padding: 16px;
text-align: center;
background-color: #0e0e10;
color: #6d7179;
}
</style>
9 changes: 6 additions & 3 deletions utils/img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ async function base64ToImage(base64) {
}

export const getDomainColor = async (base64) => {
const img = await base64ToImage(base64)
const [r, g, b] = colorThief.getColor(img)
return `rgb(${r},${g},${b})`
if (base64) {
const img = await base64ToImage(base64)
const [r, g, b] = colorThief.getColor(img)
return `rgb(${r},${g},${b})`
}
return 'rgb(198,225,232)'
}

0 comments on commit 308f4b8

Please sign in to comment.