Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed old scripts #206

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"svelte.svelte-vscode",
"Vue.volar",
"nrwl.angular-console",
"ms-playwright.playwright",
Expand Down
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Go to your Twitch developer console and create a new application
PUBLIC_TWITCH_CLIENT_ID=""
NUXT_PUBLIC_TWITCH_CLIENT_ID=""

# Will redirect to with #access_token
PUBLIC_SIGNIN_REDIRECT_URL=""
NUXT_PUBLIC_SIGNIN_REDIRECT_URL=""

# Where will be all session data
PUBLIC_COOKIE_KEY=""
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Make a fork. Or clone this repo and use standard commands:
```shell
git clone https://github.com/chat-game/space
yarn install
yarn run dev
yarn run start
```

## 🏆 Contributors
Expand Down
13 changes: 6 additions & 7 deletions apps/website/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,33 @@ export default defineNuxtConfig({
workspaceDir: '../../',
srcDir: 'src',
devtools: { enabled: true },

devServer: {
host: '0.0.0.0',
port: 4200,
},

typescript: {
typeCheck: true,
tsConfig: {
extends: '../tsconfig.app.json', // Nuxt copies this string as-is to the `./.nuxt/tsconfig.json`, therefore it needs to be relative to that directory
},
},

imports: {
autoImport: true,
},

css: ['~/assets/css/styles.css'],

vite: {
plugins: [nxViteTsPaths()],
},

runtimeConfig: {
public: {
twitchClientId: '', // NUXT_PUBLIC_TWITCH_CLIENT_ID
signInRedirectUrl: '', // NUXT_PUBLIC_SIGNIN_REDIRECT_URL
},
},
modules: [
'@nuxt/eslint',
'@vueuse/nuxt',
'@pinia/nuxt',
],

compatibilityDate: '2024-08-18',
});
Binary file added apps/website/src/assets/img/icons/twitch/112.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/website/src/assets/img/icons/twitch/28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/website/src/assets/img/icons/twitch/56.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 7 additions & 11 deletions apps/website/src/components/MenuDesktop.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
<script setup lang="ts">
const route = useRoute()
</script>

<template>
<nav>
<ul>
<li :aria-current="route.path === `/` ? 'page' : undefined">
<li :aria-current="$route.path === `/` ? 'page' : undefined">
<NuxtLink to="/">
Главная
</NuxtLink>
</li>
<li :aria-current="route.path === `/about` ? 'page' : undefined">
<li :aria-current="$route.path === `/about` ? 'page' : undefined">
<NuxtLink to="/about">
About
</NuxtLink>
</li>
<li :aria-current="route.path === `/character` ? 'page' : undefined">
<li :aria-current="$route.path === `/character` ? 'page' : undefined">
<NuxtLink to="/character">
Персонажи
</NuxtLink>
</li>
<li :aria-current="route.path === `/quest` ? 'page' : undefined">
<li :aria-current="$route.path === `/quest` ? 'page' : undefined">
<NuxtLink href="/quest">
Задания
</NuxtLink>
</li>
<li :aria-current="route.path === `/trophy` ? 'page' : undefined">
<li :aria-current="$route.path === `/trophy` ? 'page' : undefined">
<NuxtLink href="/trophy">
Трофеи
</NuxtLink>
</li>
<li :aria-current="route.path === `/coupon` ? 'page' : undefined">
<li :aria-current="$route.path === `/coupon` ? 'page' : undefined">
<NuxtLink href="/coupon">
Купон
</NuxtLink>
Expand All @@ -46,7 +42,7 @@ const route = useRoute()

<div class="right">
<div class="items">
<Profile />
<MenuProfile />
</div>
</div>
</template>
Expand Down
63 changes: 63 additions & 0 deletions apps/website/src/components/MenuProfile.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<script setup lang="ts">
const { public: publicEnv } = useRuntimeConfig()
const website = useWebsiteStore()
const isSignedIn = false

const handleMenuClick = () => {
website.isFeedOpened = !website.isFeedOpened
}

