Skip to content

Commit b020371

Browse files
author
Дмитрий Макаров
committed
update path
1 parent ffafa10 commit b020371

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/routes/Home.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import { onMount } from "svelte";
33
import config from "../config.json";
4-
import { goto } from "$app/navigation"; // если используете svelte-navigator или другое решение
4+
import { goto } from "$app/navigation";
55
66
let noButton;
77
let container;
@@ -10,12 +10,12 @@
1010
goto("/yes");
1111
}
1212
13-
// Функция для "убегания" кнопки
13+
// Function to "move away" the button
1414
function moveNoButton() {
1515
if (!container || !noButton) return;
1616
const rect = container.getBoundingClientRect();
1717
18-
// Высчитываем новую позицию
18+
// Calculate new position
1919
const newX = Math.random() * (rect.width - noButton.offsetWidth);
2020
const newY = Math.random() * (rect.height - noButton.offsetHeight);
2121
@@ -25,12 +25,12 @@
2525
}
2626
2727
function handleNo() {
28-
// При клике по «Нет» тоже убегаем
28+
// Clicking the "No" button also triggers the move
2929
moveNoButton();
3030
}
3131
3232
onMount(() => {
33-
// Навешиваем событие при наведении
33+
// Add event listener for mouseover on the "No" button
3434
noButton.addEventListener("mouseover", moveNoButton);
3535
});
3636
</script>

svelte.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
22
import adapter from '@sveltejs/adapter-static';
3+
const forGithubPages = true;
4+
35
/** @type {import('@sveltejs/kit').Config} */
46
const config = {
57
preprocess: vitePreprocess(),
@@ -13,8 +15,12 @@ const config = {
1315
precompress: true,
1416
strict: true
1517
}
16-
)
18+
),
19+
paths: {
20+
base: forGithubPages ? '' : '/Ask-girl-to-date'
21+
},
1722
}
23+
1824
};
1925

2026
export default config;

0 commit comments

Comments
 (0)