wip, better

This commit is contained in:
Dmitry Zuikov 2024-03-31 14:11:31 +03:00
parent e14c559dca
commit 03665de537
4 changed files with 40 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" />
<path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
</svg>

After

Width:  |  Height:  |  Size: 564 B

View File

@ -5,6 +5,9 @@ import Data.FileEmbed
import Data.ByteString import Data.ByteString
version :: Int
version = 3
cssDir :: [(FilePath, ByteString)] cssDir :: [(FilePath, ByteString)]
cssDir = $(embedDir "assets") cssDir = $(embedDir "assets")

View File

@ -29,6 +29,13 @@ renderMarkdown markdown = case markdownToHtml markdown of
Left{} -> mempty Left{} -> mempty
Right html -> toHtmlRaw $ Text.pack html Right html -> toHtmlRaw $ Text.pack html
-- <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
-- <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
-- <path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" />
-- <path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
-- <path d="M11 14l2 2l4 -4" />
-- </svg>
-- FIXME: move-to-hbs2-browser-lib -- FIXME: move-to-hbs2-browser-lib
hyper_ :: Text -> Attribute hyper_ :: Text -> Attribute
@ -60,9 +67,9 @@ renderEntries args items = pure $ renderBS do
div_ [class_ "repo-list-item"] do div_ [class_ "repo-list-item"] do
div_ [class_ "repo-info"] do div_ [class_ "repo-info"] do
h2_ $ a_ [href_ "", onClickCopy ref] $ toHtml (s <> "-" <> refpart) h2_ [class_ "xclip", onClickCopy ref] $ toHtml (s <> "-" <> refpart)
a_ [href_ "", hyper_ ""] (toHtml (show $ pretty h)) p_ $ a_ [href_ ""] (toHtml (show $ pretty h))
renderMarkdown b renderMarkdown b

View File

@ -234,6 +234,27 @@ form.search input[type="search"] {
form.search button { form.search button {
align: center; align: center;
} }
.xclip::after {
content: "";
display: inline-block;
height: 16px;
width: 16px;
vertical-align: top;
}
.xclip:hover::after {
content: url('/icon/xclip.svg');
margin-left: 1rem;
height: 16px;
width: 16x;
vertical-align: top;
}
.xclip:hover {
text-decoration: underline dotted;
}
|] |]
@ -309,7 +330,7 @@ browserRootPage syn = rootPage do
div_ [class_ "channel-list-item"] do div_ [class_ "channel-list-item"] do
h2_ $ toHtml title h2_ $ toHtml title
a_ [href_ (path [url])] (toHtml (show $ pretty $ AsBase58 rchan)) p_ $ a_ [href_ (path [url])] (toHtml (show $ pretty $ AsBase58 rchan))
for_ [ s | LitStrVal s <- desc ] $ \s -> do for_ [ s | LitStrVal s <- desc ] $ \s -> do
p_ (toHtml s) p_ (toHtml s)