Skip to content

Commit

Permalink
Format all code with Prettier eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimov-dev committed Sep 8, 2022
1 parent a3a3b3b commit 09977d1
Show file tree
Hide file tree
Showing 9 changed files with 272 additions and 192 deletions.
10 changes: 5 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module.exports = {
root: false,
env: {
browser: true,
node: true,
node: true
},
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
requireConfigFile: false
},
extends: ['@nuxtjs', 'plugin:nuxt/recommended', 'prettier'],
plugins: [],
// add your custom rules here
rules: {
'no-console': 'off',
},
}
'no-console': 'off'
}
}
60 changes: 36 additions & 24 deletions components/CountryCard.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
<template>
<NuxtLink class="w-[30%]" :to="`/country/${country.name.common}`">
<div class="pointer-events-none card w-[100%] dark:bg-[#27272A] bg-white dark:text-white text-black shadow-xl my-[16px]">
<div
class="pointer-events-none card w-[100%] dark:bg-[#27272A] bg-white dark:text-white text-black shadow-xl my-[16px]"
>
<figure>
<img class="w-[400px] h-[225px]" :src="country.flags.png" alt="Shoes" />
</figure>
<div class="card-body">
<h2 class="card-title">{{country.name.common}}</h2>
<hr>
<h2 class="card-title">{{ country.name.common }}</h2>
<hr />
<div class="flex items-start flex-col">
<p class="font-bold">
Region: <span class="font-semibold opacity-80">{{country.region}}</span>
</p>
<p class="font-bold my-[16px]">
Capital: <span class="font-semibold opacity-80">{{ openArray(country.capital) }}</span>
</p>
<p class="font-bold mb-[16px]">
Timezone: <span class="font-semibold opacity-80">{{country.timezones[0]}}</span>
</p>
<p class="font-bold">
Population: <span class="font-semibold opacity-80">{{country.population}}</span>
</p>
<p class="font-bold">
Region:
<span class="font-semibold opacity-80">{{ country.region }}</span>
</p>
<p class="font-bold my-[16px]">
Capital:
<span class="font-semibold opacity-80">{{
openArray(country.capital)
}}</span>
</p>
<p class="font-bold mb-[16px]">
Timezone:
<span class="font-semibold opacity-80">{{
country.timezones[0]
}}</span>
</p>
<p class="font-bold">
Population:
<span class="font-semibold opacity-80">{{
country.population
}}</span>
</p>
</div>
</div>
</div>
Expand All @@ -28,19 +40,19 @@

