aboutsummaryrefslogtreecommitdiffstats
path: root/apidoc/utils
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-06 08:51:42 -0700
committerAdam Soltys <[email protected]>2021-08-06 08:51:42 -0700
commit262e4bb11fedf1215bef58a7e472920e808a2d7e (patch)
tree6e872825949b30baf1eead35606269d31b55b18e /apidoc/utils
parent9b03ed9abead5d8d254fe537a8e003c6e468f63d (diff)
downloadcoinos-server-262e4bb11fedf1215bef58a7e472920e808a2d7e.tar.gz
coinos-server-262e4bb11fedf1215bef58a7e472920e808a2d7e.zip
alpine docker base
Diffstat (limited to 'apidoc/utils')
0 files changed, 0 insertions, 0 deletions
s-ui.git/blame/src/components/AppHeader.svelte?h=ark&id=7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833'>^
38ba5cb6 ^
6f3ca148 ^
216a6002 ^

2bca310a ^
32fcc461 ^
59b74034 ^
32fcc461 ^
0566cfe4 ^
3be85cc5 ^
9b7c3216 ^

216a6002 ^

002cd913 ^


9b7c3216 ^

84815786 ^
efc288bc ^
6f3ca148 ^
11498a74 ^
6f3ca148 ^
f99bd15f ^
6f3ca148 ^

11498a74 ^
6f3ca148 ^

f99bd15f ^
6f3ca148 ^



f99bd15f ^
6f3ca148 ^



f99bd15f ^
6f3ca148 ^
efc288bc ^
45c120aa ^
32fcc461 ^
6f3ca148 ^

9b7c3216 ^

7d6019ab ^

6f3ca148 ^

b466b3d3 ^
216a6002 ^
6f3ca148 ^
216a6002 ^



f99bd15f ^

6f3ca148 ^
9b7c3216 ^

216a6002 ^
6f3ca148 ^

0035b7e8 ^
216a6002 ^

674de46a ^
216a6002 ^


3be85cc5 ^






216a6002 ^
b466b3d3 ^
2bca310a ^

6f3ca148 ^



216a6002 ^
fdef64da ^
216a6002 ^

2bca310a ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
        
                                      
 
                                                         
                                         
                                           
                                       

                                                 
 
                                                 
 
                   
                                             
 

                                            

                             


                                                     

                    
 
                          
     
                                 
                            
                    

      
                                         

                                 
                       



                            
                        



                                        
                    
      
     
 
                                  

                               

                                        

         

                                     
               
         
                                                                                          



                                                             

                                                                           
                                                     

                                                                   
                     

               
                                            

                                                          
                                                                       


            






                                                                                                                          
           
     

       



                                                                                                                  
          
                

                                 
        
<script>
  import { run } from "svelte/legacy";

  import { banner, theme, newPayment } from "$lib/store";
  import { goto } from "$app/navigation";
  import Avatar from "$comp/Avatar.svelte";
  import Menu from "$comp/Menu.svelte";
  import { loading, t } from "$lib/translations";
  import { page } from "$app/stores";

  let { user, subject = $bindable() } = $props();

  let w = $state();
  $effect(() => (subject = subject || user));

  let bg = $derived(
    $banner?.id && $banner.id === subject.id
      ? `url(${$banner.src})`
      : subject?.banner
        ? subject.banner.includes(":")
          ? `url(${subject.banner})`
          : `url(/api/public/${subject.banner}.webp)`
        : undefined,
  );

  const links = $derived([
    {
      href: `/${user?.username}`,
      icon: "ph:house-bold",
      label: "Home",
    },
    {
      href: `/${user?.username}/receive`,
      icon: "ph:hand-coins-bold",
      flip: "horizontal",
      label: "Receive",
    },
    {
      href: `/payments`,
      icon: "ph:clock-bold",
      label: "Payments",
    },
    {
      href: `/send`,
      icon: "ph:paper-plane-right-bold",
      label: "Send",
    },
  ]);

  let opacity = $derived((href) =>
    $page.url.pathname === href
      ? "opacity-100"
      : "opacity-90 hover:opacity-none",
  );
</script>

<svelte:window bind:innerWidth={w} />

{#if !$loading}
  <header
    class="bg-gradient-to-r bg-primary bg-accent h-[175px] w-full relative bg-cover mb-20"
    style:background-image={bg}
  >
    <nav class="flex justify-end items-center space-x-4 p-5">
      {#if user}
        {#each links as { href, icon, flip, label }}
          <a {href} data-sveltekit-preload-code="eager" aria-label={label}>
            <button class="btn-menu {opacity(href)}">
              <iconify-icon {icon} width={w > 640 ? 32 : 24} {flip}
              ></iconify-icon>
            </button>
          </a>
        {/each}
        <Menu {opacity} {user} t={$t} {w} />
      {:else}
        <a href={`/login?redirect=${$page.url.pathname}`}>
          <button class="btn !rounded-full">{$t("nav.signIn")}</button>
        </a>
      {/if}
    </nav>
    {#if subject}
      <div
        class="absolute md:w-[64px] md:mx-auto lg:left-[154px] xl:left-[194px] left-[calc(50vw-64px)] -bottom-[64px] z-30"
      >
        <Avatar user={subject} />
      </div>
    {/if}
  </header>
{/if}

<style>
  .btn-menu {
    @apply flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl;
  }

  header {
    z-index: 50;
    view-transition-name: header;
  }
</style>