Skip to content

Commit

Permalink
User updating
Browse files Browse the repository at this point in the history
  • Loading branch information
alankrantas committed Jul 13, 2024
1 parent fb556e7 commit 904cf1a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/components/common/BuildLog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
beforeUpdate(() => {
if (dev) {
build_time = '1970-01-01 00:00';
let now = new Date();
build_time = `(Dev) ${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()} ${now.getHours()}:${now.getMinutes()}`;
return;
}
fetch('/website/build.json')
Expand Down
4 changes: 4 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
html {
scroll-behavior: smooth;
}

body {
font-family: 'Open Sans', 'Noto Sans TC', sans-serif;
text-align: justify;
Expand Down
2 changes: 1 addition & 1 deletion src/data/ViewItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"id": 3,
"name": "Links & About",
"description": "Contact information | external resources | social media | about this site",
"description": "Contact information | social media | about this site | external resources",
"imgUrl": "/main/links.jpg"
}
]
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import info from '../data/BasicInfo.json';
import viewItems from '../data/ViewItems.json';
const webTitle = `Homepage of ${info.name} (${info.location}): ${info.title.map((item) => item.toLowerCase()).join('/')}`;
const webTitle = `Homepage of ${info.name} (${info.location}): ${info.title.map((item) => item.toLowerCase()).join(' / ')}`;
</script>

<svelte:window bind:innerWidth={$screenSize} />
Expand Down Expand Up @@ -44,7 +44,7 @@
content="https://alankrantas.github.io/website/thumbnail.jpg"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="627" />
<meta property="og:image:height" content="597" />
<meta property="og:image:alt" content={webTitle} />
</svelte:head>

Expand Down
19 changes: 9 additions & 10 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
import info from '../data/BasicInfo.json';
import viewItems from '../data/ViewItems.json';
viewItems[0].description = viewItems[0].description
.replace('<name>', info.name)
.replace('<title>', info.title.map((item) => item.toLowerCase()).join('/'))
.replace('<industry>', info.industry);
const showScreenSize = false; // enable to show screen size; for responsive design testing
$: selectedViewId = -1;
let ready = false;
let scrollToTop = () => {};
$: selectedViewId = -1;
viewItems[0].description = viewItems[0].description
.replace('<name>', info.name)
.replace('<title>', info.title.map((item) => item.toLowerCase()).join(' / '))
.replace('<industry>', info.industry);
const setViewId = (id: number) => {
if (id >= 0 && id < viewItems.length) {
Expand All @@ -45,12 +47,11 @@
afterUpdate(() => {
if (!ready) {
scrollToTop = () => {
scrollToTop = () =>
window.scrollTo({
top: 0,
behavior: 'auto'
behavior: 'smooth'
});
};
const viewParam = $page.url.searchParams.get('view');
if (viewParam && Number.isSafeInteger(viewParam)) {
setViewId(Number(viewParam));
Expand All @@ -66,8 +67,6 @@
duration: 1000,
easing: expoOut
});
const showScreenSize = false; // enable to show screen size; for responsive design testing
</script>

<svelte:head>
Expand Down

0 comments on commit 904cf1a

Please sign in to comment.