File tree Expand file tree Collapse file tree 12 files changed +35
-22
lines changed
09-transitions/06-deferred-transitions
17-special-elements/00-svelte-self
20-7guis/06-7guis-circles
21-miscellaneous/02-immutable-data Expand file tree Collapse file tree 12 files changed +35
-22
lines changed Original file line number Diff line number Diff line change 77 }
88 </script >
99
10+ <!-- svelte-ignore a11y-no-static-element-interactions -->
1011<div on:mousemove ={handleMousemove }>
1112 The mouse position is {m .x } x {m .y }
1213</div >
Original file line number Diff line number Diff line change 22 let m = { x: 0 , y: 0 };
33 </script >
44
5+ <!-- svelte-ignore a11y-no-static-element-interactions -->
56<div on:mousemove ={(e ) => (m = { x: e .clientX , y: e .clientY })}>
67 The mouse position is {m .x } x {m .y }
78</div >
Original file line number Diff line number Diff line change 2424 </label >
2525</div >
2626
27+ <!-- svelte-ignore a11y-no-static-element-interactions -->
2728<svg
2829 on:mousemove ={(e ) => coords .set ({ x: e .clientX , y: e .clientY })}
2930 on:mousedown ={() => size .set (30 )}
Original file line number Diff line number Diff line change 4949 {#if selected }
5050 {#await selected then d }
5151 <div class ="photo" in:receive ={{ key : d .id }} out:send ={{ key : d .id }}>
52+ <!-- svelte-ignore a11y-click-events-have-key-events a11y-no-noninteractive-element-interactions -->
5253 <img alt ={d .alt } src =" {ASSETS }/ {d .id }.jpg" on:click ={() => (selected = null )} />
5354
5455 <p class =" credit" >
Original file line number Diff line number Diff line change 2828 {:else }
2929 <ul >
3030 {#each [... eases ] as [name]}
31- <li class:selected ={name === current_ease } on:click ={() => ( current_ease = name )} >
32- { name }
31+ <li class:selected ={name === current_ease }>
32+ < button on:click ={() => ( current_ease = name )}> { name }</ button >
3333 </li >
3434 {/each }
3535 </ul >
4646 {:else }
4747 <ul >
4848 {#each types as [name, type]}
49- <li class:selected ={type === current_type } on:click ={() => ( current_type = type )} >
50- { name }
49+ <li class:selected ={type === current_type }>
50+ < button on:click ={() => ( current_type = type )}> { name }</ button >
5151 </li >
5252 {/each }
5353 </ul >
Original file line number Diff line number Diff line change 1010 }
1111 </script >
1212
13+ <!-- svelte-ignore a11y-no-static-element-interactions -->
1314<div on:mouseenter ={enter } on:mouseleave ={leave }>
1415 <slot {hovering } />
1516</div >
Original file line number Diff line number Diff line change 66 $: if (dialog && showModal) dialog .showModal ();
77 </script >
88
9- <!-- svelte-ignore a11y-click-events-have-key-events -->
9+ <!-- svelte-ignore a11y-click-events-have-key-events a11y-no-noninteractive-element-interactions -->
1010<dialog
1111 bind:this ={dialog }
1212 on:close ={() => (showModal = false )}
1313 on:click |self ={() => dialog .close ()}
1414>
15+ <!-- svelte-ignore a11y-no-static-element-interactions -->
1516 <div on:click |stopPropagation >
1617 <slot name =" header" />
1718 <hr />
Original file line number Diff line number Diff line change 1111 }
1212 </script >
1313
14- <span class:expanded on:click ={toggle }>{name }</span >
14+ <button class:expanded on:click ={toggle }>{name }</button >
1515
1616{#if expanded }
1717 <ul transition:slide ={{ duration : 300 }}>
2828{/if }
2929
3030<style >
31- span {
31+ button {
3232 padding : 0 0 0 1.5em ;
3333 background : url (/tutorial/icons/folder.svg ) 0 0.1em no-repeat ;
3434 background-size : 1em 1em ;
3535 font-weight : bold ;
3636 cursor : pointer ;
37+ border :none ;
38+ font-size :14px ;
3739 }
3840
3941 .expanded {
Original file line number Diff line number Diff line change @@ -69,9 +69,10 @@ radius of the selected circle.
6969 <button on:click ={() => travel (- 1 )} disabled ={i === 0 }>undo</button >
7070 <button on:click ={() => travel (+ 1 )} disabled ={i === undoStack .length - 1 }>redo</button >
7171</div >
72-
72+ <!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
7373<svg on:click ={handleClick }>
7474 {#each circles as circle }
75+ <!-- svelte-ignore a11y-click-events-have-key-events -->
7576 <circle
7677 cx ={circle .cx }
7778 cy ={circle .cy }
Original file line number Diff line number Diff line change 2727
2828<h2 >Immutable</h2 >
2929{#each todos as todo }
30- <ImmutableTodo {todo } on:click ={() => toggle (todo .id )} />
30+ <ImmutableTodo {todo } on:click ={() => toggle (todo .id )} />< br >
3131{/each }
3232
3333<h2 >Mutable</h2 >
3434{#each todos as todo }
35- <MutableTodo {todo } on:click ={() => toggle (todo .id )} />
35+ <MutableTodo {todo } on:click ={() => toggle (todo .id )} />< br >
3636{/each }
You can’t perform that action at this time.
0 commit comments