File size: 2,023 Bytes
794cf6c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
101
102
103
104
105
106
107
108
109
<script lang="ts">
  import type { ConsoleMessage } from '../../stores/console';
  import { onMount } from 'svelte';
  import gsap from 'gsap';
  
  export let message: ConsoleMessage;
  
  let messageElement: HTMLDivElement;
  
  onMount(() => {
    gsap.fromTo(messageElement, 
      { opacity: 0, y: -5 },
      { opacity: 1, y: 0, duration: 0.3, ease: "power2.out" }
    );
  });
</script>

<div 
  bind:this={messageElement}
  class="console-line console-{message.type}"
>
  <span class="console-type">{message.type}</span>
  <span class="console-msg">{message.message}</span>
</div>

<style>
  .console-line {
    margin-bottom: 6px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s;
  }

  .console-line:hover {
    background: rgba(139, 115, 85, 0.02);
  }

  .console-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.5;
  }

  .console-type::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }

  .console-log .console-type::before {
    background: rgba(251, 248, 244, 0.5);
  }

  .console-warn .console-type::before {
    background: #D4A574;
  }

  .console-error .console-type::before {
    background: #B85450;
  }

  .console-info .console-type::before {
    background: #7C9885;
  }

  .console-msg {
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
    color: rgba(251, 248, 244, 0.8);
  }

  .console-log {
    color: rgba(251, 248, 244, 0.7);
  }

  .console-warn {
    background: rgba(212, 165, 116, 0.05);
  }

  .console-warn .console-msg {
    color: #D4A574;
  }

  .console-error {
    background: rgba(184, 84, 80, 0.05);
  }

  .console-error .console-msg {
    color: #B85450;
  }

  .console-info {
    background: rgba(124, 152, 133, 0.03);
  }

  .console-info .console-msg {
    color: #7C9885;
  }
</style>