diff --git a/cms/src/app.postcss b/cms/src/app.postcss index deaebf7..d00ac4a 100644 --- a/cms/src/app.postcss +++ b/cms/src/app.postcss @@ -95,4 +95,8 @@ ::-webkit-scrollbar-thumb:hover { background-color: #a8bbbf; } + + .display-none{ + display: none; + } } diff --git a/cms/src/lib/components/url.js b/cms/src/lib/components/url.js new file mode 100644 index 0000000..ce03a12 --- /dev/null +++ b/cms/src/lib/components/url.js @@ -0,0 +1,36 @@ +import { derived, writable } from 'svelte/store' + +export function createUrlStore(ssrUrl) { + // Ideally a bundler constant so that it's tree-shakable + if (typeof window === 'undefined') { + const { subscribe } = writable(ssrUrl) + return { subscribe } + } + + const href = writable(window.location.href) + + const originalPushState = history.pushState + const originalReplaceState = history.replaceState + + const updateHref = () => href.set(window.location.href) + + history.pushState = function () { + originalPushState.apply(this, arguments) + updateHref() + } + + history.replaceState = function () { + originalReplaceState.apply(this, arguments) + updateHref() + } + + window.addEventListener('popstate', updateHref) + window.addEventListener('hashchange', updateHref) + + return { + subscribe: derived(href, ($href) => new URL($href)).subscribe + } +} + +// If you're using in a pure SPA, you can return a store directly and share it everywhere +export default createUrlStore() diff --git a/cms/src/lib/data/competitive-exam.json b/cms/src/lib/data/competitive-exam.json index a51ddb6..5aa8870 100644 --- a/cms/src/lib/data/competitive-exam.json +++ b/cms/src/lib/data/competitive-exam.json @@ -11,6 +11,28 @@ "url":"/images/c1.jpg" } ], + "regi":[ + { + "title":"เจ้าพนักงานเภสัชกรรมปฏิบัติงาน", + "url":"/" + }, + { + "title":"เจ้าพนักงานทันตสาธารณสุขปฏิบัติงาน", + "url":"/" + }, + { + "title":"ผู้ช่วยทันตแพทย์ปฏิบัติงาน", + "url":"/" + }, + { + "title":"ดุริยางคศิลปินปฏิบัติงาน", + "url":"/" + }, + { + "title":"คีตศิลปินปฏิบัติงาน", + "url":"/" + } + ], "files":[ { "title":"รายละเอียดประกาศ", diff --git a/cms/src/routes/+page.svelte b/cms/src/routes/+page.svelte index 58de954..532c11a 100644 --- a/cms/src/routes/+page.svelte +++ b/cms/src/routes/+page.svelte @@ -83,7 +83,7 @@ >
- 1 + 1
@@ -121,7 +121,7 @@
- 1 + 1

@@ -156,7 +156,7 @@
- 1 + 1
@@ -213,7 +213,7 @@
- 1 + 1
@@ -252,7 +252,7 @@
- 1 + 1

@@ -287,7 +287,7 @@
- 1 + 1
@@ -360,4 +360,11 @@ .imgCard{ height: 210px; } +.fit{ + display: block; + height: 100%; + width: 100%; + object-fit: cover; + object-position: top; +} \ No newline at end of file diff --git a/cms/src/routes/competitive/[id]/+page.svelte b/cms/src/routes/competitive/[id]/+page.svelte index ed4a7d4..95c3752 100644 --- a/cms/src/routes/competitive/[id]/+page.svelte +++ b/cms/src/routes/competitive/[id]/+page.svelte @@ -39,12 +39,45 @@
{i.title}
{/each} {/if} + + {#if data.regi} +
สมัครสอบ
+ {#each data.regi as regi} +
+ +
+
+ + + สมัครสอบ + +
+ {regi.title} +
+
+
+ {/each} +
+ {/if} + {#if data.files} +
เอกสารประกอบ
{#each data.files as file} -
- +
+ + {/each} {/if}
diff --git a/cms/src/routes/qualifying/[id]/+page.svelte b/cms/src/routes/qualifying/[id]/+page.svelte index 2ef78e6..b0ab303 100644 --- a/cms/src/routes/qualifying/[id]/+page.svelte +++ b/cms/src/routes/qualifying/[id]/+page.svelte @@ -39,13 +39,44 @@
{i.title}
{/each} {/if} - + {#if data.regi} +
สมัครสอบ
+ {#each data.regi as regi} +
+ +
+
+ + + สมัครสอบ + +
+ {regi.title} +
+
+
+ {/each} +
+ {/if} + {#if data.files} +
เอกสารประกอบ
{#each data.files as file} -
- +
+ + {/each} {/if}