Compare commits

...
Sign in to create a new pull request.

11 commits

Author SHA1 Message Date
466f7e9a54 Исправил ошибку с датами в RSS
All checks were successful
/ build (push) Successful in 4m42s
/ deploy (push) Successful in 52s
2025-12-10 05:59:46 +03:00
6d12b45d41 Ещё одна попытка включить поддержку старых браузеров (SvelteKit не работает с плагином vite legacy)
All checks were successful
/ build (push) Successful in 3m47s
/ deploy (push) Successful in 56s
2025-11-30 19:30:25 +03:00
d79d323f17 Обновил пакеты, включил polyfill для популярных версий браузеров
All checks were successful
/ build (push) Successful in 5m1s
/ deploy (push) Successful in 57s
2025-11-26 23:57:19 +03:00
5822e64c84 Перевёл NavBar на Svelte Runes (это каким-то образом починило кнопки?) 2025-11-26 23:56:35 +03:00
40975d219a Улучшил перенос даты и авторов на мобильных 2025-11-26 23:48:54 +03:00
7da16b7f0d Перевёл Markdown на Svelte Runes 2025-11-26 22:15:13 +03:00
763b263b5a Уменьшил размер навбара для малых экранов
Some checks failed
/ build (push) Successful in 6m15s
/ deploy (push) Failing after 1m35s
2025-11-26 17:00:24 +03:00
0513ffa71a InfoBlock -> Примечание
All checks were successful
/ build (push) Successful in 3m37s
/ deploy (push) Successful in 1m19s
2025-11-26 12:36:53 +03:00
4c04742abc Экстренная попытка исправить Polyfill для Intl.DurationFormat 2025-11-26 12:36:43 +03:00
3343e59f16 Добавил Telegram в .env для CI/CD
All checks were successful
/ build (push) Successful in 3m30s
/ deploy (push) Successful in 56s
2025-11-26 11:55:29 +03:00
746359e93a Merge pull request 'События и первый конкурс' (#6) from feature/events into master
Some checks failed
/ build (push) Failing after 2m54s
/ deploy (push) Has been skipped
Reviewed-on: #6
2025-11-26 11:46:25 +03:00
13 changed files with 2812 additions and 772 deletions

View file

@ -30,7 +30,7 @@ jobs:
key: ${{ steps.tsru-npm.outputs.cache-primary-key }} key: ${{ steps.tsru-npm.outputs.cache-primary-key }}
- name: Populate the .env file - name: Populate the .env file
run: echo "PUBLIC_TS_DISCORD=${{ vars.PUBLIC_TS_DISCORD }}" >> .env run: printf "PUBLIC_TS_DISCORD=%s\nPUBLIC_TS_TELEGRAM=%s\n" "${{ vars.PUBLIC_TS_DISCORD }}" "${{ vars.PUBLIC_TS_TELEGRAM }}" >> .env
- name: Build frontend - name: Build frontend
run: npm run build run: npm run build

3486
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,35 +11,36 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
}, },
"devDependencies": { "devDependencies": {
"@iconify/svelte": "^4.2.0", "@iconify/svelte": "^5.1.0",
"@react2svelte/swipeable": "^0.1.4", "@react2svelte/swipeable": "^0.1.4",
"@svelte-put/dragscroll": "^4.0.0", "@svelte-put/dragscroll": "^4.0.0",
"@sveltejs/adapter-auto": "^4.0.0", "@sveltejs/adapter-auto": "^7.0.0",
"@sveltejs/adapter-static": "^3.0.8", "@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.17.3", "@sveltejs/kit": "^2.49.0",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.0.9", "@tailwindcss/vite": "^4.1.17",
"@types/node": "^22.13.5", "@types/node": "^24.10.1",
"autoprefixer": "^10.4.20", "@vitejs/plugin-legacy": "^7.2.1",
"eslint": "^9.21.0", "autoprefixer": "^10.4.22",
"eslint-config-prettier": "^10.0.1", "eslint": "^9.39.1",
"eslint-plugin-svelte": "^3.0.0", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.13.0",
"mdsvex": "^0.12.6", "mdsvex": "^0.12.6",
"mdsvex-relative-images": "^1.0.3", "mdsvex-relative-images": "^2.0.0",
"postcss": "^8.5.3", "postcss": "^8.5.6",
"prettier": "^3.5.2", "prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.3.3", "prettier-plugin-svelte": "^3.4.0",
"prettier-plugin-tailwindcss": "^0.6.11", "prettier-plugin-tailwindcss": "^0.7.1",
"svelte": "^5.20.4", "svelte": "^5.45.1",
"svelte-check": "^4.1.4", "svelte-check": "^4.3.4",
"svelte-disable-preload": "^0.0.3", "svelte-disable-preload": "^0.0.3",
"svelte-resize-observer-action": "^0.0.4", "svelte-resize-observer-action": "^0.0.4",
"svelte-sitemap": "^2.7.0", "svelte-sitemap": "^2.7.1",
"sveltekit-autoimport": "^1.8.1", "sveltekit-autoimport": "^1.8.2",
"tailwindcss": "^4.0.9", "tailwindcss": "^4.0.9",
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.7.3", "typescript": "^5.9.3",
"vite": "^6.2.0" "vite": "^7.2.4"
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {

1
src/hooks.client.ts Normal file
View file

@ -0,0 +1 @@
import "@formatjs/intl-durationformat/polyfill";

View file

@ -6,7 +6,7 @@
bgStrong="bg-blue-500" bgStrong="bg-blue-500"
bgBleak="bg-blue-50" bgBleak="bg-blue-50"
icon="material-symbols:info" icon="material-symbols:info"
caption="Обратите внимание" caption="Примечание"
> >
<slot /> <slot />
</IconBlock> </IconBlock>

View file

@ -2,7 +2,7 @@
import HoverIcon from '$lib/components/HoverIcon.svelte'; import HoverIcon from '$lib/components/HoverIcon.svelte';
import { page } from '$app/state'; import { page } from '$app/state';
export let routes: App.Route[]; let { routes }: { routes: App.Route[] } = $props();
function isActive(route: string): boolean { function isActive(route: string): boolean {
if (route === '/') return page.url.pathname === route; if (route === '/') return page.url.pathname === route;
@ -12,7 +12,7 @@
</script> </script>
<nav <nav
class="flex shrink-0 flex-row gap-2 bg-slate-100 not-landscape:justify-around not-landscape:overflow-x-auto not-landscape:px-2 landscape:flex-col landscape:overflow-y-auto landscape:py-2" class="flex shrink-0 flex-row gap-2 bg-slate-100 not-landscape:justify-around not-landscape:overflow-x-auto not-landscape:sm:px-2 landscape:flex-col landscape:overflow-y-auto landscape:sm:py-2"
> >
{#each routes as route (route.href)} {#each routes as route (route.href)}
<a class="nav-button {isActive(route.href) ? 'active' : ''}" href={route.href}> <a class="nav-button {isActive(route.href) ? 'active' : ''}" href={route.href}>
@ -36,10 +36,10 @@
@import '$src/app.css'; @import '$src/app.css';
.nav-button { .nav-button {
@apply flex aspect-square shrink-0 flex-col items-center justify-center gap-0.5 p-2 text-slate-950 not-landscape:h-24 hover:bg-emerald-400 landscape:w-24; @apply flex aspect-square shrink-0 flex-col items-center justify-center gap-0.5 p-1 text-slate-950 not-landscape:h-20 hover:bg-emerald-400 sm:p-2 not-landscape:sm:h-24 landscape:w-20 landscape:sm:w-24;
> .contour { > .contour {
@apply rounded-full px-1.5 py-0.5 text-center; @apply rounded-full px-1 py-0.5 text-center sm:px-1.5;
} }
&.active { &.active {

View file

@ -1,8 +1,3 @@
import { shouldPolyfill } from '@formatjs/intl-durationformat/should-polyfill'
if (shouldPolyfill()) {
import('@formatjs/intl-durationformat/polyfill-force');
}
export const dateFormatShort = new Intl.DateTimeFormat(undefined, { export const dateFormatShort = new Intl.DateTimeFormat(undefined, {
month: 'short', month: 'short',
day: 'numeric', day: 'numeric',

View file

@ -28,7 +28,7 @@ const icons: Record<string, string> = {
const specialResolvers: Record<string, (url: URL) => string> = { const specialResolvers: Record<string, (url: URL) => string> = {
'teasanctuary.ru': (url) => { 'teasanctuary.ru': (url) => {
// Домены третьего уровня и выше // Домены третьего уровня и выше
const prefix = url.hostname.split('.').toReversed(); const prefix = url.hostname.split('.').reverse();
prefix.shift(); prefix.shift();
prefix.shift(); prefix.shift();
if (prefix[0] === "hl") { if (prefix[0] === "hl") {

View file

@ -136,6 +136,6 @@
text-slate-950 sm:px-4 sm:text-xl" text-slate-950 sm:px-4 sm:text-xl"
> >
<section class="mx-auto flex max-w-5xl flex-col flex-nowrap"> <section class="mx-auto flex max-w-5xl flex-col flex-nowrap">
<svelte:component this={data.content} /> <data.content />
</section> </section>
</article> </article>

View file

@ -72,9 +72,9 @@
</section> </section>
<section <section
class="flex shrink-0 flex-col flex-wrap items-center justify-center p-2 font-bold {isPublic class="flex shrink-0 flex-row flex-wrap items-center justify-center p-2 font-bold {isPublic
? 'bg-amber-50 text-slate-950' ? 'bg-amber-50 text-slate-950'
: 'bg-red-500 text-slate-50'} sm:flex-row sm:gap-x-5" : 'bg-red-500 text-slate-50'} sm:gap-x-5"
> >
<DateWidget dateString={data.blogPost.date} type="published" /> <DateWidget dateString={data.blogPost.date} type="published" />
{#if data.blogPost.dateChanged} {#if data.blogPost.dateChanged}
@ -170,5 +170,5 @@
text-slate-950 text-slate-950
sm:text-xl lg:p-8" sm:text-xl lg:p-8"
> >
<svelte:component this={data.content} /> <data.content />
</article> </article>

View file

@ -46,7 +46,7 @@ function makeEventDescription(post: App.BlogPost): string {
return ''; return '';
const dateToUtcString = (s: string) => new Date(s).toUTCString(); const dateToUtcString = (s: string) => new Date(s).toUTCString();
return `<br><br>Событие проводится с ${dateToUtcString(post.dateEventFrom!)} по ${dateToUtcString(post.dateEventFrom!)}.`; return `<br><br>Событие проводится с ${dateToUtcString(post.dateEventFrom!)} по ${dateToUtcString(post.dateEventTo!)}.`;
} }
export async function GET({ setHeaders }) { export async function GET({ setHeaders }) {

View file

@ -1,9 +0,0 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from "@tailwindcss/vite";
export default {
plugins: [
sveltekit(),
tailwindcss()
]
};

14
vite.config.ts Normal file
View file

@ -0,0 +1,14 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from "@tailwindcss/vite";
import type { UserConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
export default {
plugins: [
sveltekit(),
tailwindcss(),
legacy({
renderLegacyChunks: false
})
]
} satisfies UserConfig;