Browse Source

move selection on hover

main
familyfriendlymikey 2 years ago
parent
commit
f9bcb02894
  1. 19
      app/client.imba
  2. 2
      package.json
  3. 2
      sw.imba

19
app/client.imba

@ -150,6 +150,7 @@ tag app
await db.put { name, link, frequency, last_opened, img }
def handle_input
selection_index = 0
sort_links!
def handle_click_delete link
@ -235,7 +236,6 @@ tag app
bd:1px solid purple4
w:100% h:50px ta:center fs:20px bg:none rd:5px
bc:purple4 outline:none c:blue3 caret-color:blue3 px:20px
transition:background 0.5s
@focus bg:purple4/10
@placeholder fs:10px c:blue3
@ -246,7 +246,7 @@ tag app
css .link
d:flex fld:row jc:space-between ai:center
px:15px py:10px rd:5px
px:15px py:10px rd:5px cursor:pointer
css .selected
bg:blue3/5
@ -275,15 +275,14 @@ tag app
css .delete
bd:1px solid purple4/50
transition:opacity 100ms
px:7px rd:3px fs:15px mr:15px
c:purple4 cursor:pointer o:0
css .link@hover .delete
css .selected .delete
o:100
css .link-left
d:flex fl:1 cursor:pointer
d:flex fl:1
css .link-right
d:flex
@ -333,12 +332,16 @@ tag app
if state.scored_links.length > 0
<.links>
for obj, index in state.scored_links
<.link .selected=(index == selection_index)>
<.link-left@click.prevent=handle_click_link(obj)>
<.link
@pointerover=(selection_index = index)
@click.prevent=handle_click_link(obj)
.selected=(index == selection_index)
>
<.link-left>
<img.link-icon height=20 width=20 src=obj.img>
<a href=obj.link> obj.name
<.link-right>
<.delete@click=handle_click_delete(obj)> "x"
<.delete@click.prevent.stop=handle_click_delete(obj)> "x"
<.frequency> obj.frequency
else
<.links>

2
package.json

@ -1,6 +1,6 @@
{
"name": "fuzzyhome",
"version": "0.0.27",
"version": "0.0.28",
"scripts": {
"start": "imba run -SMH --baseurl . -w server.imba",
"build-app": "imba build -SMH --baseurl . server.imba",

2
sw.imba

@ -1,7 +1,7 @@
let p = console.log
const app_prefix = "fuzzyhome_cache"
const version = "0.0.27"
const version = "0.0.28"
const cache_name = "{app_prefix}-{version}"

Loading…
Cancel
Save