Skip to content

Commit c3a35b2

Browse files
authored
Merge pull request #6 from pumpi/design
Design changes for frontend
2 parents a0c7a05 + c4d73c6 commit c3a35b2

File tree

6 files changed

+141
-16
lines changed

6 files changed

+141
-16
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "rollup -c -w",
77
"start": "sirv public",
88
"prettier": "prettier --write --plugin-search-dir=. \"./**/*.{svelte,html,js}\"",
9-
"prettier-check": "prettier --check --plugin-search-dir=. \"./**/*.{svelte,html,js}\""
9+
"prettier-check": "prettier --check --plugin-search-dir=. \"./**/*.{svelte,html,js}\"",
10+
"send-sample-output": "curl -X POST \"localhost:9009/client\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -H \"pd-id: d23db8dd-f46c-44bb-a88d-f29442a77879\" --data-binary @test-table.json && curl -X POST \"localhost:9009/client\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -H \"pd-id: d23db8dd-f46c-44bb-a88d-f29442a77879\" --data-binary @test-html.json && curl -X POST \"localhost:9009/client\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -H \"pd-id: d23db8dd-f46c-44bb-a88d-f29442a77879\" --data-binary @test-pause.json"
1011
},
1112
"devDependencies": {
1213
"@rollup/plugin-commonjs": "^16.0.0",

src/App.svelte

Lines changed: 92 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,67 @@
11
<style type="text/css">
2+
.header {
3+
background: rgba(255,255,255,.1);
4+
position: sticky;
5+
top: 0;
6+
padding: 20px;
7+
display: flex;
8+
align-items: flex-end;
9+
}
10+
11+
.logo {
12+
font-size: 40px;
13+
font-family: monospace;
14+
padding-right: 40px;
15+
}
16+
217
.tags span {
318
display: inline-block;
4-
padding: 10px;
5-
margin-right: 15px;
19+
padding: 2px 10px;
20+
margin: 10px 15px 0 0;
21+
background: rgba(255,255,255,.1);
22+
border-radius: 3px;
23+
cursor: pointer;
24+
line-height: 1.2;
625
}
726
827
.tags .active {
928
background: #18171b;
1029
}
30+
31+
:global(.btn) {
32+
display: inline-block;
33+
font-weight: 400;
34+
text-align: center;
35+
white-space: nowrap;
36+
vertical-align: middle;
37+
-webkit-user-select: none;
38+
-moz-user-select: none;
39+
-ms-user-select: none;
40+
user-select: none;
41+
border: 1px solid #28a745;
42+
padding: .2rem .9rem;
43+
font-size: 1rem;
44+
line-height: 1.5;
45+
border-radius: .25rem;
46+
transition: background .15s;
47+
background-color: #28a745;
48+
color: #FFF;
49+
cursor: pointer;
50+
}
51+
52+
:global(.btn:hover) {
53+
background: #116625;
54+
}
55+
56+
.blink {
57+
animation: blinker 1s step-start infinite;
58+
}
59+
60+
@keyframes blinker {
61+
50% {
62+
opacity: 0;
63+
}
64+
}
1165
</style>
1266

1367
<script>
@@ -61,16 +115,47 @@
61115
$: tags = [...$tagStore];
62116
</script>
63117

118+
<svelte:head>
119+
<style>
120+
/* could also be handled via the theme, but we leave that static for now */
121+
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap");
122+
/* all css that we need is a global reset sheet */
123+
html, body {
124+
margin: 0;
125+
padding: 0;
126+
font-family: 'Open Sans', sans-serif;
127+
font-size: 16px;
128+
}
129+
* {
130+
margin: 0;
131+
padding: 0;
132+
color: inherit;
133+
text-decoration: none;
134+
}
135+
136+
a:hover,
137+
a:visited,
138+
a:active {
139+
text-decoration: none;
140+
}
141+
</style>
142+
</svelte:head>
143+
64144
<main>
65-
<div class="tags">
66-
{#each tags as tag}
145+
<div class="header">
146+
<div class="logo">
147+
[pd<span class="blink">_</span>]
148+
</div>
149+
<div class="tags">
150+
{#each tags as tag}
67151
<span
68-
class="{$activeTagStore.has(tag) ? 'active' : ''}"
69-
on:click="{switchTagStatus(tag)}"
152+
class="{$activeTagStore.has(tag) ? 'active' : ''}"
153+
on:click="{switchTagStatus(tag)}"
70154
>
71155
{tag}
72156
</span>
73-
{/each}
157+
{/each}
158+
</div>
74159
</div>
75160

76161
{#each displayMessages as message}

src/Elements/PauseElement.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
</script>
1414

1515
{#if message.resumed === undefined}
16-
<button on:click="{resumeExecution}">Resume</button>
16+
<button class="btn" on:click="{resumeExecution}">Resume</button>
1717
{/if}

src/Elements/TableElement.svelte

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1+
<style type="text/css">
2+
table {
3+
width: 100%;
4+
border: unset;
5+
border-collapse: collapse;
6+
}
7+
thead {
8+
background: #222;
9+
}
10+
th {
11+
text-align: left;
12+
}
13+
th, td {
14+
padding: 10px 15px;
15+
}
16+
tr:nth-child(odd) {
17+
background: rgba(255,255,255,.03);
18+
}
19+
</style>
20+
121
<script>
222
export let content;
323
</script>
424

525
<table>
626
{#if content['headers']}
7-
{#each content['headers'] as header}
8-
<th>{header}</th>
9-
{/each}
27+
<thead>
28+
{#each content['headers'] as header}
29+
<th>{header}</th>
30+
{/each}
31+
</thead>
1032
{/if}
1133

1234
{#each content['rows'] as row}

src/FormattedTimestamp.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<style type="text/css">
2+
.time {
3+
font-family: monospace;
4+
}
5+
</style>
6+
17
<script>
28
export let unixTimestamp;
39

src/Message.svelte

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
.message {
33
display: flex;
44
flex-flow: row wrap;
5-
padding: 20px;
6-
margin: 20px;
7-
background: #121212;
5+
padding: 30px 20px;
6+
margin: 0 20px;
7+
border-bottom: 1px solid #393939;
88
}
99
1010
.information {
@@ -16,12 +16,23 @@
1616
}
1717
1818
.origin {
19-
width: 100%;
19+
padding-left: 10%;
20+
margin-top: 15px;
21+
font-family: monospace;
2022
}
2123
2224
.element {
2325
margin-bottom: 10px;
2426
}
27+
28+
.tags span {
29+
display: inline-block;
30+
padding: 2px 10px;
31+
margin: 10px 15px 0 0;
32+
background: rgba(255,255,255,.1);
33+
border-radius: 3px;
34+
line-height: 1.2
35+
}
2536
</style>
2637

2738
<script>

0 commit comments

Comments
 (0)