How to Create The Apple Watch Breathe App Animation with CSS

How to Create The Apple Watch Breathe App Animation with CSS

The Apple Watch comes with a stock app called Breathe that reminds you to… breathe. There’s actually more to it than that, it’s a self wellness app of sorts, that reminds you to take a brief moment out of your stressful day and focus on your breathing to encourage relaxation. Additionally, the app has a minimalistic interface with a nice animation.

I thought it would be fun (and relaxing) to recreate the design, particularly in vanilla CSS. Here’s how far I got, which feels pretty close.

 

Making the circles

First things first, we need a set of circles that make up that flower looking design. The app itself adds a circle to the layout for each minute that is added to the timer, but we’re going to stick with a static set of six for this demo. It feels like we could get tricky by using ::before and ::after to reduce the HTML markup, but we can keep it simple.

<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>

We’re going to make the full size of each circle 125px which is an arbitrary number. The important thing is that the default state of the circles should be all of them stacked on top of one another. We can use absolute positioning to do that.

.circle {
  border-radius: 50%;
  height: 125px;
  position: absolute;
  transform: translate(0, 0);
  width: 125px;
}

Note that we’re using the translate function of the transform property to center everything. I had originally tried using basic top, right, bottom, left properties but found later that animating translate is much smoother. I also originally thought that positioning the circles in the full expanded state would be the best place to start, but also found that the animations were cumbersome to create that way because it required resetting each one to center. Lessons learned!

If we were to stop here, there would be nothing on the screen and that’s because we have not set a background color. We’ll get to the nice fancy colors used in the app in a bit, but it might be helpful to add a white background for now with a hint of opacity to help see what’s happening as we work.

 

We need a container!

You may have noticed that our circles are nicely stacked, but nowhere near the actual center of the viewport. We’re going to need to wrap these bad boys in a parent element that we can use to position the entire bunch. Plus, that container will serve as the element that pulses and rotates the entire set later. That was another lesson I had to learn the hard way because I stubbornly did not want the extra markup of a container and thought I could work around it.

We’re calling the container .watch-face here and setting it to the same width and height as a single circle.

<div class="watch-face">
  <div class="circle"></div>
  <div class="circle"></div>
  <div class="circle"></div>
  <div class="circle"></div>
  <div class="circle"></div>
  <div class="circle"></div>
</div>

Now, we can add a little flex to the body element to center everything up.

body {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

 

Next up, animate the circles

At this point, I was eager to see the circles positioned in that neat floral, overlapping arrangement. I knew that it would be difficult to animate the exact position of each circle without seeing them positioned first, so I overrode the transform property in each circle to see where they’d land.

We could set up a class for each circle, but using :nth-child seems easier.

.circle:nth-child(1) {
  transform: translate(-35px, -50px);
}

/* Skipping 2-5 for brevity... */

.circle:nth-child(6) {
  transform: translate(35px, 50px);
}

It took me a few swings and misses to find coordinates that worked. It ultimately depends on the size of the circles and it may take some finessing.

 

Armed with the coordinates, we can register the animations. I removed the transform coordinates that were applied to each :nth-child and moved them into keyframes:

@keyframes circle-1 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-35px, -50px);
  }
}

/* And so on... */

I have to admit that the way I went about it feels super clunky because each circle has it’s own animation. It would be slicker to have one animation that can rule them all to push and re-center the circles, but maybe someone else reading has an idea and can share it in the comments.

Now we can apply those animations to each :nth-child in place of transform:

.circle:nth-child(1) {
  animation: circle-1 4s ease alternate infinite;
}

/* And so on... */

Note that we set the animation-timing-function to ease because that feels smooth…at least to me! We also set the animation-direction to alternate so it plays back and forth and set the animation-iteration-count to inifinite so it stays running.

 

Color, color, color!

Oh yeah, let’s paint this in! From what I can tell, there are really only two colors in the design and the opacity is what makes it feel like more of a spectrum.

The circles on the left are a greenish color and the ones on the right are sorta blue. We can select the odd-numbered circles to apply the green and the even-numbered ones to apply the blue.

.circle:nth-child(odd) {
  background: #61bea2;
}

.circle:nth-child(even) {
  background: #529ca0;
}

Oh, and don’t forget to remove the white background from the .circle element. It won’t hurt anything, but it’s nice to clean up after ourselves. I admittedly forgot to do this on the first go.

 

It’s also at this point that others in the comments have suggested that replacing opacityfor mix-blend-mode with a value of screen makes for a nicer way to blend the colors of the circles. I’ve since updated the demos and the code.

Pulse and rotate

Remember that pesky .watch-face container we created? Well, we can animate it to pulse the circles in and out while rotating the entire bunch.

I had totally forgotten that transform functions can be chained together. That makes things a little cleaner because it allows us to apply scale() and rotate() on the same line.

@keyframes pulse {
  0% {
    transform: scale(.15) rotate(180deg);
  }
  100% {
    transform: scale(1);
  }
}

…and apply that to the .watch-face element.

.watch-face {
  height: 125px;
  width: 125px;
  animation: pulse 4s cubic-bezier(0.5, 0, 0.5, 1) alternate infinite;
}

Like the circles, we want the animation to run both ways and repeat infinitely. In this case, the scale drops to a super small size as the circles stack on top of each other and the whole thing rotates halfway on the way out before returning back on the way in.

I’ll admit that I am not a buff when it comes to finding the right animation-timing-function for the smoothest or exact animations. I played with cubic-bezier and found something I think feels pretty good, but it’s possible that a stock value like ease-in would work just as well.

All together now!

Here’s everything smushed into the same demo.

 

If you’re having a stressful day, even you don’t have an apple watch, you can gaze into the CSS animation you’ve created and lull yourself into tranquility.

Make sure you don’t keep all of this peacefulness to yourself, and pass along your newly discovered knowledge. 

For all things Apple, check out all of our latest Apple related guides.

references: apple, css tricks, codepen, mozilla

Advertisements
APPLE TV+ HAS ARRIVED, IS IT ANY GOOD?

APPLE TV+ HAS ARRIVED, IS IT ANY GOOD?

THERE ARE SECRETS, and then there are terribly kept secrets. Since the middle of 2017, when Apple hired two presidents away from Sony Pictures Television to oversee “video programming,” its Hollywood aspirations have fallen in the latter category. Yet, despite a steady thrum of news and rumors since then—including a spate of last-minute stories—no one outside the company and its creators has known exactly.

Did Apple want to build itself into a studio/network hybrid like HBO? Would it emulate Netflix by combining original shows with a library of licensed content? Would its original shows be available alongside live TV, as with Hulu? Or would it be like YouTube TV, offering still more programming for cord-cutters?

The answer, as with most things Apple, is a little bit of what other companies have done, packaged up with just enough twists to feel like something new.

At the Steve Jobs theater in Cupertino last monday morning, Apple announced an overhaul of its TV services (along with a lot of other services around news, gaming, and finance). As before, it aggregates shows from streaming services and iTunes purchases—but the new overhaul introduces Apple TV Channels, an à la carte structure that lets you subscribe to single premium networks like HBO, Showtime, and CBS All Access. “For some of us,” said Peter Stern, Apple’s VP of services, “the big bundle is more than we need.” Apple being Apple, TV (the app, not the TV) will suggest new shows you might enjoy, and play trailers and access other information, all from inside the app.

But like everything else announced at the event, this service has a premium tier as well. Apple TV+, which launches this fall, will give subscribers access to the many shows the company has been developing. The Apple Originals roster, partially unveiled via an introductory video aired during the event, is full of bold-faced names: Steven Spielberg, J.J. Abrams, M. Night Shyamalan, Ron Howard, Sofia Coppola, Octavia Spencer, Reese Witherspoon, Jennifer Aniston, Damien Chazelle.

Yet while many of those faces showed up in the sizzle reel, they didn’t show up in any actual footage from the shows they’re making. Spielberg appeared in person to tease the existence of his Amazing Stories reboot, and even reveal a few episode premises, but showed no video evidence of their existence. The same went for Reese Witherspoon and Jennifer Aniston’s project The Morning Show, based on Brian Stelter’s book of the same name. Jason Momoa and Alfre Woodard’s show See? Same thing. Kumail Nanjiani teased his and Emily Gordon’s anthology series Little America, and Abrams and Sara Bareilles plugged their show, Little Voice. Big Bird(!) clucked about a new coding-heavy children’s show called Helpers. And, yes, Oprah Winfrey was on hand herself to describe two documentary projects she’s involved with. Plenty of description, but not a single moving image, save for a single teaser that stitched together bite-sized snippets of those shows and more.

On paper, it’s obvious that Apple went to the biggest names they could—even if some of those names weren’t mentioned out loud at all. But the company faces a few distinct challenges in the venture. One is the depth of its buy-in. Despite the high-profile names attached to its projects, its $2 billion programming spend is little more than an impulse buy in the streaming race: Netflix spent six times that on content in 2018. When you have $245 billion cash on hand the way Apple does, dropping less than a percent of it seems too little, too late.

There’s also the company’s reported insistence that its shows be family-friendly. As the Wall Street Journal and Bloomberg have both reported, Tim Cook himself has pushed back against violence and sex in Apple programming, even canceling a show based on Dr. Dre’s life. Add to that the fact that Apple has allegedly rankled creators with its feedback, and you begin to get a sense that applying Apple rules to a non-Apple industry isn’t always as easy as convincing record labels to sell songs for 99 cents. When Netflix famously gives its creators unparalleled creative leeway (if not usable viewership metrics), being seen as a difficult partner could put a crimp in future collaborations.

Then again, this isn’t trying to dethrone Netflix or Amazon. As with News+, Apple Arcade, or the newly announced Apple Card, the company is trying bring more of its users inside the walled garden. It’s warm and safe in there, convenient too—but most importantly, it’s somewhere those other competitors can’t tread.

Besides, having access to 1.4 billion screens—that’s the number of Apple devices in the market today, though you could knock off a few for Apple Watches—soothes a lot of Hollywood heartburn. “Apple’s in a billion pockets, y’all,” Winfrey said to the audience. “A billion pockets!” With creators like her attached to the venture, others are sure to follow.

If you’re not sure about Apple + just yet, here’s something below (Spielberg, Susan Lacy _ 92% Tomatometer) possibly worth watching via itunes:

references: apple, wired, wall street journal, cnbc, forbes

Apple Cancels the Airpower Wireless Charging Mat

Apple Cancels the Airpower Wireless Charging Mat

Apple has canceled its AirPower wireless charger, citing difficulty in achieving the company’s “high standards” for the product, via TechCrunch.

“After much effort, we’ve concluded AirPower will not achieve our high standards and we have cancelled the project. We apologize to those customers who were looking forward to this launch. We continue to believe that the future is wireless and are committed to push the wireless experience forward,” said Apple SVP of hardware engineering Dan Riccio in a statement.

The AirPower charging mat was first announced during the company’s iPhone X event back in September 2017 when Apple unveiled wireless charging as one of the new features for the iPhone X. At the time, Apple said it would ship sometime in 2018, but then the company went silent for 18 months without shipping the device.

Apple had promised some interesting features for the AirPower charger, including the ability to charge up to three devices at once (specifically, an Apple Watch, AirPod headphones, and an iPhone), unique technology with multiple coils that would let the charger work without having to find an exact sweet spot on the pad, and a software overlay for the iPhone to display the current charge for all three devices at once. 

Option: High Quality Wireless Charger from RavPower (Amazon.com)

Since then, there have been numerous reports about engineering challenges and overheating issues (specifically related to the multi-coil design) during the product’s development. But there were also some signs of hope: Apple had mentioned the unreleased AirPower in some packaging materials, and it’s shown on the box of the new AirPods wireless charging case. Earlier this month, The Wall Street Journal reported that Apple had given the thumbs up for AirPower to enter mass production. But now, more than 550 days after being announced, it seems that the product will never ship.

references: techcrunch, wall street journal, the verge, apple

What is the Apple Card and How Do I Get it?

What is the Apple Card and How Do I Get it?

With its latest product, Apple wants your money. But it also wants to be your personal finance coach. The company is pitching the Apple Card as a way to “help customers lead a healthier financial life,” mostly through an intuitive app interface, a lack of fees and a unique new payment structure. The Card, issued in partnership with Goldman Sachs, does appear to give consumers greater control and understanding of their debt. But it’s also another way to keep users stuck in the Apple walled garden — how can you switch to Android when you owe thousands on your Apple Card?

The benefits for Apple are clear, but there’s a potential upside for users too. More and more people are drawn to the convenience of mobile wallets, and replacing your credit card with your iPhone seems like a natural evolution. Apple’s promises about transparency, privacy and security are very alluring, and it’s encouraging to see a tech titan take on an industry that’s historically taken advantage of consumer confusion. But before you get too excited or angry about the Card, there are some important issues to discuss.

What is it exactly, and how can I get my hands on it?

Basically, it’s a credit card. But it’s different from conventional cards in that you don’t need a piece of plastic before you can start using it. You can sign up from your iPhone, get approved in minutes and use it immediately via Apple Pay. The company will send you a physical card (which Apple crafts from titanium) for times when you need one, like for starting a tab at a bar or to pay a merchant that doesn’t take Apple Pay. You can get it for free, and it’ll arrive in the mail within two days.

This dramatically reduces the amount of time spent waiting on approval and access to your credit. Apple also promised not to charge late fees or international transaction fees or to even set a minimum payment. Interest rates are supposedly lower than on other cashback cards, ranging between 13.24 and 24.24 percent (current rates set by the Fed), and are determined by your creditworthiness.

What about those cashback offers?

Compared with existing cards, Apple’s rewards and cashback offers are underwhelming. Sure, the 3 percent return on Apple products is higher than the industry average, but it’s incredibly limited on where you can earn. Plus, the 1 percent on physical card purchases and 2 percent on Apple Pay transactions simply can’t compete. “[Those rates] won’t sway customers away from competing products, such as Citi Double Cash, which ultimately offers 2 percent back on every purchase,” according to Zach Honig, editor-at-large at The Points Guy.

Apple Card cash

What is nice is about Apple’s Daily Cash program is that you can (basically) immediately use the money you get back. The rewards are collected on a cash card, and you can get this out via your bank account or use the dollars on things like apps, songs, movies and online shopping, or even pay your friends. The rewards hit the card daily, so you can accumulate money more quickly instead of having to wait weeks to spend what you’ve earned. There’s also no cap on how much Daily Cash you can accrue.

What happens when I lose that physical card or my iPhone?

Since the titanium card doesn’t show your credit card number, expiration date or signature, it makes it harder to steal your information. But because all it has is your name, anyone with your card could potentially take it and start spending. You’d have to be quick to lock your card when you realize it’s missing to avoid letting a thief rack up huge transactions. If you’ve only temporarily misplaced your card, you can unlock your account once you’ve retrieved it.

Compared with a traditional card, this is more convenient than calling your bank to get it canceled. But service providers like Capital One have already been making it easier to keep track of your card and suspend your account at will, so Apple isn’t breaking new ground here.

If you lose your iPhone, you’ll need to go to a computer and sign into your iCloud to find it. The good news is that Apple Pay transactions will still require your Face ID or fingerprint authorization, but payments with the physical card won’t. What’s also nice is that when your replacement phone arrives, all you have to do is sign into your Apple account, and your Card information automatically transfers over, too.

How will Apple help me lead a healthier financial life?

The most appealing thing about the Apple Card is its user-friendly dashboard. Apple said it will use on-device machine learning and GPS information to identify and categorize your transactions. It’ll also color-code your spending and use charts to show you where you drop the most money.

This isn’t new; there are plenty of services available to track your expenditures and make sense of your habits, Mint being the most well known. But at first glance, Apple’s interface appears to be easier to use and understand.

Having all this information in front of you might not change your behavior at all. As with Apple’s and Google’s digital well-being services that show you how much time you waste in certain apps, the goal is more about educating the user. It’s entirely up to you to limit how much money you spend drinking at bars, but at least you’ll have the data.

Apple Card spend

Another way Apple says it’s helping you make better financial decisions is by making your payments easier to understand. Since there are no late fees and no minimum payments, finance experts are concerned that there’s nothing stopping people from taking forever to repay their debts. The only thing scaring you into paying on time is the fact that the longer you drag it out, the more you will owe.

The Apple Card dashboard should make this concept painfully clear. It’s supposed to show how small increases in your monthly payments can lower your overall interest owed via an interactive animated wheel. When you need help understanding how much you should pay, you can also text or call a support operator, which is pretty convenient.

One thing remains unclear, though. Since Apple hasn’t set a limit on how long you can go without making any payments, you could theoretically get away with never clearing your debt.

What about the security and privacy of these transactions?

It should be pretty clear to anyone by now that all our credit card purchases are being used to target ads to us. But Apple and Goldman Sachs said they won’t sell your information for advertising or marketing purposes. (Though that doesn’t mean they won’t use your data themselves or for other purposes.)

As for the security of the payments, the Apple Card uses technology similar to that of other mobile wallets like Apple Pay, Google Pay and Samsung Pay. Each transaction is tokenized, meaning the identifying number for your card is masked and changes every time you use it. Basically, the level of security here is similar to that of existing digital payment systems. The major difference is that since you won’t have a physical card to start with, Mastercard will have to send your phone the information remotely when you set up your account. It’s not yet clear if this introduces vulnerabilities that bad actors can exploit, but Mastercard has been powering credit cards for decades and likely has safeguards against such attacks.

Apple Card

Who, if anyone, should get the Apple Card?

For first-time credit card applicants or those heavily reliant on debit, the Apple Card might make sense. “Apple’s platform will give them an opportunity to get their feet wet in a familiar ecosystem, before they, hopefully, graduate to more rewarding products,” Honig said. It’s also a good way to get into the habit of paying more than the minimum each month.

The best thing about the Apple Card, though, is the spotlight it’s shining on the importance of financial literacy. Not only does the announcement drum up media interest around the topic, but it could also encourage users to educate themselves on things like student loans and mortgages.

Like every major financial decision you make, getting an Apple Card shouldn’t be taken lightly. Managing your credit requires a great deal of responsibility and some restraint. If you’re thinking about it as yet another credit line to use on things you won’t ever be able to pay off, don’t do it. Apple may not be offering much that existing credit card companies haven’t already, but its entrance into the space will at least create healthy competition that bodes well for consumers.

references: apple, engadget

Maybe you don’t need a new credit card, but could use some free tunes?

WHICH IPAD SHOULD YOU BUY FOR 2019?

WHICH IPAD SHOULD YOU BUY FOR 2019?

Apple sells four different main iPad models, each with their own strengths. Since all these devices generally look the same, it’s important to know what you’re buying and what you should pay for it. This guide covers the best iPads available right now, and the important differences between each iPad model.

Apple iPad (9.7-Inch, 2018)

PRICE: $249

The 2018 iPad (8/10, WIRED) is the best iPad to buy, now that it supports the Original Apple Pencil. It’s thinner, lighter, gobs more powerful than Steve Jobs’ first model back in 2010, and cheaper, too. Apple’s sixth generation tablet (iPad historians might argue it’s really the “eighth” generation) has the same size 9.7-inch screen as iPads have had since the beginning, and does nearly everything you’ve ever seen an iPad do. The only downside is that it has a little more air gap (space between glass and screen) than the iPad Air, Mini, and Pro—and it lacks a keyboard Smart Connector hookup, so you’ll have to use a rechargeable Bluetooth keyboard.


Apple iPad Air (10.5-Inch, 2019)

PRICE: $469

I haven’t yet tested Apple’s 2019 iPad Air (revealed on March 18), but I don’t see any big problems on paper. Basically, it adds a fast new A12 Bionic processor in the chassis of the 10.5-inch iPad Pro that came out in 2017. So it’s the same size as most every iPad you’ve ever held, but with more screen space. If you’re a fan of Touch ID, this is now Apple’s most powerful iPad that still has a home button and fingerprint sensor. It’s also compatible with the Standard Apple Pencil and its laminated screen places the glass closer to the pixels than on the standard iPad, making it more pleasant for drawing/writing. It’s compatible with Apple’s Smart Keyboard, too.


Apple iPad Pro (10.5-inch, 2018)

PRICE: $549

iPad Pro is the absolute best iPad, but it doesn’t come cheap. Like the new iPhones, it eliminates the home button in favor of Face ID and a larger display that comes in two sizes. The 13-incher is about the size of a magazine, and wonderful for drawing, but the 11-inch model is more than enough tablet for most people. If you want to draw or write, spend the extra $129 to get the New Apple Pencil. It’s the best stylus around, and it magnetically clings to the side of the tablet where it auto-pairs with the device and charges wirelessly. The Smart Keyboard ($159 and up) is a good keyboard — just know you may still struggle to accomplish some laptop tasks on an iPad.


Apple iPad Mini (7.9-inch, 2019)

PRICE: $384

It took a few years, but Apple has finally updated the iPad Mini with a speedy new A12 Bionic processor. We haven’t yet tested the new model, but it appears nearly identical to the iPad Mini 4 — though with 64 gigabytes of storage instead of 128 GB. The big draw is the 8-inch screen, which is perfect for tiny hands and for traveling. Its thin laminated display also makes it an ideal (albeit petite) tablet for writing and drawing, thanks to its enabling of the Original Apple Pencil.


If you’re planning on purchasing an ipad and want some tunes to go with it, or you already have a device (tablet, pc, phone) and simply want 3 months of free music with over 50 millions songs to choose from with no ads, you should take advantage of the great offer apple is providing below: