on master help sign in
.
commit87c1f6b60bf4473b8e97576bdda08337f3622006 authoriko <mail@iko.soy> dateFri 25 Aug 2023, 15:16 (3 years ago) parent983ad42
3 files changed+17−79
frontend/index.html+6−10 frontend/src/Main.elm+9−61 zod/seax/app/seax.hoon+2−8
frontend/index.html+6−10
@@ -7,26 +7,22 @@
77 body {
88 margin: 0;
99 }
10− @keyframes bobbing {
10+ @keyframes shimmer {
1111 from {
12− transform: translateY(-30px);
12+ color: rgb(204, 204, 204)
1313 }
1414 to {
15− transform: traslateY(0);
15+ color: rgb(50, 50, 50)
1616 }
1717 }
1818
19− .bobbing {
20− animation-duration: 2s;
21− animation-name: bobbing;
19+ .shimmer {
20+ animation-duration: 0.6s;
21+ animation-name: shimmer;
2222 animation-iteration-count: infinite;
2323 animation-direction: alternate;
2424 animation-timing-function: ease-in-out;
2525 }
26−
27− .hidden-engine {
28− transition: max-width 1s ease-out, top 1s ease-out, margin-left 1s ease-out;
29− }
3026 </style>
3127 </head>
3228 <body>
frontend/src/Main.elm+9−61
@@ -149,42 +149,6 @@ main =
149149 }
150150
151151
152−debug : (String -> String) -> D.Deconstructor a -> D.Deconstructor a
153−debug log f noun =
154− case f noun of
155− Just x ->
156− Just x
157−
158− Nothing ->
159− let
160− _ =
161− log (prettyNoun noun)
162− in
163− Nothing
164−
165−
166−prettyNoun : Noun -> String
167−prettyNoun noun =
168− let
169− go isRhs n =
170− case n of
171− Atom a ->
172− if isSig a then
173− "~"
174−
175− else
176− "@"
177−
178− Cell ( lhs, rhs ) ->
179− if isRhs then
180− go False lhs ++ " " ++ go True rhs
181−
182− else
183− "[" ++ go False lhs ++ " " ++ go True rhs ++ "]"
184− in
185− go False noun
186−
187−
188152view : Model -> Element Msg
189153view model =
190154 case model.initiatedSearch of
@@ -194,22 +158,18 @@ view model =
194158 , searchView model
195159 ]
196160
197− Just query ->
161+ Just _ ->
198162 column [ width fill, spacing 16 ]
199163 [ row [ spacing 16, width fill ]
200164 [ searchView model |> el [ padding 8 ]
201165 , model.engines
166+ |> List.filter (\( _, state ) -> state /= Failed)
202167 |> List.map
203168 (\( name, state ) ->
204− ( name
205− , text ("%" ++ name)
169+ text ("%" ++ name)
206170 |> el
207− ([ Font.size 43
171+ ([ Font.size 16
208172 , Font.bold
209− , Html.Attributes.style "max-width" "300px"
210− |> htmlAttribute
211−
212− -- , clip
213173 ]
214174 ++ (if Set.isEmpty model.selectedEngines then
215175 []
@@ -223,8 +183,7 @@ view model =
223183 )
224184 ++ (case state of
225185 Loading ->
226− [ Html.Attributes.class "bobbing" |> htmlAttribute
227− , Font.color (rgb 0.8 0.8 0.8)
186+ [ Html.Attributes.class "shimmer" |> htmlAttribute
228187 ]
229188
230189 Completed ->
@@ -236,25 +195,14 @@ view model =
236195 ]
237196
238197 Failed ->
239− [ Html.Attributes.class "hidden-engine" |> htmlAttribute
240− , Html.Attributes.style "max-width" "0px" |> htmlAttribute
241− , Html.Attributes.style "top" "-100px"
242− |> htmlAttribute
243− , Html.Attributes.style "margin" "0"
244− |> htmlAttribute
245− , Font.color (rgb 0.8 0.8 0.8)
246− , Html.Attributes.class "bobbing" |> htmlAttribute
247− ]
198+ []
248199 )
249200 )
250− )
251201 )
252− |> Keyed.row
253− [ spacing 16
254− , clipX
255− , scrollbarX
202+ |> wrappedRow
203+ [ spacing 8
256204 , width fill
257− , height (px 62)
205+ , padding 16
258206 ]
259207 ]
260208 , Keyed.column [ width fill, padding 8 ]
zod/seax/app/seax.hoon+2−8
@@ -16,11 +16,9 @@ $:
1616==
1717+$ poke
1818 $%
19− :: [%search query=tape]
2019 [%liveness-check ~]
20+ [%gossip ~]
2121 [%add-peers (set @p)]
22− :: [%ping ~]
23− :: [%pong ~]
2422 ==
2523++ rank-results
2624 |= search-results=(map term (unit (list search-result)))
@@ -59,7 +57,7 @@ $:
5957 (~(get by search-results:(~(got by search-subscriptions.state) query)) engine)
6058 ?~ results %loading
6159 ?~ +.results %failed
62− ?~ +.+.results %failed
60+ ?~ +>.results %failed
6361 %completed
6462=* search-results
6563 |= =query
@@ -101,10 +99,6 @@ $:
10199 `this(peers.state (~(uni in peers.state) +.poke))
102100 ==
103101
104− :: %ping
105−
106−
107−
108102++ on-watch
109103 |= =path
110104 ?+ path !!