kopia lustrzana https://github.com/learn-awesome/learndb
Fix #16 Embed wii articles, misc
rodzic
6ea5731bde
commit
4011bdaf60
3064
db/items.csv
3064
db/items.csv
Plik diff jest za duży
Load Diff
|
@ -2948,7 +2948,7 @@ programming-languages/rust,programming-languages/rust,https://images.unsplash.co
|
|||
mobile-app-development,mobile-app-development,https://images.unsplash.com/photo-1557804483-ef3ae78eca57?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,programming
|
||||
time-management,time-management,https://images.unsplash.com/photo-1563371386-187140095137?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,personal-development
|
||||
relationships,relationships,https://images.unsplash.com/photo-1504447660567-77a0a12ebb75?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,personal-development
|
||||
programming-languages,programming-languages,https://images.unsplash.com/photo-1489389944381-3471b5b30f04?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,,2
|
||||
programming-languages,Programming Languages,https://images.unsplash.com/photo-1489389944381-3471b5b30f04?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,,2
|
||||
programming-languages/c++,programming-languages/c++,https://images.unsplash.com/photo-1484417894907-623942c8ee29?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,programming-languages
|
||||
information-overload,information-overload,https://images.unsplash.com/photo-1564760290292-23341e4df6ec?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,
|
||||
programming-languages/haskell,programming-languages/haskell,https://images.unsplash.com/photo-1503676593575-d732ab11be71?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=300&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400,programming-languages
|
||||
|
|
Nie można wyświetlić tego pliku, ponieważ jest on zbyt duży.
|
BIN
learn.db
BIN
learn.db
Plik binarny nie jest wyświetlany.
|
@ -12,7 +12,7 @@
|
|||
import ItemDetail from "./ItemDetail.svelte"
|
||||
import AdvancedSearch from "./AdvancedSearch.svelte"
|
||||
import NavButtonWithLabel from './NavButtonWithLabel.svelte';
|
||||
import { SearchIcon, LibraryIcon, ViewGridIcon, GiftIcon, CogIcon, BookmarkAltIcon, BookmarkIcon } from "@rgossiaux/svelte-heroicons/outline";
|
||||
import { SearchIcon, LibraryIcon, ViewGridIcon, GiftIcon, CogIcon, BookmarkAltIcon, BookmarkIcon, SupportIcon } from "@rgossiaux/svelte-heroicons/outline";
|
||||
import Bookmarks from './Bookmarks.svelte';
|
||||
|
||||
let currentView = "/topics";
|
||||
|
@ -124,5 +124,9 @@
|
|||
<BookmarkAltIcon class=" flex-shrink-0 h-6 w-6"/>
|
||||
</NavButtonWithLabel>
|
||||
|
||||
<NavButtonWithLabel target="https://github.com/learn-awesome/learndb" label="Contribute">
|
||||
<SupportIcon class=" flex-shrink-0 h-6 w-6"/>
|
||||
</NavButtonWithLabel>
|
||||
|
||||
</svelte:fragment>
|
||||
</TailwindUI.AppShell>
|
|
@ -2,11 +2,15 @@
|
|||
export let item;
|
||||
</script>
|
||||
|
||||
<a class="relative flex flex-col w-44 items-center mb-4 rounded-md overflow-hidden transform transition ease-out duration-300 hover:bg-lightSecondary2 hover:shadow-xl break-inside-avoid dark:bg-darkSecondaryBg dark:text-darkSecondary2" href="#/item/{item.rowid}">
|
||||
<a class="relative flex flex-col w-44 items-center mb-4 rounded-md overflow-hidden transform transition ease-out duration-300 hover:bg-lightSecondary2 drop-shadow-lg hover:drop-shadow-2xl hover:scale-105 break-inside-avoid dark:bg-darkSecondaryBg dark:text-darkSecondary2" href="#/item/{item.rowid}">
|
||||
<img class="object-cover h-64 w-44" src={item.image || '/static/book-cover.png'} alt="{item.name}"/>
|
||||
|
||||
{#if item.rating}
|
||||
<h1 class="text-lg font-semibold p-2 text-white tracking-wider">
|
||||
<sl-rating readonly precision="0.1" value={item.rating}></sl-rating>
|
||||
</h1>
|
||||
{/if}
|
||||
|
||||
{#if !item.image}
|
||||
<div class="absolute inset-y-0 px-2 py-4 break-inside-avoid">
|
||||
<p class="font-extrabold text-white text-xl">{item.name}</p>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<script>
|
||||
import ItemCard from "./ItemCard.svelte"
|
||||
import SearchForm from "./SearchForm.svelte"
|
||||
import { formats } from "./formats.js"
|
||||
import { fix_and_destroy_block } from "svelte/internal";
|
||||
|
||||
export let format;
|
||||
export let alltopics;
|
||||
|
@ -41,7 +43,7 @@
|
|||
|
||||
<div class="md:flex md:items-center md:justify-between mb-8">
|
||||
<div class="flex-1 min-w-0">
|
||||
<h2 class="text-2xl font-bold leading-7 text-lightSecondary2 sm:text-3xl sm:truncate"> {format.toUpperCase()+"s".toUpperCase()}</h2>
|
||||
<h2 class="text-2xl font-bold leading-7 text-lightSecondary2 sm:text-3xl sm:truncate"> {formats.find((f) => f.id === format).name}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
</script>
|
||||
|
||||
<h1 class="my-2">Explore the different formats</h1>
|
||||
<div class=" mx-auto flex flex-wrap gap-5 justify-center items-center">
|
||||
{#each formats as format}
|
||||
<a href="#/format/{format.id}" class="w-64 flex flex-col rounded-lg shadow-md overflow-hidden transform transition ease-out duration-300 hover:scale-105 bg-lightPrimCont text-lightPrimary dark:bg-darkPrimCont dark:text-darkPrimary">
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<rect x="118" width="404" height="784" fill="url(#4f4f415c-a0e9-44c2-9601-6ded5a34a13e)" />
|
||||
</svg>
|
||||
<div class="relative mx-auto w-full rounded-lg shadow-lg lg:max-w-md">
|
||||
<button type="button" class="relative block w-full bg-white rounded-lg overflow-hidden focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
<!-- <button type="button" class="relative block w-full bg-white rounded-lg overflow-hidden focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
<span class="sr-only">Watch our video to learn more</span>
|
||||
<img class="w-full" src="https://images.unsplash.com/photo-1556740758-90de374c12ad?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80" alt="">
|
||||
<div class="absolute inset-0 w-full h-full flex items-center justify-center" aria-hidden="true">
|
||||
|
@ -36,7 +36,7 @@
|
|||
<path d="M55.5039 40.3359L37.1094 28.0729C35.7803 27.1869 34 28.1396 34 29.737V54.263C34 55.8604 35.7803 56.8131 37.1094 55.9271L55.5038 43.6641C56.6913 42.8725 56.6913 41.1275 55.5039 40.3359Z" />
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
return thumbnail_image_url
|
||||
}
|
||||
|
||||
function get_tld(url){
|
||||
return (new URL(url)).hostname.replace('www.','');
|
||||
}
|
||||
|
||||
$: fetch(`/learn/items/${itemid}.json?_shape=object`)
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
|
@ -43,7 +47,10 @@
|
|||
bookmarks.set(newobj)
|
||||
}
|
||||
|
||||
|
||||
function wikiUrlForEmbed(item){
|
||||
var wikiurl = item.links.split(";").find((l) => l.includes('wiki|')).split('|')[1];
|
||||
return wikiurl.replace('simple.wikipedia.org/','simple.m.wikipedia.org/').replace('en.wikipedia.org/','en.m.wikipedia.org/');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -108,7 +115,7 @@
|
|||
<div class="flex w-full flex-col justify-between">
|
||||
<!-- title, sub title, author -->
|
||||
<section>
|
||||
<h1 class="text-2xl">{item.name}</h1>
|
||||
<h1 class="text-4xl font-extrabold">{item.name}</h1>
|
||||
<span class="text-sm mt-5">{item.creators}</span>
|
||||
<div class="mt-5">
|
||||
<sl-rating readonly precision="0.1" value={item.rating}></sl-rating>
|
||||
|
@ -118,7 +125,7 @@
|
|||
<div class="mt-2 mb-6 flex flex-col justify-between">
|
||||
<div class="flex items-center justify-start gap-3 mt-5">
|
||||
{#each item.links.split(";") as type}
|
||||
<a href={type.split("|")[1]} class="inline-flex items-center px-3 py-1 rounded-lg text-xs font-medium border drop-shadow-lg" target="_blank"> {type.split("|")[0]}
|
||||
<a href={type.split("|")[1]} class="inline-flex items-center px-3 py-1 rounded-lg text-xs font-medium border drop-shadow-lg" target="_blank"> {type.split("|")[0]} at {get_tld(type.split("|")[1])}
|
||||
<span class="ml-0.5 h-4 w-4"><Icon kind="link"/></span>
|
||||
</a>
|
||||
{/each}
|
||||
|
@ -206,8 +213,8 @@
|
|||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- review -->
|
||||
{#if reviews}
|
||||
<!-- reviews -->
|
||||
{#if reviews.length > 0}
|
||||
<section class="my-8">
|
||||
<div class="flex justify-between items-center">
|
||||
<h2 class="text-base font-bold text-gray-100">Reviews</h2>
|
||||
|
@ -221,6 +228,10 @@
|
|||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if item.links.includes('wiki|')}
|
||||
<iframe src={wikiUrlForEmbed(item)} class="w-full h-[48rem]" title="embedded wiki"></iframe>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</script>
|
||||
|
||||
|
||||
<a href={target} class={(isActive ? 'bg-lightPrimCont text-lightPrimary dark:bg-darkPrimCont dark:text-darkPrimary' : '') + " text-lightSecondary1 w-full hover:bg-lightSecondary1 hover:dark:text-darkSecondary2 hover:dark:bg-darkPrimaryBg hover:text-lightSecondary2 group flex justify-start gap-3 items-center py-5 pl-4 text-sm font-medium"}>
|
||||
<a href={target} target={target.startsWith('http') ? '_blank' : ''} class={(isActive ? 'bg-lightPrimCont text-lightPrimary dark:bg-darkPrimCont dark:text-darkPrimary' : '') + " text-lightSecondary1 w-full hover:bg-lightSecondary1 hover:dark:text-darkSecondary2 hover:dark:bg-darkPrimaryBg hover:text-lightSecondary2 group flex justify-start gap-3 items-center py-5 pl-4 text-sm font-medium"}>
|
||||
<slot></slot>
|
||||
|
||||
<h3 class="text-center"> {label}</h3>
|
||||
|
|
|
@ -72,12 +72,12 @@
|
|||
{#if topic}
|
||||
{#if topic.parent_id}
|
||||
<sl-breadcrumb-item href={"#/topic/" + topic.parent_id}>
|
||||
{capitalize(topic.parent_id)}
|
||||
{capitalize(topic.parent_id.replace('-',' '))}
|
||||
</sl-breadcrumb-item>
|
||||
{/if}
|
||||
{#if topic.display_name}
|
||||
<sl-breadcrumb-item href={"#/topic/" + topic.name}>
|
||||
{capitalize(topic.display_name)}
|
||||
{capitalize(topic.display_name.split('/').reverse()[0])}
|
||||
</sl-breadcrumb-item>
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
Ładowanie…
Reference in New Issue