Skip to content

Commit 9e378db

Browse files
Merge pull request #49 from Roman-wdesign/fix/UX-update
fix: to https reverseGeo
2 parents aba2e43 + d61311d commit 9e378db

File tree

7 files changed

+35
-37
lines changed

7 files changed

+35
-37
lines changed

src/features/WeatherHourly/main-component/ui/HourlyComponent.vue

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,21 @@ type TemperatureRange = {
141141
142142
const temperatureRanges: TemperatureRange[] = [
143143
{ min: -Infinity, max: -60, color: 'text-fuchsia-900' }, // yakut winter
144-
{ min: -59.9, max: -49.9, color: 'text-purple-800' }, // arctic winter
145-
{ min: -49.9, max: -39.9, color: 'text-violet-600' }, // siberian winter
146-
{ min: -39.9, max: -29.9, color: 'text-violet-500' }, // ural winter
147-
{ min: -29.9, max: -19.9, color: 'text-indigo-400' }, // asian winter
148-
{ min: -19.9, max: -9.9, color: 'text-cyan-300' }, // europian winter
149-
{ min: -9.9, max: -4.9, color: 'text-sky-400' },
150-
{ min: -4.9, max: -0.1, color: 'text-cyan-400' },
151-
{ min: -0.1, max: -0.0, color: 'text-neutral-900 dark:text-neutral-200' }, // - 0
152-
{ min: 0.0, max: 0.1, color: 'text-zinc-900 dark:text-zinc-500' }, // 0
153-
{ min: 0.2, max: 5.1, color: 'text-emerald-400' }, // arctic spring
154-
{ min: 5.2, max: 10.1, color: 'text-lime-400' }, // siberian spring
155-
{ min: 10.2, max: 15.1, color: 'text-yellow-400' }, // europian spring
156-
{ min: 15.2, max: 20.1, color: 'text-amber-300' },
157-
{ min: 20.2, max: 35.1, color: 'text-orange-600' }, // miami summer
158-
{ min: 35.1, max: 40.1, color: 'text-pink-600' }, // turkmenistan summer
159-
{ min: 40.2, max: Infinity, color: 'text-rose-600' } // quatar summer
144+
{ min: -60, max: -50, color: 'text-purple-800' }, // arctic winter
145+
{ min: -50, max: -40, color: 'text-violet-600' }, // siberian winter
146+
{ min: -40, max: -30, color: 'text-violet-500' }, // ural winter
147+
{ min: -30, max: -20, color: 'text-indigo-400' }, // asian winter
148+
{ min: -20, max: -10, color: 'text-sky-600' }, // europian winter
149+
{ min: -10, max: -5, color: 'text-cyan-500' },
150+
{ min: -5, max: 0, color: 'text-cyan-300' },
151+
{ min: 0, max: 5, color: 'text-zinc-900 dark:text-zinc-500' }, // 0
152+
{ min: 5, max: 10, color: 'text-emerald-400' }, // arctic spring
153+
{ min: 10, max: 15, color: 'text-lime-400' }, // siberian spring
154+
{ min: 15, max: 20, color: 'text-yellow-400' }, // europian spring
155+
{ min: 20, max: 30, color: 'text-amber-300' },
156+
{ min: 30, max: 35, color: 'text-orange-600' }, // miami summer
157+
{ min: 35, max: 40, color: 'text-pink-600' }, // turkmenistan summer
158+
{ min: 40, max: Infinity, color: 'text-rose-600' } // quatar summer
160159
]
161160
162161
const getTemperatureColor = (tempCelsius: number): string => {

src/features/WeatherNow/item-weather/ui/TheItemWeather.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const props = defineProps<Partial<Props>>()
9090
</script>
9191

9292
<template>
93-
<div class="dark:bg-gray-800 dark:text-gray-400 px-3 h-auto">
93+
<div>
9494
<div class="weather-wrap" v-if="props.weather?.main">
9595
<div class="location-box">
9696
<div class="location px-2">

src/features/WeatherNow/main-component/model/useWeatherNow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const useWeatherNow = () => {
2020
const maxResults = 5
2121
const isSaveDisabled = computed(() => savedCities.value.length >= 3)
2222

23-
const setResults = (city: string, results: any) => {
23+
const setResults = (city: string, results: string) => {
2424
theWeather.value[city] = results
2525
}
2626

@@ -55,7 +55,7 @@ export const useWeatherNow = () => {
5555
data.list.map((city: any) => `${city.name}, ${city.sys.country}`) || []
5656
).slice(0, maxResults)
5757
} catch (err) {
58-
console.error('Ошибка при получении подсказок:', err)
58+
console.error('Error when receiving hints:', err)
5959
suggestions.value = []
6060
}
6161
}

src/features/WeatherNow/main-component/ui/WeatherNow.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ onMounted(async () => {
112112
<li v-for="(city, index) in savedCities" :key="city" :data-index="index" class="relative min-w-40"
113113
draggable="true" @dragstart="handleDragStart" @dragover="handleDragOver" @drop="handleDrop">
114114
<IconClose
115-
class="absolute top-0 right-0 w-8 h-8 rounded-full fill-blue-600 hover:fill-blue-500 cursor-pointer"
115+
class="absolute top-0 right-0 w-8 h-8 rounded-full fill-orange-tomato hover:fill-white dark:fill-gray-500 dark:hover:fill-blue-300 cursor-pointer"
116116
@click="removeCityFromStorage(city)">
117117
</IconClose>
118118
<div>
119-
<BarsFour class="absolute top-2 left-2 hover: cursor-pointer" />
119+
<BarsFour class="absolute top-2 left-2 cursor-grab dark:bg-gray-700" />
120120
</div>
121121
<TheItemWeather v-if="theWeather[city]" :weather="theWeather[city]" :imgUrl="imgUrl"
122-
class="w-full h-80 pt-10 border-2 rounded-md border-blue-500">
122+
class="w-full pt-10 rounded-md bg-orange-fruit text-white dark:bg-gray-700 dark:text-gray-400 px-3 h-auto">
123123
</TheItemWeather>
124124
</li>
125125
</ul>

src/shared/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export const urlBase: string = 'https://api.openweathermap.org/data/2.5/'
77
export const imgUrl: string = 'https://openweathermap.org/img/wn/'
88

99
// url to geo
10-
export const reverseGeo: string = 'http://api.openweathermap.org/geo/1.0/'
10+
export const reverseGeo: string = 'https://api.openweathermap.org/geo/1.0/'

src/widgets/navbar/ui/TheNavbar.vue

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,27 @@ onUnmounted(() => {
3737

3838
<template>
3939
<div :class="isDarkMode ? 'dark' : ''">
40-
<div class="bg-indigo-600 dark:bg-gray-400 relative">
40+
<div class="bg-indigo-600 dark:bg-gray-400 relative text-white dark:text-gray-800">
4141
<nav class="container px-4 mb-8 py-4 mx-auto md:flex md:justify-between md:items-center">
4242
<div class="flex items-center justify-between">
4343
<div class="flex items-center">
44-
<button
45-
@click="toggleDarkMode"
46-
class="text-gray-100 hover:text-gray-400 focus:outline-none focus:text-gray-400 mr-4"
47-
>
44+
<button @click="toggleDarkMode"
45+
class="text-gray-100 hover:text-gray-400 focus:outline-none focus:text-gray-400 mr-4">
4846
<span v-if="isDarkMode" class="dark-mode-icon">🌙</span>
4947
<span v-else class="light-mode-icon">☀️</span>
5048
</button>
5149
</div>
5250
<!-- Mobile menu button -->
5351
<div @click="handleMenuToggle" class="flex md:hidden">
54-
<button
55-
type="button"
56-
class="text-gray-100 hover:text-gray-400 focus:outline-none focus:text-gray-400"
57-
>
52+
<button type="button" class="text-gray-100 hover:text-gray-400 focus:outline-none focus:text-gray-400">
5853
<BarsTree class="h-6 w-6 text-gray-50" :class="showMenu ? 'hidden' : 'flex'" />
5954
<IconClose class="h-6 w-6 text-gray-50" :class="showMenu ? 'flex' : 'hidden'" />
6055
</button>
6156
</div>
6257
</div>
6358
<!-- Mobile Menu -->
64-
<ul
65-
ref="menuRef"
66-
:class="{ flex: showMenu, hidden: !showMenu, 'md:flex': true }"
67-
class="absolute top-full left-0 w-full bg-indigo-600 dark:bg-gray-400 flex-col mt-4 space-y-4 md:static md:mt-0 md:flex md:flex-row md:items-center md:space-y-0 md:space-x-10"
68-
>
59+
<ul ref="menuRef" :class="{ flex: showMenu, hidden: !showMenu, 'md:flex': true }"
60+
class="absolute top-full left-0 w-full bg-indigo-600 dark:bg-gray-400 flex-col mt-4 space-y-4 md:static md:mt-0 md:flex md:flex-row md:items-center md:space-y-0 md:space-x-10">
6961
<li>
7062
<div>
7163
<RouterLink to="/"> Home </RouterLink>

tailwind.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ module.exports = {
77
extend: {
88
fontFamily: {
99
sans: ['"Roboto"', ...defaultTheme.fontFamily.sans]
10+
},
11+
colors: {
12+
'orange-fruit': '#c5948c',
13+
'orange-tomato': '#e7b382',
14+
'green-banana': '#85DCB9',
15+
'sea-mood': '#81BECE',
16+
'deep-sea': '#378BA4'
1017
}
1118
}
1219
},

0 commit comments

Comments
 (0)