File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 2
2
import Fa from ' svelte-fa' ;
3
3
import { faWandMagic , faPlusCircle , faInfoCircle } from ' @fortawesome/free-solid-svg-icons'
4
4
import SideNav from " ./SideNav.svelte" ;
5
+ import { onMount } from ' svelte' ;
6
+
7
+ import { mainDiv } from ' ./stores' ;
8
+
9
+ // reference to the main application div
10
+ let main;
11
+ onMount (() => {
12
+ // set the mainDiv in stores to point to the main div, after it has been mounted
13
+ mainDiv .set (main );
14
+ });
5
15
6
16
</script >
7
17
8
18
<div class =" flex content-between flex-wrap min-h-full flex-grow" >
9
- <main class =" w-full p-6" >
19
+ <main class ="w-full p-6" bind:this ={ main } >
10
20
<div role =" alert" class =" w-full p-2 rounded-full bg-teal-light text-teal-darker text-lg" >
11
- <py-script auto-generate target =" page:mydiv" source =' ./mycode.py' >
12
- sum([1, 2, 3, 4, 5])
13
- </py-script >
14
21
</div >
15
22
</main >
16
23
17
24
<footer class =" w-full p-6 bg-black text-white flex space-between" >
18
25
<p class =" logo-title text-center" >PyScript</p >
19
- <p class =" w-full ml-6 text-center sm:text-left" >Copyright © 2019 </p >
26
+ <p class =" w-full ml-6 text-center sm:text-left" >Copyright © 2022 </p >
20
27
21
28
<aside class =" w-full sm:w-auto text-center sm:text-right" >
22
- <a href =" https://github .com/SlawomirChabowski " title =" My Github page " class =" text-white block" >
29
+ <a href =" https://pyscript .com" title =" PyScript " class =" text-white block" >
23
30
<Fa icon ={faInfoCircle } style =" transform: scale(2);" />
24
31
</a >
25
32
</aside >
You can’t perform that action at this time.
0 commit comments