const url = new URL('https://id.twitch.tv/oauth2/authorize')
url.searchParams.set('client_id', publicEnv.twitchClientId)
url.searchParams.set('redirect_uri', publicEnv.signInRedirectUrl)
url.searchParams.set('response_type', 'token')
</script>

<template>
<div class='wrapper'>
<button v-if="isSignedIn" class='profile-avatar' @click={handleMenuClick}>
<img src="~/assets/img/icons/twitch/112.png" alt="" >
</button>
<a v-else class='twitch' :href="url.href">Войти</a>
</div>
</template>

<style scoped>
.wrapper {
position: relative;
width: fit-content;
display: inline-block;
}

.twitch {
color: white;
text-decoration: none;
padding: 0.5em 1.2em;
background-color: var(--violet-9);
transition: all 0.2s;

&:hover {
text-decoration: none;
transform: scale(1.04);
opacity: 0.8;
}
}

.profile-avatar {
padding: 0.2em;
width: 58px;
height: 58px;
background-color: var(--bronze-4);
border: 2px solid var(--bronze-6);
transition: all 0.2s;

&:hover {
opacity: 0.8;
}

img {
width: 100%;
height: auto;
}
}
</style>
13 changes: 6 additions & 7 deletions apps/website/src/components/MenuSmartphone.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
const route = useRoute()
const website = useWebsiteStore()

function closeSidebar() {
Expand All @@ -11,39 +10,39 @@ function closeSidebar() {
<aside :class="{open: website.isMobileMenuOpened}">
<nav>
<ul>
<li :aria-current="route.path === `/` ? 'page' : undefined">
<li :aria-current="$route.path === `/` ? 'page' : undefined">
<NuxtLink
to="/"
@click="closeSidebar"
>
Главная
</NuxtLink>
</li>
<li :aria-current="route.path === `/character` ? 'page' : undefined">
<li :aria-current="$route.path === `/character` ? 'page' : undefined">
<NuxtLink
to="/character"
@click="closeSidebar"
>
Персонажи
</NuxtLink>
</li>
<li :aria-current="route.path === `/quest` ? 'page' : undefined">
<li :aria-current="$route.path === `/quest` ? 'page' : undefined">
<NuxtLink
href="/quest"
@click="closeSidebar"
>
Задания
</NuxtLink>
</li>
<li :aria-current="route.path === `/trophy` ? 'page' : undefined">
<li :aria-current="$route.path === `/trophy` ? 'page' : undefined">
<NuxtLink
href="/trophy"
@click="closeSidebar"
>
Трофеи
</NuxtLink>
</li>
<li :aria-current="route.path === `/coupon` ? 'page' : undefined">
<li :aria-current="$route.path === `/coupon` ? 'page' : undefined">
<NuxtLink
href="/coupon"
@click="closeSidebar"
Expand All @@ -62,7 +61,7 @@ function closeSidebar() {
</aside>

<div class="profile-block">
<Profile />
<MenuProfile />
</div>

<MenuHamburger />
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/server/plugins/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export default defineNitroPlugin(() => {
log('Server started!')

setInterval(() => {
log('Server is OK...')
//log('Server is OK...')
}, 60000)
})
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
"twitch"
],
"scripts": {
"dev": "vite dev",
"build": "svelte-kit sync && vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig tsconfig.json --watch",
"test": "vitest run --coverage",
"lint": "eslint",
"lint:fix": "eslint --fix",
"start": "nx run-many -t serve",
"test": "nx affected:test",
"lint": "nx affected:lint",
"release": "yarn run check && yarn run test && yarn run lint && yarn run build && changelogen --release --push",
"prepare": "husky"
"prepare": "husky",
"update": "nx migrate latest",
"dep-graph": "nx dep-graph",
"help": "nx help"
},
"dependencies": {
"@hmbanan666/chat-game-api": "^0.1.18",
Expand Down Expand Up @@ -106,6 +104,5 @@
},
"lint-staged": {
"*.ts": "yarn run lint"
},
"nx": {}
}
}
Loading