Spaces:
Runtime error
Runtime error
more styling
Browse files- .gitignore +2 -1
- Makefile +1 -1
- client/src/components/NewsBlock.svelte +5 -5
- client/src/routes/index.svelte +6 -5
- client/static/test.json +0 -0
.gitignore
CHANGED
@@ -23,4 +23,5 @@ htmlcov/
|
|
23 |
.coverage
|
24 |
.coverage.*
|
25 |
*,cover
|
26 |
-
venv
|
|
|
|
23 |
.coverage
|
24 |
.coverage.*
|
25 |
*,cover
|
26 |
+
venv
|
27 |
+
last_predictions_cache.json
|
Makefile
CHANGED
@@ -3,7 +3,7 @@ install-node:
|
|
3 |
build-client:
|
4 |
cd client && npm install && npm run build && pwd && rm -r ../static && cp -r dist/ ../static/
|
5 |
build-client-dev:
|
6 |
-
cd client && npm install && NODE_ENV=development npm run build && pwd && rm -r ../static && cp -r dist/ ../static/
|
7 |
dev:
|
8 |
cd client && npm run dev
|
9 |
run:
|
|
|
3 |
build-client:
|
4 |
cd client && npm install && npm run build && pwd && rm -r ../static && cp -r dist/ ../static/
|
5 |
build-client-dev:
|
6 |
+
cd client && npm install && NODE_ENV=development npm run build && pwd && rm -r ../static/* && cp -r dist/ ../static/
|
7 |
dev:
|
8 |
cd client && npm run dev
|
9 |
run:
|
client/src/components/NewsBlock.svelte
CHANGED
@@ -7,14 +7,14 @@
|
|
7 |
{#if feedEntry.media_content}
|
8 |
<a target="_blank" href={feedEntry.link}>
|
9 |
<img
|
10 |
-
class="w-full object-cover
|
11 |
src={feedEntry.media_content[0].url}
|
12 |
alt={feedEntry.title}
|
13 |
/>
|
14 |
</a>
|
15 |
{/if}
|
16 |
</div>
|
17 |
-
<div class="col-span-2
|
18 |
<div class="text-sm">
|
19 |
Score:
|
20 |
<span class="font-bold {feedEntry.sentiment > 0 ? 'text-emerald-600' : 'text-red-600'}">
|
@@ -23,9 +23,9 @@
|
|
23 |
</div>
|
24 |
|
25 |
<a target="_blank" href={feedEntry.link}>
|
26 |
-
<h2 class="text-2xl font-bold font-serif">{feedEntry.title}</h2>
|
27 |
-
<h4 class="text-sm font-bold">By {feedEntry.author}</h4>
|
28 |
-
<p class="py-3">{feedEntry.summary}</p>
|
29 |
<!-- {#if feedEntry.tags}
|
30 |
<div class="text-sm">
|
31 |
{#each feedEntry.tags as tag}
|
|
|
7 |
{#if feedEntry.media_content}
|
8 |
<a target="_blank" href={feedEntry.link}>
|
9 |
<img
|
10 |
+
class="w-full max-w-xs object-cover object-top aspect-[4/3]"
|
11 |
src={feedEntry.media_content[0].url}
|
12 |
alt={feedEntry.title}
|
13 |
/>
|
14 |
</a>
|
15 |
{/if}
|
16 |
</div>
|
17 |
+
<div class="col-span-2 sm:pl-4">
|
18 |
<div class="text-sm">
|
19 |
Score:
|
20 |
<span class="font-bold {feedEntry.sentiment > 0 ? 'text-emerald-600' : 'text-red-600'}">
|
|
|
23 |
</div>
|
24 |
|
25 |
<a target="_blank" href={feedEntry.link}>
|
26 |
+
<h2 class="text-2xl font-bold font-serif leading-tight">{feedEntry.title}</h2>
|
27 |
+
<h4 class="text-sm font-bold leading-tight">By {feedEntry.author}</h4>
|
28 |
+
<p class="py-3 max-w-prose leading-normal">{feedEntry.summary}</p>
|
29 |
<!-- {#if feedEntry.tags}
|
30 |
<div class="text-sm">
|
31 |
{#each feedEntry.tags as tag}
|
client/src/routes/index.svelte
CHANGED
@@ -24,14 +24,14 @@
|
|
24 |
}
|
25 |
</script>
|
26 |
|
27 |
-
<div class="px-6 max-w-4xl mx-auto">
|
28 |
-
<h1 class="text-
|
29 |
|
30 |
<button
|
31 |
-
class="bg-blue-500 hover:bg-
|
32 |
on:click={toggleOrder}
|
33 |
>
|
34 |
-
|
35 |
</button>
|
36 |
|
37 |
{#await fecthPredictions()}
|
@@ -39,8 +39,9 @@
|
|
39 |
{:then data}
|
40 |
<ul>
|
41 |
{#each predictions as entry, i}
|
42 |
-
<li class="py-
|
43 |
<NewsBlock feedEntry={entry} />
|
|
|
44 |
</li>
|
45 |
{/each}
|
46 |
</ul>
|
|
|
24 |
}
|
25 |
</script>
|
26 |
|
27 |
+
<div class="px-6 py-3 max-w-4xl mx-auto">
|
28 |
+
<h1 class="text-4xl font-bold font-serif py-5 leading-tight">The New York Times Homepage</h1>
|
29 |
|
30 |
<button
|
31 |
+
class="{positiveOrder ? 'bg-emerald-600' :'bg-red-600'} bg-blue-500 hover:bg-zinc-300 text-white font-bold py-2 px-4 rounded"
|
32 |
on:click={toggleOrder}
|
33 |
>
|
34 |
+
{!positiveOrder ? 'Sorted by negative' : 'Sorted by positive'}
|
35 |
</button>
|
36 |
|
37 |
{#await fecthPredictions()}
|
|
|
39 |
{:then data}
|
40 |
<ul>
|
41 |
{#each predictions as entry, i}
|
42 |
+
<li class="py-5">
|
43 |
<NewsBlock feedEntry={entry} />
|
44 |
+
<div class="border-b border-gray-200 py-2"></div>
|
45 |
</li>
|
46 |
{/each}
|
47 |
</ul>
|
client/static/test.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|