mirror of
https://github.com/ilyakooo0/seax.git
synced 2024-10-05 16:07:12 +03:00
Compare commits
15 Commits
79220d59e4
...
2f60ea2cb4
Author | SHA1 | Date | |
---|---|---|---|
|
2f60ea2cb4 | ||
|
dd5f5bc03a | ||
|
c4c46fe729 | ||
|
b69ee0d7de | ||
|
711dede3aa | ||
|
43fab35ea5 | ||
|
1e49ae3391 | ||
|
f0b7e4f1c7 | ||
|
0d8873ef9b | ||
|
fff3e6e32e | ||
|
29854aff7b | ||
|
3e70e77ea8 | ||
|
9abc4882fb | ||
|
13363fd8bc | ||
|
cae52014b9 |
@ -4,4 +4,9 @@ set -e
|
||||
|
||||
cd "$(dirname "$0")/../frontend"
|
||||
|
||||
nix run nixpkgs#elmPackages.elm-live -- src/Main.elm --start-page=index.html -- --debug --output=elm.js "$@"
|
||||
if [[ -z $(command -v nix) ]] && [[ -z $(command -v elm-live) ]]; then
|
||||
echo "Please install either 'nix' or 'elm-live'" && exit 1
|
||||
fi
|
||||
|
||||
command -v nix && nix run nixpkgs#elmPackages.elm-live -- src/Main.elm --start-page=index.html -- --debug --output=elm.js "$@"
|
||||
command -v elm-live && elm-live src/Main.elm --start-page=index.html -- --debug --output=elm.js "$@"
|
||||
|
@ -49,3 +49,15 @@
|
||||
top: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.result-link {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.result-title {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
"elm-version": "0.19.1",
|
||||
"dependencies": {
|
||||
"direct": {
|
||||
"Evelios/elm-hash": "1.0.0",
|
||||
"TSFoster/elm-bytes-extra": "1.3.0",
|
||||
"avh4/elm-color": "1.0.0",
|
||||
"cmditch/elm-bigint": "2.0.1",
|
||||
@ -32,6 +33,7 @@
|
||||
"ianmackenzie/elm-units": "2.10.0",
|
||||
"jasonliang-dev/elm-heroicons": "2.0.0",
|
||||
"jxxcarlson/hex": "4.0.0",
|
||||
"marcosh/elm-html-to-unicode": "1.0.4",
|
||||
"mdgriffith/elm-animator": "1.1.1",
|
||||
"mdgriffith/elm-ui": "1.1.8",
|
||||
"rtfeldman/elm-css": "18.0.0",
|
||||
@ -43,6 +45,8 @@
|
||||
"AdrianRibao/elm-derberos-date": "1.2.3",
|
||||
"NoRedInk/elm-string-conversions": "1.0.1",
|
||||
"bitsoflogic/elm-radixint": "2.0.0",
|
||||
"bonzaico/murmur3": "1.0.0",
|
||||
"chain-partners/elm-bignum": "1.0.1",
|
||||
"elm/file": "1.0.5",
|
||||
"elm/parser": "1.1.0",
|
||||
"elm/random": "1.0.0",
|
||||
@ -55,6 +59,7 @@
|
||||
"ianmackenzie/elm-interval": "3.1.0",
|
||||
"ianmackenzie/elm-units-interval": "3.2.0",
|
||||
"ktonon/elm-word": "2.1.2",
|
||||
"myrho/elm-round": "1.0.5",
|
||||
"robinheghan/murmur3": "1.0.0"
|
||||
}
|
||||
},
|
||||
|
@ -31,6 +31,10 @@ import Ur.Jam exposing (isSig)
|
||||
import Ur.Run
|
||||
import Ur.Sub
|
||||
import Ur.Types exposing (Noun(..))
|
||||
import Url
|
||||
import ElmEscapeHtml
|
||||
import Json.Encode
|
||||
import Hash
|
||||
|
||||
url : String
|
||||
url =
|
||||
@ -188,7 +192,18 @@ aboutView = row [ centerX, padding 10, spacing 10]
|
||||
, subtleLinkView "[Code]" "https://github.com/ilyakooo0/seax"
|
||||
]
|
||||
|
||||
|
||||
titleEmoji : String -> String
|
||||
titleEmoji title =
|
||||
let maxUnicode = 0x1F3F0
|
||||
minUnicode = 0x1F300
|
||||
in title |> Hash.fromString
|
||||
|> Hash.toString
|
||||
|> String.toInt
|
||||
|> Maybe.withDefault 0
|
||||
|> (\x -> ((modBy (maxUnicode - minUnicode) x) + minUnicode))
|
||||
|> Char.fromCode
|
||||
|> String.fromChar
|
||||
|> (\x -> x ++ " ")
|
||||
|
||||
|
||||
view : Model -> Element Msg
|
||||
@ -292,7 +307,7 @@ view model =
|
||||
|> Maybe.map Tuple.first
|
||||
|> Maybe.withDefault (Animator.init 0)
|
||||
)
|
||||
(\i -> toFloat i * 47 |> Animator.at)
|
||||
(\i -> toFloat i * 0 |> Animator.at)
|
||||
|> String.fromFloat
|
||||
)
|
||||
++ "px"
|
||||
@ -302,14 +317,26 @@ view model =
|
||||
, Html.Attributes.style "padding" "0.5em" |> htmlAttribute
|
||||
, Html.Attributes.class "result" |> htmlAttribute
|
||||
]
|
||||
[ text (stripTags title)
|
||||
|> el
|
||||
[ Font.size 16
|
||||
[ (Element.html
|
||||
(Html.a
|
||||
[ Html.Attributes.href link
|
||||
, Html.Attributes.class "result-title"
|
||||
, Html.Attributes.target "_blank"
|
||||
]
|
||||
[ Html.text
|
||||
(Maybe.withDefault ""
|
||||
(Url.percentDecode
|
||||
(ElmEscapeHtml.unescape
|
||||
(stripTags
|
||||
((titleEmoji title) ++ title)
|
||||
))))
|
||||
]
|
||||
)
|
||||
)
|
||||
, text link
|
||||
|> el
|
||||
[ Font.size 12
|
||||
, Font.color (rgb 0.7 0.7 0.7)
|
||||
[ Font.color (rgb 0.7 0.7 0.7)
|
||||
, Html.Attributes.class "result-link" |> htmlAttribute
|
||||
]
|
||||
]
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/- *seax
|
||||
/+ engines-yep, engines-crowdview, engines-wiby, engines-alexandria
|
||||
/+ engines-yep, engines-crowdview, engines-wiby, engines-alexandria, engines-urbit-dev
|
||||
|
||||
^- engines
|
||||
|
||||
@ -10,5 +10,6 @@
|
||||
[name=%crowdview engine=engines-crowdview weight=.2]
|
||||
[name=%wiby engine=engines-wiby weight=.2]
|
||||
[name=%alexandria engine=engines-alexandria weight=.2]
|
||||
[name=%urbit-dev engine=engines-urbit-dev weight=.2]
|
||||
==
|
||||
|
||||
|
29
zod/seax/lib/engines/urbit-dev.hoon
Normal file
29
zod/seax/lib/engines/urbit-dev.hoon
Normal file
@ -0,0 +1,29 @@
|
||||
/- *seax
|
||||
|
||||
^- engine
|
||||
=<
|
||||
|%
|
||||
++ url
|
||||
|= query=tape
|
||||
^- tape
|
||||
%+ weld
|
||||
"https://urbit.org/api/dev-search?q="
|
||||
(en-urlt:html query)
|
||||
++ results
|
||||
|= response=mime-data:iris
|
||||
^- (unit (list search-result))
|
||||
=/ body q.data.response
|
||||
;< jon=json _biff (de:json:html body)
|
||||
(apex jon)
|
||||
--
|
||||
::
|
||||
|%
|
||||
++ apex
|
||||
=, dejs-soft:format
|
||||
%- ot
|
||||
~[glossary+(ar parse-search-result)]
|
||||
++ parse-search-result
|
||||
=, dejs-soft:format
|
||||
%- ot
|
||||
~[[%'name' so] [%'url' so]]
|
||||
--
|
Loading…
Reference in New Issue
Block a user