Compare commits

...

4 Commits

Author SHA1 Message Date
Jill 5fd335bbf5
fallback to cache if networking fails 2023-08-20 04:02:43 +03:00
Jill 8df30ebc65
post cards are a little fruitier 2023-08-20 03:59:24 +03:00
Jill 59e943eff4
header img fix 2023-08-20 03:52:27 +03:00
Jill 8a02426cc2
bump some versions 2023-08-20 03:49:01 +03:00
5 changed files with 425 additions and 4444 deletions

View File

@ -18,7 +18,7 @@
pname = "cohost-blogger";
inherit (package) version;
npmDepsHash = "sha256-hzn0sjxcysxe++IPyhKE/syx3S1Nh2hKGcjvS6UaLvY=";
npmDepsHash = "sha256-zkk8UL3h25tC6HXl+fC3QKnvky4OiRoOyGBi5ynqJis=";
doCheck = true;

4839
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
},
"devDependencies": {
"@sveltejs/adapter-node": "^1.2.4",
"@sveltejs/kit": "^1.5.0",
"@sveltejs/kit": "^1.22.6",
"@types/marked": "^4.0.8",
"eslint": "^8.28.0",
"eslint-plugin-svelte3": "^4.0.0",
@ -28,8 +28,8 @@
"html-to-text": "^9.0.5",
"insane": "^2.6.2",
"marked": "^4.3.0",
"minify-xml": "^3.4.0",
"modern-normalize": "^1.1.0",
"minify-xml": "^4.0.0",
"modern-normalize": "^2.0.0",
"reading-time": "^1.5.0",
"rehype-external-links": "^2.0.1",
"rehype-highlight": "^6.0.0",

View File

@ -58,8 +58,14 @@ const CACHE_INVALID_PERIOD = 60 * 1000;
export async function getPosts() {
const timeSinceCache = Date.now() - postCache.refreshed;
if (timeSinceCache > CACHE_INVALID_PERIOD) {
postCache.posts = await getPostsUncached();
postCache.refreshed = Date.now();
try {
postCache.posts = await getPostsUncached();
postCache.refreshed = Date.now();
} catch(err) {
console.error('error while loading posts:');
console.error(err);
return postCache.posts;
}
}
return postCache.posts;

View File

@ -61,6 +61,9 @@
word-break: break-word;
transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
will-change: transform;
.image {
display: block;
margin-bottom: 1.25em;
@ -124,8 +127,13 @@
&:hover {
header {
opacity: 0.8;
opacity: 0.85;
}
transform: scale(1.01);
}
&:active {
transition-duration: 0.08s;
transform: scale(0.99);
}
}
@ -139,6 +147,7 @@
height: 460px;
max-height: 60vw;
position: relative;
overflow: hidden;
background:
linear-gradient(to bottom, rgba(0,0,0,0), 85%, var(--background-color)),
@ -155,6 +164,7 @@
img {
animation: 2s infinite ease-in-out alternate light-bob;
max-width: 85vw;
}
}
}