Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
baris-inandi committed Nov 2, 2021
1 parent d99949f commit ba73d4b
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 27 deletions.
10 changes: 6 additions & 4 deletions src/lib/entity/EntityPage.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<script>
import EntityContentWrapper from './src/EntityContentWrapper.svelte';
export let entityAPIUrl = '';
console.log(entityAPIUrl);
// should generate a json output that will be passed to entity content wrapper
export let out = {};
import { queryContent } from '@lib/helpers/sanity.js';
let type = 'project';
let slug = 'the-istanbul-chronicle';
export let out = queryContent(
`*[_type == '${type}' && slug.current == '${slug}']`
);
</script>

<EntityContentWrapper entityJSON={out} />
10 changes: 9 additions & 1 deletion src/lib/entity/src/EntityContentWrapper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
import Preview from './Preview.svelte';
import Overview from './Overview.svelte';
import Jobs from './Jobs.svelte';
export let entityJSON = {};
export let entityJSON = new Promise();
async function _load() {
// SLUG: const url = `/blog/${page.params.slug}.json`;
const res = await entityJSON;
console.log(res);
return await res;
}
export const load = _load;
console.log(load)
</script>

<div
Expand Down
2 changes: 1 addition & 1 deletion src/lib/entity/src/Preview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ z-10 h-0 w-0 md:hidden
alt="Project Name comes here"
crossOrigin="anonymous"
style="
box-shadow: 0 20px 40px -12px rgba(0,0,0,.2);
box-shadow: 0 20px 20px -12px rgba(0,0,0,.12);
border-radius: 20%;
"
class="
Expand Down
3 changes: 2 additions & 1 deletion src/lib/header/src/ThemeBtn.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script>
<!-- <script>
import { onMount } from 'svelte';
function setTheme(themeName) {
onMount(() => {
Expand Down Expand Up @@ -26,3 +26,4 @@
</script>
<button on:click={toggleTheme()}>uwu</button>
-->
14 changes: 13 additions & 1 deletion src/lib/helpers/sanity.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,16 @@ export async function fetchSanityAPI(url) {
},
});
return response.json();
}
}

export async function queryContent(q) {
let query = encodeURIComponent(q)
let dataset = 'production'
let projectID = 'uzmzj3zh'
return await fetchSanityAPI(`
https://${projectID}.api.sanity.io/v1/data/query/${dataset}?query=${query}
`)
}

// TODO: use this method to fetch the required url:
// encodeURIComponent(str)
2 changes: 1 addition & 1 deletion src/lib/landing/Landing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Who from './src/Who.svelte';
import Projects from './src/Projects.svelte';
import Edu from './src/Edu.svelte';
import LandingFooter from './src/LandingFooter.svelte';
import LandingFooter from './src/footer/LandingFooter.svelte';
</script>

<Slogan />
Expand Down
17 changes: 0 additions & 17 deletions src/lib/landing/src/LandingFooter.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/landing/src/Who.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
dark:filter dark:contrast-125 dark:brightness-110 dark:-hue-rotate-15
"
>
<Blob2 w="900px" />
<Blob2 w="1000px" />
</div>
<div
class="
Expand Down
5 changes: 5 additions & 0 deletions src/lib/landing/src/footer/LandingFooter.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
import FooterContactCard from './src/FooterContactCard.svelte';
</script>

<FooterContactCard />
21 changes: 21 additions & 0 deletions src/lib/landing/src/footer/src/FooterContactCard.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script>
import LandingFooterSocialItem from './LandingFooterSocialItem.svelte';
</script>

<div
class="
bg-gray-500
"
>
<h2> Find us On: </h2>
<div>
<LandingFooterSocialItem
handle="@shape.ist"
href="https://www.instagram.com/shape.ist/"
/>
<LandingFooterSocialItem
handle="@shapeist"
href="https://linkedin.com/company/shapeist/"
/>
</div>
</div>
11 changes: 11 additions & 0 deletions src/lib/landing/src/footer/src/LandingFooterSocialItem.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script>
export let href = '';
export let handle = '';
</script>

<p>
icon
<a {href} target="_blank">
{handle}
</a>
</p>

0 comments on commit ba73d4b

Please sign in to comment.