<script>
export default {
props: {
props: {
country: {
type: Object,
default: null
type: Object,
default: null
}
},
methods: {
openArray(array){
const res = `${array}`
return res.replace('[]', '')
openArray(array) {
const res = `${array}`
return res.replace('[]', '')
}
},
}
}
</script>
</script>
5 changes: 4 additions & 1 deletion components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
<line x1="14" y1="4" x2="10" y2="20" />
</svg>
</a>
<a href="https://github.com/hakimov-dev/about-countries/issues/new" target="_blank">
<a
href="https://github.com/hakimov-dev/about-countries/issues/new"
target="_blank"
>
<svg
class="text-red-500"
width="24"
Expand Down
132 changes: 67 additions & 65 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,76 @@
<div
class="nav z-[111] bg-white fixed top-0 dark:bg-zinc-800 shadow-xl w-full px-[5%] h-[13vh]"
>
<div class="navbar-content flex justify-between items-center h-full">
<NuxtLink to="/" class="logo flex items-center">
<img
class="h-[70px] w-[80px] mr-[10px]"
src="../assets/imgs/logo.png"
alt=""
/>
<h1 class="text-[22px] font-semibold text-black dark:text-white">Countries about</h1>
</NuxtLink>
<div class="additional flex items-center">
<button class="dark-mode mr-[20px]" @click="changeTheme">
<transition name="fade">
<svg
v-if="theme != 'dark'"
class="w-[38px] h-[38px] transition-all text-gray-600"
width="24"
height="24"
<div class="navbar-content flex justify-between items-center h-full">
<NuxtLink to="/" class="logo flex items-center">
<img
class="h-[70px] w-[80px] mr-[10px]"
src="../assets/imgs/logo.png"
alt=""
/>
<h1 class="text-[22px] font-semibold text-black dark:text-white">
Countries about
</h1>
</NuxtLink>
<div class="additional flex items-center">
<button class="dark-mode mr-[20px]" @click="changeTheme">
<transition name="fade">
<svg
v-if="theme != 'dark'"
class="w-[38px] h-[38px] transition-all text-gray-600"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" />
<path d="M16.2 4a9.03 9.03 0 1 0 3.9 12a6.5 6.5 0 1 1 -3.9 -12" />
</svg>
<svg
v-if="theme == 'dark'"
class="w-[38px] h-[38px] transition-all text-white"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="5" />
<line x1="12" y1="1" x2="12" y2="3" />
<line x1="12" y1="21" x2="12" y2="23" />
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
<line x1="1" y1="12" x2="3" y2="12" />
<line x1="21" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
</svg>
</transition>
</button>
<a href="https://github.com/hakimov-dev" target="_blank"
><svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="42"
height="42"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
class="w-[42px] h-[42px] transition-all text-gray-600 dark:text-white"
>
<path stroke="none" d="M0 0h24v24H0z" />
<path d="M16.2 4a9.03 9.03 0 1 0 3.9 12a6.5 6.5 0 1 1 -3.9 -12" />
</svg>
<svg
v-if="theme == 'dark'"
class="w-[38px] h-[38px] transition-all text-white"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="5" />
<line x1="12" y1="1" x2="12" y2="3" />
<line x1="12" y1="21" x2="12" y2="23" />
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
<line x1="1" y1="12" x2="3" y2="12" />
<line x1="21" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
</svg>
</transition>
</button>
<a href="https://github.com/hakimov-dev" target="_blank"
><svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="42"
height="42"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"
class="w-[42px] h-[42px] transition-all text-gray-600 dark:text-white"
>
<path
d="M12 2.247a10 10 0 0 0-3.162 19.487c.5.088.687-.212.687-.475c0-.237-.012-1.025-.012-1.862c-2.513.462-3.163-.613-3.363-1.175a3.636 3.636 0 0 0-1.025-1.413c-.35-.187-.85-.65-.013-.662a2.001 2.001 0 0 1 1.538 1.025a2.137 2.137 0 0 0 2.912.825a2.104 2.104 0 0 1 .638-1.338c-2.225-.25-4.55-1.112-4.55-4.937a3.892 3.892 0 0 1 1.025-2.688a3.594 3.594 0 0 1 .1-2.65s.837-.262 2.75 1.025a9.427 9.427 0 0 1 5 0c1.912-1.3 2.75-1.025 2.75-1.025a3.593 3.593 0 0 1 .1 2.65a3.869 3.869 0 0 1 1.025 2.688c0 3.837-2.338 4.687-4.563 4.937a2.368 2.368 0 0 1 .675 1.85c0 1.338-.012 2.413-.012 2.75c0 .263.187.575.687.475A10.005 10.005 0 0 0 12 2.247z"
fill="currentColor"
></path></svg
></a>
<path
d="M12 2.247a10 10 0 0 0-3.162 19.487c.5.088.687-.212.687-.475c0-.237-.012-1.025-.012-1.862c-2.513.462-3.163-.613-3.363-1.175a3.636 3.636 0 0 0-1.025-1.413c-.35-.187-.85-.65-.013-.662a2.001 2.001 0 0 1 1.538 1.025a2.137 2.137 0 0 0 2.912.825a2.104 2.104 0 0 1 .638-1.338c-2.225-.25-4.55-1.112-4.55-4.937a3.892 3.892 0 0 1 1.025-2.688a3.594 3.594 0 0 1 .1-2.65s.837-.262 2.75 1.025a9.427 9.427 0 0 1 5 0c1.912-1.3 2.75-1.025 2.75-1.025a3.593 3.593 0 0 1 .1 2.65a3.869 3.869 0 0 1 1.025 2.688c0 3.837-2.338 4.687-4.563 4.937a2.368 2.368 0 0 1 .675 1.85c0 1.338-.012 2.413-.012 2.75c0 .263.187.575.687.475A10.005 10.005 0 0 0 12 2.247z"
fill="currentColor"
></path></svg
></a>
</div>
</div>
</div>
</div>
</template>

Expand Down
12 changes: 6 additions & 6 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div class="dark:bg-zinc-900 bg-white min-h-[100vh]">
<Navbar/>
<Nuxt />
<Footer />
</div>
<div class="dark:bg-zinc-900 bg-white min-h-[100vh]">
<Navbar />
<Nuxt />
<Footer />
</div>
</template>

<script>
export default {
name: 'NavbarItem'
}
</script>
</script>
26 changes: 12 additions & 14 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ export default {
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},

// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@/assets/css/index.css'
],
css: ['@/assets/css/index.css'],

// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
Expand All @@ -26,7 +24,7 @@ export default {
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
'@nuxt/postcss8',
'@nuxt/postcss8'
],

// Modules: https://go.nuxtjs.dev/config-modules
Expand All @@ -35,29 +33,29 @@ export default {
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
'@nuxtjs/dotenv',
'@nuxtjs/dotenv'
],

// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
baseURL: '/'
},

// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
},
lang: 'en'
}
},

// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
},
autoprefixer: {}
}
}
}
}
Loading

0 comments on commit 09977d1

Please sign in to comment.