@@ -340,7 +340,7 @@ class Commands {
340
340
return `<div class="flex" >
341
341
<img src="${ ilse . require ( command . icon ) } " style="width: 20px;" />
342
342
<p data-command-id="${ command . id } " > ${ command . name } </p>
343
- <p style="position: absolute; right: 0px; color: var( --background-color ); background: var( --text-color ); padding: 3px; border-radius: 4px; min-width: 30px; min-height: 30px; "> ${ get_command_by_keyboard_shortcut ( command . id ) } </p>
343
+ <p style="position: absolute; right: 0px; color: var( --primary ); background: var( --secondary ); padding: 3px; border-radius: 4px; min-width: 30px; min-height: 30px; "> ${ get_command_by_keyboard_shortcut ( command . id ) } </p>
344
344
</div>`
345
345
}
346
346
@@ -713,13 +713,32 @@ class Commands {
713
713
icon : "dice-3.svg" ,
714
714
fn : async function ( ) {
715
715
716
- let list = ilse . notes . query_regexp ( / ( \. p n g | \. j p g | \. g i f ) / )
717
- let random_list = get_random_array_elements ( list , 10 )
718
- let normalized_list = random_list . map ( item => { return `<div @click="navigator.clipboard.writeText('${ item } '); api.notify('Copied!', 'Copied: ' + '${ item } ' + ' To your clipboard' ); " >
716
+ // let list = ilse.notes.query_regexp( /(\.png|\.jpg|\.gif)/ ) // query imgs
717
+ // let random_list = get_random_array_elements( list, 5 ) // get random set of them
718
+
719
+ /* let normalized_list = random_list.map( item => { return `<div @click ="navigator.clipboard.writeText('${item}'); api.notify('Copied!', 'Copied: ' + '${item}' + ' To your clipboard' ); " >
719
720
<span x-html="api.markdown(api.notes.list['${item}'].content)" > </span>
720
721
</div>`
722
+ }) */
723
+
724
+ let html = `<div x-data="{ pointer: 0 }" style="width: 80vw !important; height: 80vh !important; overflow: hidden; " >
725
+
726
+ <div style="display: flex;" style="width: 100px; margin: 0 auto;" >
727
+ <img :src="api.require('arrow-narrow-left.svg')" style="width: 40px;" @click="pointer -= 1" />
728
+ <img :src="api.require('arrow-narrow-right.svg')" style="width: 40px;" @click="pointer += 1" />
729
+ </div>
730
+
731
+ <template x-for="(item, index) in api.utils.get_random_array_elements(api.notes.query_regexp( /(\.png|\.jpg|\.gif)/ ), 10 )" :key="index" >
732
+ <span x-show="pointer === index" x-html="api.markdown(api.notes.list[item].content)" > </span>
733
+ </template>
734
+
735
+ </div>`
736
+
737
+ await ilse . commands . run ( "box" , {
738
+ html : html ,
721
739
} )
722
740
741
+ /*
723
742
await ilse.commands.run( "html-list", {
724
743
search: "",
725
744
list: normalized_list,
@@ -739,6 +758,7 @@ class Commands {
739
758
740
759
},
741
760
})
761
+ */
742
762
743
763
744
764
} ,
0 commit comments