You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

App.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <!--
  2. - @copyright Copyright (c) 2020 Julien Veyssier <eneiluj@posteo.net>
  3. - @author Julien Veyssier <eneiluj@posteo.net>
  4. -
  5. - @license GNU AGPL version 3 or any later version
  6. -
  7. - This program is free software: you can redistribute it and/or modify
  8. - it under the terms of the GNU Affero General Public License as
  9. - published by the Free Software Foundation, either version 3 of the
  10. - License, or (at your option) any later version.
  11. -
  12. - This program is distributed in the hope that it will be useful,
  13. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. - GNU Affero General Public License for more details.
  16. -
  17. - You should have received a copy of the GNU Affero General Public License
  18. - along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. -
  20. -->
  21. <template>
  22. <li :class="{ inline }">
  23. <div id="weather-status-menu-item">
  24. <Actions
  25. class="weather-status-menu-item__subheader"
  26. :default-icon="weatherIcon"
  27. :menu-title="currentWeatherMessage">
  28. <ActionText v-if="gotWeather"
  29. :icon="futureWeatherIcon">
  30. {{ forecastMessage }}
  31. </ActionText>
  32. <ActionLink v-if="gotWeather"
  33. icon="icon-address"
  34. target="_blank"
  35. :href="weatherLinkTarget"
  36. :close-after-click="true">
  37. {{ locationText }}
  38. </ActionLink>
  39. <ActionButton v-if="gotWeather"
  40. :icon="addRemoveFavoriteIcon"
  41. @click="onAddRemoveFavoriteClick">
  42. {{ addRemoveFavoriteText }}
  43. </ActionButton>
  44. <ActionSeparator v-if="address && !errorMessage" />
  45. <ActionButton
  46. icon="icon-crosshair"
  47. :close-after-click="true"
  48. @click="onBrowserLocationClick">
  49. {{ t('weather_status', 'Detect location') }}
  50. </ActionButton>
  51. <ActionInput
  52. ref="addressInput"
  53. :disabled="false"
  54. icon="icon-rename"
  55. type="text"
  56. value=""
  57. @submit="onAddressSubmit">
  58. {{ t('weather_status', 'Set custom address') }}
  59. </ActionInput>
  60. <ActionButton
  61. v-show="favorites.length > 0"
  62. :icon="toggleFavoritesIcon"
  63. @click="showFavorites = !showFavorites">
  64. {{ t('weather_status', 'Favorites') }}
  65. </ActionButton>
  66. <ActionButton v-for="f in displayedFavorites"
  67. :key="f"
  68. icon="icon-starred"
  69. @click="onFavoriteClick($event, f)">
  70. {{ f }}
  71. </ActionButton>
  72. </Actions>
  73. </div>
  74. </li>
  75. </template>
  76. <script>
  77. import { showError } from '@nextcloud/dialogs'
  78. import moment from '@nextcloud/moment'
  79. import { getLocale } from '@nextcloud/l10n'
  80. import Actions from '@nextcloud/vue/dist/Components/Actions'
  81. import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
  82. import ActionInput from '@nextcloud/vue/dist/Components/ActionInput'
  83. import ActionLink from '@nextcloud/vue/dist/Components/ActionLink'
  84. import ActionSeparator from '@nextcloud/vue/dist/Components/ActionSeparator'
  85. import ActionText from '@nextcloud/vue/dist/Components/ActionText'
  86. import * as network from './services/weatherStatusService'
  87. const MODE_BROWSER_LOCATION = 1
  88. const MODE_MANUAL_LOCATION = 2
  89. const weatherOptions = {
  90. clearsky_day: {
  91. icon: 'icon-clearsky-day',
  92. text: (temperature, unit, later = false) => later
  93. ? t('weather_status', '{temperature} {unit} clear sky later today', { temperature, unit })
  94. : t('weather_status', '{temperature} {unit} clear sky', { temperature, unit }),
  95. },
  96. clearsky_night: {
  97. icon: 'icon-clearsky-night',
  98. text: (temperature, unit, later = false) => later
  99. ? t('weather_status', '{temperature} {unit} clear sky later today', { temperature, unit })
  100. : t('weather_status', '{temperature} {unit} clear sky', { temperature, unit }),
  101. },
  102. cloudy: {
  103. icon: 'icon-cloudy',
  104. text: (temperature, unit, later = false) => later
  105. ? t('weather_status', '{temperature} {unit} cloudy later today', { temperature, unit })
  106. : t('weather_status', '{temperature} {unit} cloudy', { temperature, unit }),
  107. },
  108. fair_day: {
  109. icon: 'icon-fair-day',
  110. text: (temperature, unit, later = false) => later
  111. ? t('weather_status', '{temperature} {unit} fair weather later today', { temperature, unit })
  112. : t('weather_status', '{temperature} {unit} fair weather', { temperature, unit }),
  113. },
  114. fair_night: {
  115. icon: 'icon-fair-night',
  116. text: (temperature, unit, later = false) => later
  117. ? t('weather_status', '{temperature} {unit} fair weather later today', { temperature, unit })
  118. : t('weather_status', '{temperature} {unit} fair weather', { temperature, unit }),
  119. },
  120. partlycloudy_day: {
  121. icon: 'icon-partlycloudy-day',
  122. text: (temperature, unit, later = false) => later
  123. ? t('weather_status', '{temperature} {unit} partly cloudy later today', { temperature, unit })
  124. : t('weather_status', '{temperature} {unit} partly cloudy', { temperature, unit }),
  125. },
  126. partlycloudy_night: {
  127. icon: 'icon-partlycloudy-night',
  128. text: (temperature, unit, later = false) => later
  129. ? t('weather_status', '{temperature} {unit} partly cloudy later today', { temperature, unit })
  130. : t('weather_status', '{temperature} {unit} partly cloudy', { temperature, unit }),
  131. },
  132. fog: {
  133. icon: 'icon-fog',
  134. text: (temperature, unit, later = false) => later
  135. ? t('weather_status', '{temperature} {unit} foggy later today', { temperature, unit })
  136. : t('weather_status', '{temperature} {unit} foggy', { temperature, unit }),
  137. },
  138. lightrain: {
  139. icon: 'icon-lightrain',
  140. text: (temperature, unit, later = false) => later
  141. ? t('weather_status', '{temperature} {unit} light rain later today', { temperature, unit })
  142. : t('weather_status', '{temperature} {unit} light rain', { temperature, unit }),
  143. },
  144. rain: {
  145. icon: 'icon-rain',
  146. text: (temperature, unit, later = false) => later
  147. ? t('weather_status', '{temperature} {unit} rain later today', { temperature, unit })
  148. : t('weather_status', '{temperature} {unit} rain', { temperature, unit }),
  149. },
  150. heavyrain: {
  151. icon: 'icon-heavyrain',
  152. text: (temperature, unit, later = false) => later
  153. ? t('weather_status', '{temperature} {unit} heavy rain later today', { temperature, unit })
  154. : t('weather_status', '{temperature} {unit} heavy rain', { temperature, unit }),
  155. },
  156. rainshowers_day: {
  157. icon: 'icon-rainshowers-day',
  158. text: (temperature, unit, later = false) => later
  159. ? t('weather_status', '{temperature} {unit} rain showers later today', { temperature, unit })
  160. : t('weather_status', '{temperature} {unit} rain showers', { temperature, unit }),
  161. },
  162. rainshowers_night: {
  163. icon: 'icon-rainshowers-night',
  164. text: (temperature, unit, later = false) => later
  165. ? t('weather_status', '{temperature} {unit} rain showers later today', { temperature, unit })
  166. : t('weather_status', '{temperature} {unit} rain showers', { temperature, unit }),
  167. },
  168. lightrainshowers_day: {
  169. icon: 'icon-light-rainshowers-day',
  170. text: (temperature, unit, later = false) => later
  171. ? t('weather_status', '{temperature} {unit} light rain showers later today', { temperature, unit })
  172. : t('weather_status', '{temperature} {unit} light rain showers', { temperature, unit }),
  173. },
  174. lightrainshowers_night: {
  175. icon: 'icon-light-rainshowers-night',
  176. text: (temperature, unit, later = false) => later
  177. ? t('weather_status', '{temperature} {unit} light rain showers later today', { temperature, unit })
  178. : t('weather_status', '{temperature} {unit} light rain showers', { temperature, unit }),
  179. },
  180. heavyrainshowers_day: {
  181. icon: 'icon-heavy-rainshowers-day',
  182. text: (temperature, unit, later = false) => later
  183. ? t('weather_status', '{temperature} {unit} heavy rain showers later today', { temperature, unit })
  184. : t('weather_status', '{temperature} {unit} heavy rain showers', { temperature, unit }),
  185. },
  186. heavyrainshowers_night: {
  187. icon: 'icon-heavy-rainshowers-night',
  188. text: (temperature, unit, later = false) => later
  189. ? t('weather_status', '{temperature} {unit} heavy rain showers later today', { temperature, unit })
  190. : t('weather_status', '{temperature} {unit} heavy rain showers', { temperature, unit }),
  191. },
  192. }
  193. export default {
  194. name: 'App',
  195. components: {
  196. Actions, ActionButton, ActionInput, ActionLink, ActionSeparator, ActionText,
  197. },
  198. props: {
  199. inline: {
  200. type: Boolean,
  201. default: false,
  202. },
  203. },
  204. data() {
  205. return {
  206. locale: getLocale(),
  207. loading: true,
  208. errorMessage: '',
  209. mode: MODE_BROWSER_LOCATION,
  210. address: null,
  211. lat: null,
  212. lon: null,
  213. // how many hours ahead do we want to see the forecast?
  214. offset: 5,
  215. forecasts: [],
  216. loop: null,
  217. favorites: [],
  218. showFavorites: false,
  219. }
  220. },
  221. computed: {
  222. useFahrenheitLocale() {
  223. return ['en_US', 'en_MH', 'en_FM', 'en_PW', 'en_KY', 'en_LR'].includes(this.locale)
  224. },
  225. temperatureUnit() {
  226. return this.useFahrenheitLocale ? '°F' : '°C'
  227. },
  228. locationText() {
  229. return t('weather_status', 'More weather for {adr}', { adr: this.address })
  230. },
  231. temperature() {
  232. return this.getTemperature(this.forecasts, 0)
  233. },
  234. futureTemperature() {
  235. return this.getTemperature(this.forecasts, this.offset)
  236. },
  237. weatherCode() {
  238. return this.getWeatherCode(this.forecasts, 0)
  239. },
  240. futureWeatherCode() {
  241. return this.getWeatherCode(this.forecasts, this.offset)
  242. },
  243. weatherIcon() {
  244. return this.getWeatherIcon(this.weatherCode, this.loading)
  245. },
  246. futureWeatherIcon() {
  247. return this.getWeatherIcon(this.futureWeatherCode, this.loading)
  248. },
  249. /**
  250. * The message displayed in the top right corner
  251. *
  252. * @returns {String}
  253. */
  254. currentWeatherMessage() {
  255. if (this.loading) {
  256. return t('weather_status', 'Loading weather')
  257. } else if (this.errorMessage) {
  258. return this.errorMessage
  259. } else {
  260. return this.getWeatherMessage(this.weatherCode, this.temperature)
  261. }
  262. },
  263. forecastMessage() {
  264. if (this.loading) {
  265. return t('weather_status', 'Loading weather')
  266. } else {
  267. return this.getWeatherMessage(this.futureWeatherCode, this.futureTemperature, true)
  268. }
  269. },
  270. weatherLinkTarget() {
  271. return 'https://www.windy.com/-Rain-thunder-rain?rain,' + this.lat + ',' + this.lon + ',11'
  272. },
  273. gotWeather() {
  274. return this.address && !this.errorMessage
  275. },
  276. addRemoveFavoriteIcon() {
  277. return this.currentAddressIsFavorite
  278. ? 'icon-starred'
  279. : 'icon-star'
  280. },
  281. addRemoveFavoriteText() {
  282. return this.currentAddressIsFavorite
  283. ? t('weather_status', 'Remove from favorites')
  284. : t('weather_status', 'Add as favorite')
  285. },
  286. currentAddressIsFavorite() {
  287. return this.favorites.find((f) => {
  288. return f === this.address
  289. })
  290. },
  291. toggleFavoritesIcon() {
  292. return this.showFavorites
  293. ? 'icon-triangle-s'
  294. : 'icon-triangle-e'
  295. },
  296. displayedFavorites() {
  297. return this.showFavorites
  298. ? this.favorites
  299. : []
  300. },
  301. },
  302. mounted() {
  303. this.initWeatherStatus()
  304. },
  305. methods: {
  306. async initWeatherStatus() {
  307. try {
  308. const loc = await network.getLocation()
  309. this.lat = loc.lat
  310. this.lon = loc.lon
  311. this.address = loc.address
  312. this.mode = loc.mode
  313. if (this.mode === MODE_BROWSER_LOCATION) {
  314. this.askBrowserLocation()
  315. } else if (this.mode === MODE_MANUAL_LOCATION) {
  316. this.startLoop()
  317. }
  318. const favs = await network.getFavorites()
  319. this.favorites = favs
  320. } catch (err) {
  321. if (err?.code === 'ECONNABORTED') {
  322. console.info('The weather status request was cancelled because the user navigates.')
  323. return
  324. }
  325. if (err.response && err.response.status === 401) {
  326. showError(t('weather_status', 'You are not logged in.'))
  327. } else {
  328. showError(t('weather_status', 'There was an error getting the weather status information.'))
  329. }
  330. console.error(err)
  331. }
  332. },
  333. startLoop() {
  334. clearInterval(this.loop)
  335. if (this.lat && this.lon) {
  336. this.loop = setInterval(() => this.getForecast(), 60 * 1000 * 60)
  337. this.getForecast()
  338. } else {
  339. this.loading = false
  340. }
  341. },
  342. askBrowserLocation() {
  343. this.loading = true
  344. this.errorMessage = ''
  345. if (navigator.geolocation && window.isSecureContext) {
  346. navigator.geolocation.getCurrentPosition((position) => {
  347. console.debug('browser location success')
  348. this.lat = position.coords.latitude
  349. this.lon = position.coords.longitude
  350. this.saveMode(MODE_BROWSER_LOCATION)
  351. this.mode = MODE_BROWSER_LOCATION
  352. this.saveLocation(this.lat, this.lon)
  353. },
  354. (error) => {
  355. console.debug('location permission refused')
  356. console.debug(error)
  357. this.saveMode(MODE_MANUAL_LOCATION)
  358. this.mode = MODE_MANUAL_LOCATION
  359. // fallback on what we have if possible
  360. if (this.lat && this.lon) {
  361. this.startLoop()
  362. } else {
  363. this.usePersonalAddress()
  364. }
  365. })
  366. } else {
  367. console.debug('no secure context!')
  368. this.saveMode(MODE_MANUAL_LOCATION)
  369. this.mode = MODE_MANUAL_LOCATION
  370. this.startLoop()
  371. }
  372. },
  373. async getForecast() {
  374. try {
  375. this.forecasts = await network.fetchForecast()
  376. } catch (err) {
  377. this.errorMessage = t('weather_status', 'No weather information found')
  378. console.debug(err)
  379. }
  380. this.loading = false
  381. },
  382. async setAddress(address) {
  383. this.loading = true
  384. this.errorMessage = ''
  385. try {
  386. const loc = await network.setAddress(address)
  387. if (loc.success) {
  388. this.lat = loc.lat
  389. this.lon = loc.lon
  390. this.address = loc.address
  391. this.mode = MODE_MANUAL_LOCATION
  392. this.startLoop()
  393. } else {
  394. this.errorMessage = t('weather_status', 'Location not found')
  395. this.loading = false
  396. }
  397. } catch (err) {
  398. if (err.response && err.response.status === 401) {
  399. showError(t('weather_status', 'You are not logged in.'))
  400. } else {
  401. showError(t('weather_status', 'There was an error setting the location address.'))
  402. }
  403. this.loading = false
  404. }
  405. },
  406. async saveLocation(lat, lon) {
  407. try {
  408. const loc = await network.setLocation(lat, lon)
  409. this.address = loc.address
  410. this.startLoop()
  411. } catch (err) {
  412. if (err.response && err.response.status === 401) {
  413. showError(t('weather_status', 'You are not logged in.'))
  414. } else {
  415. showError(t('weather_status', 'There was an error setting the location.'))
  416. }
  417. console.debug(err)
  418. }
  419. },
  420. async saveMode(mode) {
  421. try {
  422. await network.setMode(mode)
  423. } catch (err) {
  424. if (err.response && err.response.status === 401) {
  425. showError(t('weather_status', 'You are not logged in.'))
  426. } else {
  427. showError(t('weather_status', 'There was an error saving the mode.'))
  428. }
  429. console.debug(err)
  430. }
  431. },
  432. onBrowserLocationClick() {
  433. this.askBrowserLocation()
  434. },
  435. async usePersonalAddress() {
  436. this.loading = true
  437. try {
  438. const loc = await network.usePersonalAddress()
  439. this.lat = loc.lat
  440. this.lon = loc.lon
  441. this.address = loc.address
  442. this.mode = MODE_MANUAL_LOCATION
  443. this.startLoop()
  444. } catch (err) {
  445. if (err.response && err.response.status === 401) {
  446. showError(t('weather_status', 'You are not logged in.'))
  447. } else {
  448. showError(t('weather_status', 'There was an error using personal address.'))
  449. }
  450. console.debug(err)
  451. this.loading = false
  452. }
  453. },
  454. onAddressSubmit() {
  455. const newAddress = this.$refs.addressInput.$el.querySelector('input[type="text"]').value
  456. this.setAddress(newAddress)
  457. },
  458. getLocalizedTemperature(celcius) {
  459. return this.useFahrenheitLocale
  460. ? ((celcius * (9 / 5)) + 32).toFixed(1)
  461. : celcius
  462. },
  463. onAddRemoveFavoriteClick() {
  464. const currentIsFavorite = this.currentAddressIsFavorite
  465. if (currentIsFavorite) {
  466. const i = this.favorites.indexOf(currentIsFavorite)
  467. if (i !== -1) {
  468. this.favorites.splice(i, 1)
  469. }
  470. } else {
  471. this.favorites.push(this.address)
  472. }
  473. network.saveFavorites(this.favorites)
  474. },
  475. onFavoriteClick(e, favAddress) {
  476. // clicked on the icon
  477. if (e.target.classList.contains('action-button__icon')) {
  478. const i = this.favorites.indexOf(favAddress)
  479. if (i !== -1) {
  480. this.favorites.splice(i, 1)
  481. }
  482. network.saveFavorites(this.favorites)
  483. } else if (favAddress !== this.address) {
  484. // clicked on the text
  485. this.setAddress(favAddress)
  486. }
  487. },
  488. formatTime(time) {
  489. return moment(time).format('LT')
  490. },
  491. getTemperature(forecasts, offset = 0) {
  492. return forecasts.length > offset ? forecasts[offset].data.instant.details.air_temperature : ''
  493. },
  494. getWeatherCode(forecasts, offset = 0) {
  495. return forecasts.length > offset ? forecasts[offset].data.next_1_hours.summary.symbol_code : ''
  496. },
  497. getWeatherIcon(weatherCode, loading) {
  498. if (loading) {
  499. return 'icon-loading-small'
  500. } else {
  501. return weatherCode && weatherCode in weatherOptions
  502. ? weatherOptions[weatherCode].icon
  503. : 'icon-fair-day'
  504. }
  505. },
  506. getWeatherMessage(weatherCode, temperature, later = false) {
  507. return weatherCode && weatherCode in weatherOptions
  508. ? weatherOptions[weatherCode].text(
  509. this.getLocalizedTemperature(temperature),
  510. this.temperatureUnit,
  511. later
  512. )
  513. : t('weather_status', 'Set location for weather')
  514. },
  515. },
  516. }
  517. </script>
  518. <style lang="scss">
  519. .icon-weather-status {
  520. background-image: url('./../img/app-dark.svg');
  521. }
  522. body.theme--dark .icon-weather-status {
  523. background-image: url('./../img/app.svg');
  524. }
  525. .icon-clearsky-day {
  526. background-image: url('./../img/sun.svg');
  527. }
  528. .icon-clearsky-night {
  529. background-image: url('./../img/moon.svg');
  530. }
  531. .icon-cloudy {
  532. background-image: url('./../img/cloud-cloud.svg');
  533. }
  534. .icon-fair-day {
  535. background-image: url('./../img/sun-small-cloud.svg');
  536. }
  537. .icon-fair-night {
  538. background-image: url('./../img/moon-small-cloud.svg');
  539. }
  540. .icon-partlycloudy-day {
  541. background-image: url('./../img/sun-cloud.svg');
  542. }
  543. .icon-partlycloudy-night {
  544. background-image: url('./../img/moon-cloud.svg');
  545. }
  546. .icon-fog {
  547. background-image: url('./../img/fog.svg');
  548. }
  549. .icon-lightrain {
  550. background-image: url('./../img/light-rain.svg');
  551. }
  552. .icon-rain {
  553. background-image: url('./../img/rain.svg');
  554. }
  555. .icon-heavyrain {
  556. background-image: url('./../img/heavy-rain.svg');
  557. }
  558. .icon-light-rainshowers-day {
  559. background-image: url('./../img/sun-cloud-light-rain.svg');
  560. }
  561. .icon-light-rainshowers-night {
  562. background-image: url('./../img/moon-cloud-light-rain.svg');
  563. }
  564. .icon-rainshowers-day {
  565. background-image: url('./../img/sun-cloud-rain.svg');
  566. }
  567. .icon-rainshowers-night {
  568. background-image: url('./../img/moon-cloud-rain.svg');
  569. }
  570. .icon-heavy-rainshowers-day {
  571. background-image: url('./../img/sun-cloud-heavy-rain.svg');
  572. }
  573. .icon-heavy-rainshowers-night {
  574. background-image: url('./../img/moon-cloud-heavy-rain.svg');
  575. }
  576. .icon-crosshair {
  577. background-color: var(--color-main-text);
  578. padding: 0 !important;
  579. mask: url(./../img/cross.svg) no-repeat;
  580. mask-size: 18px 18px;
  581. mask-position: center;
  582. -webkit-mask: url(./../img/cross.svg) no-repeat;
  583. -webkit-mask-size: 18px 18px;
  584. -webkit-mask-position: center;
  585. min-width: 44px !important;
  586. min-height: 44px !important;
  587. }
  588. li:not(.inline) .weather-status-menu-item {
  589. &__header {
  590. display: block;
  591. align-items: center;
  592. color: var(--color-main-text);
  593. padding: 10px 12px 5px 12px;
  594. box-sizing: border-box;
  595. opacity: 1;
  596. white-space: nowrap;
  597. width: 100%;
  598. text-align: center;
  599. max-width: 250px;
  600. text-overflow: ellipsis;
  601. min-width: 175px;
  602. }
  603. &__subheader {
  604. width: 100%;
  605. .trigger > .icon {
  606. background-color: var(--color-main-background);
  607. background-size: 16px;
  608. border: 0;
  609. border-radius: 0;
  610. font-weight: normal;
  611. padding-left: 40px;
  612. &:hover,
  613. &:focus {
  614. box-shadow: inset 4px 0 var(--color-primary-element);
  615. }
  616. }
  617. }
  618. }
  619. .inline .weather-status-menu-item__subheader {
  620. width: 100%;
  621. .trigger > .icon {
  622. background-size: 16px;
  623. border: 0;
  624. border-radius: var(--border-radius-pill);
  625. font-weight: normal;
  626. padding-left: 40px;
  627. &.icon-loading-small {
  628. &::after {
  629. left: 21px;
  630. }
  631. }
  632. }
  633. }
  634. li {
  635. list-style-type: none;
  636. }
  637. </style>