Compare commits
5 Commits
fceafd9841
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5de68bf11a | |||
| 4e63ea50af | |||
| e4392a6781 | |||
| 530c3b0a93 | |||
| e5230a6f27 |
6
package-lock.json
generated
6
package-lock.json
generated
@@ -2361,9 +2361,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001663",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001663.tgz",
|
||||
"integrity": "sha512-o9C3X27GLKbLeTYZ6HBOLU1tsAcBZsLis28wrVzddShCS16RujjHp9GDHKZqrB3meE0YjhawvMFsGb/igqiPzA==",
|
||||
"version": "1.0.30001721",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz",
|
||||
"integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
"about": {
|
||||
"h": "About me",
|
||||
"text": "<p>Fullstack developer from St. Petersburg.</p> <p>I like to explore new technologies, find unusual approaches to solving problems and work at the intersection of fields.</p>",
|
||||
"career": "Career:",
|
||||
"career_value": "Selectel",
|
||||
"bachelors": "BSIT:",
|
||||
"bachelors_value": "SPBSUT",
|
||||
"masters": "MS:",
|
||||
"masters_value": "ITMO (in progress)"
|
||||
"career_value": "Yandex",
|
||||
"masters_value": "ITMO"
|
||||
},
|
||||
"projects": {
|
||||
"h": "Projects",
|
||||
|
||||
@@ -1,33 +1,5 @@
|
||||
export default async function getStarsForUser(username: string) {
|
||||
const userResponse = await request(`/users/${username}`);
|
||||
if (!userResponse || !userResponse.public_repos) {
|
||||
throw new Error(userResponse ? userResponse.message : 'User not found.');
|
||||
}
|
||||
|
||||
const pages = Math.ceil(userResponse.public_repos / 100);
|
||||
let repos = [];
|
||||
const fetchReposPromises = [];
|
||||
|
||||
for (let i = 1; i <= pages; i++) {
|
||||
fetchReposPromises.push(request(`/users/${username}/repos?per_page=100&page=${i}`));
|
||||
}
|
||||
|
||||
const reposResponses = await Promise.all(fetchReposPromises);
|
||||
repos = reposResponses.flat();
|
||||
|
||||
return starSum(repos);
|
||||
}
|
||||
|
||||
async function request(url) {
|
||||
const headers= {
|
||||
'User-Agent': 'GitHub StarCounter',
|
||||
// Authorization: `Basic ${Buffer.from(auth).toString('base64')}`
|
||||
};
|
||||
|
||||
const response = await fetch(`https://api.github.com${url}`, { headers });
|
||||
return response.json()
|
||||
}
|
||||
|
||||
async function starSum(repos) {
|
||||
return repos.reduce((acc, curr) => acc + curr.stargazers_count, 0);
|
||||
export default async function getStars(username: string) {
|
||||
const resp = await fetch(`https://user-stars.kopyl.dev/${username}`)
|
||||
const body = await resp.json()
|
||||
return body.stars
|
||||
}
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
"about": {
|
||||
"h": "Обо мне",
|
||||
"text": "<p>Fullstack разработчик из Санкт-Петербурга.</p> <p>Люблю разбираться в новых технологиях, находить необычные подходы к решению проблем и работать на пересечении областей.</p>",
|
||||
"career": "Работа:",
|
||||
"career_value": "Selectel",
|
||||
"bachelors": "Бакалавриат:",
|
||||
"bachelors_value": "СПбГУТ",
|
||||
"masters": "Магистратура:",
|
||||
"masters_value": "ИТМО (в процессе)"
|
||||
"career_value": "Яндекс",
|
||||
"masters_value": "ИТМО"
|
||||
},
|
||||
"projects": {
|
||||
"h": "Проекты",
|
||||
|
||||
@@ -2,10 +2,9 @@ import {loadTranslations} from '$lib/translations';
|
||||
import type {LayoutLoad} from "./$types";
|
||||
|
||||
export const load: LayoutLoad = async ({ url, data }) => {
|
||||
const { pathname } = url;
|
||||
const { locale } = data.i18n
|
||||
|
||||
await loadTranslations(locale, pathname);
|
||||
await loadTranslations(locale);
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
@@ -17,19 +17,11 @@
|
||||
<div class="grid gap-x-2 grid-cols-[auto_1fr] h-fit items-center text-slate-400">
|
||||
<div class="flex gap-2 items-center">
|
||||
<MaterialSymbolsWork></MaterialSymbolsWork>
|
||||
{$t('about.career')}
|
||||
</div>
|
||||
{$t('about.career_value')}
|
||||
|
||||
<div class="flex gap-2 items-center">
|
||||
<MaterialSymbolsSchool></MaterialSymbolsSchool>
|
||||
{$t('about.bachelors')}
|
||||
</div>
|
||||
{$t('about.bachelors_value')}
|
||||
|
||||
<div class="flex gap-2 items-center">
|
||||
<MaterialSymbolsSchool></MaterialSymbolsSchool>
|
||||
{$t('about.masters')}
|
||||
</div>
|
||||
{$t('about.masters_value')}
|
||||
</div>
|
||||
|
||||
@@ -92,4 +92,8 @@ import { page } from '$app/stores';
|
||||
content: '+';
|
||||
}
|
||||
}
|
||||
|
||||
:global(article p) {
|
||||
text-align: justify;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
},
|
||||
"include": [
|
||||
"*.config.ts",
|
||||
"src/**/*.svx",
|
||||
"src/blog/**/*.svx",
|
||||
"src/**/*.svelte",
|
||||
"src/**/*.ts",
|
||||
"rehype/**/*.ts"
|
||||
]
|
||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
||||
|
||||
Reference in New Issue
Block a user