App.vue 19 KB

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