Coder Social home page Coder Social logo

full-weatherline-widget's People

Contributors

italoboy avatar webospinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

full-weatherline-widget's Issues

Size & Cutoff

Hi. Thanks for sharing your script.

On my 11 Pro the Widget looks a bit cutoff. What do i need to change in the script to make it fit?

Thanksimage

Error type string

Hello, I got the following error massage and I don’t how to solve it:
Error on line 1799:37: Expected value of type string but got value of type undefined.

Or:

Error on line 1800:37: Expected value of type string but got value of type undefined.

Thank you for a quick help!

Menu

Add menu of useful actions.

  1. Update the code.
  2. Enter API KEY.
  3. And more ...

Transparent view

I’m trying to make the background gradient of this scriptable iOS widget more transparent but I can’t figure out how and I’m not familiar to JavaScript.

https://github.com/italoboy/Full-Weatherline-Widget

This is the code where I think the default background is generated but I don’t know how to edit this to make it less opaque.

let gradient = new LinearGradient()
 let gradientSettings = await setupGradient()
 gradient.colors = gradientSettings.color()
 gradient.locations = gradientSettings.position()  

 widget.backgroundGradient = gradient

And this should be the corresponding function that is called here.

// Set up the gradient for the widget background.
async function setupGradient() {
  
  // Requirements: sunrise
  if (!sunData) { await setupSunrise() }

  let gradient = {
    dawn: {
      color() { return [new Color("142C52"), new Color("1B416F"), new Color("62668B")] },
      position() { return [0, 0.5, 1] },
    },

    sunrise: {
      color() { return [new Color("274875"), new Color("766f8d"), new Color("f0b35e")] },
      position() { return [0, 0.8, 1.5] },
    },

    midday: {
      color() { return [new Color("3a8cc1"), new Color("90c0df")] },
      position() { return [0, 1] },
    },

    noon: {
      color() { return [new Color("b2d0e1"), new Color("80B5DB"), new Color("3a8cc1")] },
      position() { return [-0.2, 0.2, 1.5] },
    },

    sunset: {
      color() { return [new Color("32327A"), new Color("662E55"), new Color("7C2F43")] },
      position() { return [0.1, 0.9, 1.2] },
    },

    twilight: {
      color() { return [new Color("021033"), new Color("16296b"), new Color("414791")] },
      position() { return [0, 0.5, 1] },
    },

    night: {
      color() { return [new Color("16296b"), new Color("021033"), new Color("021033"), new Color("113245")] },
      position() { return [-0.5, 0.2, 0.5, 1] },
    },
  }

  const sunrise = sunData.sunrise
  const sunset = sunData.sunset

  // Use sunrise or sunset if we're within 30min of it.
  if (closeTo(sunrise)<=15) { return gradient.sunrise }
  if (closeTo(sunset)<=15) { return gradient.sunset }

  // In the 30min before/after, use dawn/twilight.
  if (closeTo(sunrise)<=45 && currentDate.getTime() < sunrise) { return gradient.dawn }
  if (closeTo(sunset)<=45 && currentDate.getTime() > sunset) { return gradient.twilight }

  // Otherwise, if it's night, return night.
  if (isNight(currentDate)) { return gradient.night }

  // If it's around noon, the sun is high in the sky.
  if (currentDate.getHours() == 12) { return gradient.noon }

  // Otherwise, return the "typical" theme.
  return gradient.midday
}

I hope someone around here can help me.

I figured out that you can add a parameter to the color function but even if I set it to 0% opacity it’ll just appear much darker.

color() { return [new Color("142C52", 0), new Color("1B416F", 0), new Color("62668B", 0)] },

Unreadable font

Hi!
I can't understand why the font doesn't change to dark during daylight hours. How can I fix it?
Thanks! The widget is very cool!
image

Medium Size Widget Support

Hello, I would love to see support for a medium size widget where the user can choose what elements to keep.

change background and font color

Hi dev,

first of all thanks you for sharing the script.

i would appreaciated if you could help me how to change the color background and the font color.

looking forward to hearing from you soon

best regards,
Minh Tam

Cache

Have api key -
Says: No cache saved for sunrise but your offline
iCloud is also connected

weatherData.daily[0] error

Getting the following error and my coding isn't good enough and I'm not confident enough to tell what needs changing here.

Error on line 1205:54: TypeError: undefined is not an object (evaluating 'weatherData.daily[0]')

Scaling is not good

Two issues:

  1. small size is not available on iPhone 12 mini.
  2. On a large widget (not sure about medium size), the name of the location on the top left and the word "Update" on the bottom right; get cut by widget size. Please scale the widget.
    Thanks.

api.met.no as source?

Hi,

thanks for your great widget!

In northern Europe the data from api.met.no is way better and more accurate that openweatermap. May I suggest to add the possibility to use this as a source, too? 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.