From cabb957a5ddc7f866f3f55b13f5f9fa7e84b19d5 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Mon, 16 Dec 2024 22:12:49 +0300 Subject: [PATCH 1/8] first task --- 00-intro/10-sum/index.html | 49 ++++++++++++++++++++------------------ 00-intro/10-sum/sum.js | 2 +- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/00-intro/10-sum/index.html b/00-intro/10-sum/index.html index aeeec78..23672f7 100644 --- a/00-intro/10-sum/index.html +++ b/00-intro/10-sum/index.html @@ -1,25 +1,28 @@ - - - - - -
-

- - -

-

- -

-

- - -

-
- - - + + + + First + + + +
+

+ + +

+

+ +

+

+ + +

+
+ + + + \ No newline at end of file diff --git a/00-intro/10-sum/sum.js b/00-intro/10-sum/sum.js index 03c9923..de8966c 100644 --- a/00-intro/10-sum/sum.js +++ b/00-intro/10-sum/sum.js @@ -6,5 +6,5 @@ * @return {number} сумма чисел a и b */ export function sum(a, b) { - // Решение + return a+b; } From 3ddb4d98cfdde3e177691bb264c5500395f90313 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Sun, 29 Dec 2024 16:42:18 +0300 Subject: [PATCH 2/8] tasks --- 01-basics/10-create-app/script.js | 18 +++++ 01-basics/20-weather/WeatherApp.js | 124 ++++++++++++++++++----------- 01-basics/20-weather/index.html | 1 + 3 files changed, 98 insertions(+), 45 deletions(-) diff --git a/01-basics/10-create-app/script.js b/01-basics/10-create-app/script.js index 40fac68..780627c 100644 --- a/01-basics/10-create-app/script.js +++ b/01-basics/10-create-app/script.js @@ -1 +1,19 @@ import { defineComponent, createApp } from 'vue' + +const App = defineComponent({ + name: 'app', + + setup() { + + var day = new Date(); + + return { + today: day.toLocaleDateString('ru-RU', { dateStyle: 'long' }) + } + }, + + template: ` +
Сегодня {{ today }}
` +}); + +createApp(App).mount('#app'); \ No newline at end of file diff --git a/01-basics/20-weather/WeatherApp.js b/01-basics/20-weather/WeatherApp.js index 54dbfd6..a2b6461 100644 --- a/01-basics/20-weather/WeatherApp.js +++ b/01-basics/20-weather/WeatherApp.js @@ -3,49 +3,83 @@ import { getWeatherData, WeatherConditionIcons } from './weather.service.ts' export default defineComponent({ name: 'WeatherApp', + setup() { + const weatherData = getWeatherData(); - template: ` -
-

Погода в Средиземье

- -
    -
  • -
    - ⚠️ - Королевская метеослужба короля Арагорна II: Предвещается наступление сильного шторма. -
    -
    -

    - Гондор -

    -
    - 07:17 -
    -
    -
    -
    ⛈️
    -
    15.0 °C
    -
    -
    -
    -
    Давление, мм рт. ст.
    -
    754
    -
    -
    -
    Влажность, %
    -
    90
    -
    -
    -
    Облачность, %
    -
    100
    -
    -
    -
    Ветер, м/с
    -
    10.5
    -
    -
    -
  • -
-
- `, -}) + function convertToCelsius(k) { + return (parseFloat(k - 273.15)).toFixed(1) ; + } + + function formatPressure(hPa){ + return parseInt(Math.round(hPa*0.75)); + } + + function isNight(currentHourText, sunriseArrayText, sunsetArrayText) { + + var currentHourArray = currentHourText.split(":"); + var sunriseArray = sunriseArrayText.split(":") + var sunsetArray = sunsetArrayText.split(":") + + const currentHour = currentHourArray[0]*60+currentHourArray[1] + const sunrise = sunriseArray[0]*60+sunriseArray[1] + const sunset = sunsetArray[0]*60+sunsetArray[1] + + return currentHour < sunrise && currentHour > sunset; + } + + + return { + weatherData, + WeatherConditionIcons, + formatPressure, + isNight, + convertToCelsius, + }; + }, + + template: ` +
+

Погода в Средиземье

+ +
    +
  • +
    + ⚠️ + {{data.alert.sender_name}}:{{data.alert.description}} +
    +
    +

    + {{data.geographic_name}} +

    +
    + {{data.current.dt}} +
    +
    +
    +
    {{WeatherConditionIcons[data.current.weather.id]}}
    +
    {{convertToCelsius( data.current.temp )}} °C
    +
    +
    +
    +
    Давление, мм рт. ст.
    + +
    {{ formatPressure(data.current.pressure) }}
    +
    +
    +
    Влажность, %
    +
    {{data.current.humidity}}
    +
    +
    +
    Облачность, %
    +
    {{data.current.clouds}}
    +
    +
    +
    Ветер, м/с
    +
    {{data.current.wind_speed}}
    +
    +
    +
  • +
+
+`, +}); \ No newline at end of file diff --git a/01-basics/20-weather/index.html b/01-basics/20-weather/index.html index df31e9c..45be4cb 100644 --- a/01-basics/20-weather/index.html +++ b/01-basics/20-weather/index.html @@ -11,3 +11,4 @@ + From 305280415f91851e6abb98891b5a3095d3eb09ed Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Sun, 29 Dec 2024 22:59:32 +0300 Subject: [PATCH 3/8] 00 intro --- 01-basics/20-weather/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/01-basics/20-weather/index.html b/01-basics/20-weather/index.html index 45be4cb..f3b1027 100644 --- a/01-basics/20-weather/index.html +++ b/01-basics/20-weather/index.html @@ -12,3 +12,4 @@ + From cc38f48880065c5fc3d7e5c415c2b07a88d12995 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Sun, 29 Dec 2024 23:51:17 +0300 Subject: [PATCH 4/8] create app 2 --- 01-basics/10-create-app/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-basics/10-create-app/script.js b/01-basics/10-create-app/script.js index 780627c..2f12f93 100644 --- a/01-basics/10-create-app/script.js +++ b/01-basics/10-create-app/script.js @@ -8,7 +8,7 @@ const App = defineComponent({ var day = new Date(); return { - today: day.toLocaleDateString('ru-RU', { dateStyle: 'long' }) + today: day.toLocaleDateString('en-US', { dateStyle: 'long' }) } }, From 6165bf35ad7db7c045e4cb5d15b9ed17cb9e51f0 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Mon, 30 Dec 2024 22:24:39 +0300 Subject: [PATCH 5/8] c-a2 --- 01-basics/20-weather/WeatherApp.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/01-basics/20-weather/WeatherApp.js b/01-basics/20-weather/WeatherApp.js index a2b6461..feefa4a 100644 --- a/01-basics/20-weather/WeatherApp.js +++ b/01-basics/20-weather/WeatherApp.js @@ -14,16 +14,8 @@ export default defineComponent({ return parseInt(Math.round(hPa*0.75)); } - function isNight(currentHourText, sunriseArrayText, sunsetArrayText) { - - var currentHourArray = currentHourText.split(":"); - var sunriseArray = sunriseArrayText.split(":") - var sunsetArray = sunsetArrayText.split(":") - - const currentHour = currentHourArray[0]*60+currentHourArray[1] - const sunrise = sunriseArray[0]*60+sunriseArray[1] - const sunset = sunsetArray[0]*60+sunsetArray[1] - + function isNight(currentHour, sunrise, sunset) { + return currentHour < sunrise && currentHour > sunset; } From 77c12f98f6a1ce3a3b1a553a90a012c09c8873cf Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Mon, 30 Dec 2024 23:13:27 +0300 Subject: [PATCH 6/8] s --- 01-basics/10-create-app/script.js | 2 +- 01-basics/20-weather/WeatherApp.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/01-basics/10-create-app/script.js b/01-basics/10-create-app/script.js index 2f12f93..784082a 100644 --- a/01-basics/10-create-app/script.js +++ b/01-basics/10-create-app/script.js @@ -8,7 +8,7 @@ const App = defineComponent({ var day = new Date(); return { - today: day.toLocaleDateString('en-US', { dateStyle: 'long' }) + today: day.toLocaleDateString('navigator.language', { dateStyle: 'long' }) } }, diff --git a/01-basics/20-weather/WeatherApp.js b/01-basics/20-weather/WeatherApp.js index feefa4a..a0d2370 100644 --- a/01-basics/20-weather/WeatherApp.js +++ b/01-basics/20-weather/WeatherApp.js @@ -34,22 +34,22 @@ export default defineComponent({

Погода в Средиземье

    -
  • +
  • ⚠️ - {{data.alert.sender_name}}:{{data.alert.description}} + {{ data.alert.sender_name }}:{{ data.alert.description }}

    - {{data.geographic_name}} + {{ data.geographic_name }}

    - {{data.current.dt}} + {{ data.current.dt }}
    {{WeatherConditionIcons[data.current.weather.id]}}
    -
    {{convertToCelsius( data.current.temp )}} °C
    +
    {{ convertToCelsius( data.current.temp ) }} °C
    @@ -59,15 +59,15 @@ export default defineComponent({
    Влажность, %
    -
    {{data.current.humidity}}
    +
    {{ data.current.humidity }}
    Облачность, %
    -
    {{data.current.clouds}}
    +
    {{ data.current.clouds }}
    Ветер, м/с
    -
    {{data.current.wind_speed}}
    +
    {{ data.current.wind_speed }}
  • From 50aec1e0ecd4ae884d5e205e3920e1f47f5be677 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Mon, 30 Dec 2024 23:43:55 +0300 Subject: [PATCH 7/8] correction --- 01-basics/10-create-app/index.html | 2 +- 01-basics/10-create-app/script.js | 2 +- 01-basics/20-weather/WeatherApp.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/01-basics/10-create-app/index.html b/01-basics/10-create-app/index.html index cf7b57d..5de2d87 100644 --- a/01-basics/10-create-app/index.html +++ b/01-basics/10-create-app/index.html @@ -5,7 +5,7 @@ createApp -
    +
    hi
    diff --git a/01-basics/10-create-app/script.js b/01-basics/10-create-app/script.js index 784082a..9a48e0f 100644 --- a/01-basics/10-create-app/script.js +++ b/01-basics/10-create-app/script.js @@ -16,4 +16,4 @@ const App = defineComponent({
    Сегодня {{ today }}
    ` }); -createApp(App).mount('#app'); \ No newline at end of file +createApp(App).mount('#app'); diff --git a/01-basics/20-weather/WeatherApp.js b/01-basics/20-weather/WeatherApp.js index a0d2370..4343d80 100644 --- a/01-basics/20-weather/WeatherApp.js +++ b/01-basics/20-weather/WeatherApp.js @@ -15,8 +15,8 @@ export default defineComponent({ } function isNight(currentHour, sunrise, sunset) { - - return currentHour < sunrise && currentHour > sunset; + + return currentHour < sunrise || currentHour > sunset; } @@ -34,7 +34,7 @@ export default defineComponent({

    Погода в Средиземье

      -
    • +
    • ⚠️ {{ data.alert.sender_name }}:{{ data.alert.description }} From 90e78bf9fbe2787b17ecf35a3724d4552cdce815 Mon Sep 17 00:00:00 2001 From: VolgaMashchytskaya Date: Thu, 9 Jan 2025 22:33:52 +0300 Subject: [PATCH 8/8] Solve sum --- 01-basics/20-weather/WeatherApp.js | 2 +- 02-basics-2/10-counter/CounterApp.js | 33 ++++++++++++--- 02-basics-2/20-broken-map/MapApp.js | 18 +++------ 02-basics-2/30-calculator/CalculatorApp.js | 47 +++++++++++++++++----- 4 files changed, 72 insertions(+), 28 deletions(-) diff --git a/01-basics/20-weather/WeatherApp.js b/01-basics/20-weather/WeatherApp.js index 4343d80..32cee0d 100644 --- a/01-basics/20-weather/WeatherApp.js +++ b/01-basics/20-weather/WeatherApp.js @@ -16,7 +16,7 @@ export default defineComponent({ function isNight(currentHour, sunrise, sunset) { - return currentHour < sunrise || currentHour > sunset; + return currentHour < sunrise ||currentHour > sunset; } diff --git a/02-basics-2/10-counter/CounterApp.js b/02-basics-2/10-counter/CounterApp.js index e0d3101..902a9a7 100644 --- a/02-basics-2/10-counter/CounterApp.js +++ b/02-basics-2/10-counter/CounterApp.js @@ -1,22 +1,45 @@ -import { defineComponent } from 'vue' +import { couldStartTrivia } from 'typescript'; +import { defineComponent, ref } from 'vue' export default defineComponent({ name: 'CounterApp', - setup() {}, + setup() { + + const count = ref (0); + + function decrement(){ + count.value--; + + } + + function increment(){ + count.value++; + } + + return { + + decrement, + increment, + count + + }; + }, + + template: `
      - - 0 + {{ count }} -