Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kska32 committed Sep 28, 2023
1 parent 70e9dcf commit 3ed25b1
Show file tree
Hide file tree
Showing 26 changed files with 3,444 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

Expand All @@ -22,3 +21,10 @@ dist-ssr
*.njsproj
*.sln
*.sw?

package.json
package-lock.json
vite.config.json
src
public
.eslintrc.cjs
Binary file added dist/assets/brand-icons-42e369dc.ttf
Binary file not shown.
1,008 changes: 1,008 additions & 0 deletions dist/assets/brand-icons-6519a15b.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/brand-icons-9fafd6c3.woff
Binary file not shown.
Binary file added dist/assets/brand-icons-d023c55f.eot
Binary file not shown.
Binary file added dist/assets/brand-icons-e7d4d534.woff2
Binary file not shown.
Binary file added dist/assets/flags-94d5c7f1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,518 changes: 1,518 additions & 0 deletions dist/assets/icons-282a64fb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/icons-434466b5.woff2
Binary file not shown.
Binary file added dist/assets/icons-8b4e1b84.eot
Binary file not shown.
Binary file added dist/assets/icons-95b6a484.woff
Binary file not shown.
Binary file added dist/assets/icons-cb7f81f5.ttf
Binary file not shown.
159 changes: 159 additions & 0 deletions dist/assets/index-8d395eb9.js

Large diffs are not rendered by default.

346 changes: 346 additions & 0 deletions dist/assets/index-cdbe175d.css

Large diffs are not rendered by default.

Binary file added dist/assets/outline-icons-4537fa06.eot
Binary file not shown.
Binary file added dist/assets/outline-icons-4bc359c2.woff
Binary file not shown.
Binary file added dist/assets/outline-icons-4d288344.woff2
Binary file not shown.
Binary file added dist/assets/outline-icons-67172172.ttf
Binary file not shown.
366 changes: 366 additions & 0 deletions dist/assets/outline-icons-ae8fd02a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/ebook-list.json.zip
Binary file not shown.
Binary file added dist/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>目录搜索</title>
<script type="module" crossorigin src="/assets/index-8d395eb9.js"></script>
<link rel="stylesheet" href="/assets/index-cdbe175d.css">
</head>
<body>
<div id="root"></div>

</body>
</html>
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>目录搜索</title>
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "ebook-client-app",
"homepage": "./",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

28 changes: 22 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ const BookList = styled.div`
>span{
text-align: left;
>span{
&.size{
position: relative;
background-color: rgba(0,0,0,0.3);
color: #fff;
border-radius: 5px;
font-size: 12px;
padding: 2px 5px;
margin-left: 10px;
user-select: none;
}
}
}
&:hover{
Expand Down Expand Up @@ -138,8 +151,10 @@ function App() {


const search = useCallback((v)=>{
const keyword = v?.trim()??'';
if(keyword === '') return;
setLoading(true);
bookListDB.search(v)
bookListDB.search(keyword)
.then(setBooklist)
.catch(console.error).finally(()=>{
setLoading(false);
Expand All @@ -148,10 +163,8 @@ function App() {


return <AppWrapper>
<h2>目录搜索</h2>
<br />
<InputBox>
<Input fluid placeholder='Search...'
<Input fluid placeholder='目录搜索...'
size='large'
value={value}
onChange={(e)=>setValue(e.target.value)}
Expand All @@ -163,8 +176,11 @@ function App() {
{
booklist.map((v,i)=>{
return <div className='item' key={v.id} >
<span>{v.name}</span>
<a href={v.webViewLink} target='_blank'><Icon name='download' color='grey' /></a>
<span>
<span className='name'>{v.name}</span>
<span className='size'>{Number(v.size / 1024**2).toFixed(2)} MB</span>
</span>
<a href={v.webViewLink} target='_blank'><Icon name='download' color='grey' /></a>
</div>
})
}
Expand Down

0 comments on commit 3ed25b1

Please sign in to comment.