Add pages and styles
This commit is contained in:
parent
1ad08ef01a
commit
522e9b1dd7
4 changed files with 51 additions and 16 deletions
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>Astro</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Astro</h1>
|
||||
</body>
|
||||
</html>
|
31
source/src/pages/web.astro
Normal file
31
source/src/pages/web.astro
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
// Layout
|
||||
import Search from "@layouts/Search.astro";
|
||||
|
||||
// Components
|
||||
import WebLink from "@components/search/WebLink.astro";
|
||||
import RelatedSearches from "@components/search/RelatedSearches.astro";
|
||||
|
||||
// Fetch
|
||||
const QueryText = Astro.url.href.split("web?=").pop()
|
||||
const Query = await fetch("https://4get.sudovanilla.org" + "/api/v1/web?s=" + QueryText).then((response) => response.json());
|
||||
---
|
||||
|
||||
<Search Query={QueryText} Type="Web">
|
||||
<slot slot="search">
|
||||
{Query.web.map((query) => (
|
||||
<WebLink
|
||||
Title={query.title}
|
||||
Description={query.description}
|
||||
Link={query.url}
|
||||
/>
|
||||
))}
|
||||
</slot>
|
||||
<slot slot="rich-panel">
|
||||
<RelatedSearches>
|
||||
{Query.related.map((related) => (
|
||||
<a href={'/web?=' + related}>{related}</a>
|
||||
))}
|
||||
</RelatedSearches>
|
||||
</slot>
|
||||
</Search>
|
15
source/src/styles/index.scss
Normal file
15
source/src/styles/index.scss
Normal file
|
@ -0,0 +1,15 @@
|
|||
body {
|
||||
margin: auto;
|
||||
max-width: 1200px;
|
||||
font-family: arial;
|
||||
background: #e5e5e5;
|
||||
padding: 0px 12px;
|
||||
.disabled-items {
|
||||
opacity: 0.3;
|
||||
pointer-events: none;
|
||||
}
|
||||
::selection {
|
||||
background: gray;
|
||||
color: white;
|
||||
}
|
||||
}
|
5
source/src/styles/mobile.scss
Normal file
5
source/src/styles/mobile.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
@media screen and (max-width: 860px){
|
||||
.search-results {
|
||||
grid-template-columns: auto !important;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue