Add a readme

This commit is contained in:
Sami Samhuri 2020-06-25 22:16:26 -07:00
parent c413eb5da9
commit 8a014028c7
4 changed files with 27 additions and 0 deletions

View file

@ -44,6 +44,7 @@
7BBC6A6A24A5AD7300306BD5 /* NowPlayingControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingControl.swift; sourceTree = "<group>"; };
7BBC6A6C24A5AD8100306BD5 /* BatteryControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryControl.swift; sourceTree = "<group>"; };
7BBC6A6E24A5AE4400306BD5 /* LightAndDarkPreviews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightAndDarkPreviews.swift; sourceTree = "<group>"; };
7BBC6A7024A5B99C00306BD5 /* Readme.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Readme.md; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -60,6 +61,7 @@
7BBC6A1C24A4EF3400306BD5 = {
isa = PBXGroup;
children = (
7BBC6A7024A5B99C00306BD5 /* Readme.md */,
7BBC6A4424A5ABBF00306BD5 /* Sources */,
7BBC6A4324A5AB7200306BD5 /* Resources */,
7BBC6A2624A4EF3400306BD5 /* Products */,

25
Readme.md Normal file
View file

@ -0,0 +1,25 @@
# Control Center in SwiftUI
An exercise in trying to recreate macOS 11's new Control Center using SwiftUI. Created as an iOS project for no particular reason, could probably be ported to macOS easily enough as well.
This is not even close to pixel perfect and there's a lot of room for improvement. It doesn't use any visual effects to get the right blur and translucency and a lot of the fonts and colours don't match. I didn't bother tackling the sliders either as this was just for fun to learn about laying things out with SwiftUI.
The trickiest part was probably making the AirPlay and keyboard brightness controls have the correct widths, and generally trying to get the tiled controls at the top to have the correct widths and heights. I don't think it's easy to do in a general way that scales to any size, hence the [limit on the total width in ContentView](Sources/ContentView.swift). Also it's kind of obvious that I phoned in the Now Playing control and didn't even bother to see what it looks like when actually playing something. If you want to recreate it down to the fine details then there's still plenty of work left for you.
# Screenshots
Yeah sure but what's it look like?
Light mode:
[<img src="Readme/light.png" width="375">](Readme/light.png)
Dark mode:
[<img src="Readme/dark.png" width="375"/>](Readme/dark.png)
# License
Copyright &copy; 2020 Sami Samhuri <sami@samhuri.net>
Licensed under the terms of the [MIT license](https://sjs.mit-license.org).

BIN
Readme/dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
Readme/light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB