-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from takejohn/feature/apply-style
CSS完全に理解した
- Loading branch information
Showing
11 changed files
with
367 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ export default defineConfig({ | |
ssr: { | ||
noExternal: ['path-to-regexp'] | ||
} | ||
} | ||
}); | ||
}, | ||
prefetch: false | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,104 @@ | ||
--- | ||
type EntryType = 'file' | 'directory' | 'parent'; | ||
interface Props { | ||
name: string; | ||
href: string; | ||
size?: string; | ||
type: EntryType; | ||
} | ||
const { name, href, size, type } = Astro.props; | ||
function getIconSrc() { | ||
switch (type) { | ||
default: | ||
case 'file': | ||
return '/static/file.svg'; | ||
case 'directory': | ||
return '/static/directory.svg'; | ||
case 'parent': | ||
return '/static/parent.svg'; | ||
} | ||
} | ||
const { name, href, size } = Astro.props; | ||
--- | ||
|
||
<li class="entry-item"> | ||
<a href={href}> | ||
{name} | ||
<li class="item"> | ||
<a href={href} class="link"> | ||
<div class="box"> | ||
<div class="icon-box"> | ||
<img class="icon" src={getIconSrc()} alt="ファイル"> | ||
</div> | ||
<div class="data-box"> | ||
<div class="column-box name-box"> | ||
<span class="name">{name}</span> | ||
</div> | ||
<div class="column-box size-box"> | ||
{(size != null) && <span>{size}</span>} | ||
</div> | ||
</div> | ||
</div> | ||
</a> | ||
{(size != null) && <span>({size})</span>} | ||
</li> | ||
|
||
<style> | ||
.item { | ||
list-style: none; | ||
border-bottom: 2px solid silver; | ||
margin: 0; | ||
} | ||
|
||
.item:last-child { | ||
border-bottom-width: 0; | ||
} | ||
|
||
.link { | ||
color: black; | ||
text-decoration: none; | ||
} | ||
|
||
.box { | ||
padding: 0.5em; | ||
margin: 0; | ||
} | ||
|
||
.icon { | ||
height: 1.25em; | ||
width: auto; | ||
vertical-align: middle; | ||
} | ||
|
||
.name { | ||
font-family: monospace; | ||
} | ||
|
||
.box:hover { | ||
background-color: silver; | ||
} | ||
|
||
.box { | ||
display: flex; | ||
} | ||
|
||
.icon-box { | ||
width: 1.5em; | ||
} | ||
|
||
.data-box { | ||
display: flex; | ||
width: 100%; | ||
} | ||
|
||
.column-box { | ||
padding: 0 1em 0; | ||
} | ||
|
||
.name-box { | ||
flex: 2; | ||
} | ||
|
||
.size-box { | ||
flex: 1; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
import UploadButton from "../components/UploadButton.astro"; | ||
interface Props { | ||
found: boolean; | ||
} | ||
const { found } = Astro.props; | ||
--- | ||
|
||
<div class="header"> | ||
<div class="title-box"> | ||
<h1>CDN File list</h1> | ||
</div> | ||
{(!found) && <p>404 Not Found</p>} | ||
<UploadButton /> | ||
</div> | ||
|
||
<style> | ||
.header { | ||
text-align: center; | ||
} | ||
|
||
.title-box { | ||
border-bottom: 2px solid silver; | ||
margin-bottom: 8px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<ul class="list"> | ||
<slot /> | ||
</ul> | ||
|
||
<style> | ||
.list { | ||
padding: 0; | ||
border: 2px solid silver; | ||
border-radius: 0.5em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
import { ViewTransitions } from "astro:transitions"; | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang=ja"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>SimpleCDN</title> | ||
<ViewTransitions /> | ||
</head> | ||
|
||
<body> | ||
<slot /> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.