File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 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;
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
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 >
Original file line number Diff line number Diff line change 11import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' ;
22import adapter from '@sveltejs/adapter-static' ;
3+ const forGithubPages = true ;
4+
35/** @type {import('@sveltejs/kit').Config } */
46const 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
2026export default config ;
You can’t perform that action at this time.
0 commit comments