19 Commits

Author SHA1 Message Date
Aye Chan
7246c2ac5f docs: update CONTRIBUTING.md 2024-11-28 23:11:30 +07:00
dscyrescotti
913feb85e3 docs: update badge style in README 2024-11-28 22:59:32 +07:00
Aye Chan
b148a4ac49 docs: update README.md 2024-11-28 22:55:08 +07:00
Aye Chan
7b12d5a17b Merge pull request #80 from dscyrescotti/docs/readme-revamp
Add roadmap section in README
2024-11-28 22:52:49 +07:00
dscyrescotti
4a593b0d7d docs: elaborate on readme 2024-11-28 22:51:26 +07:00
Aye Chan
a6a9f48053 Merge pull request #79 from dscyrescotti/docs/readme-revamp
Update README and Contributing Guideline
2024-11-28 22:15:08 +07:00
dscyrescotti
ae2df33dc3 docs: update readme 2024-11-28 22:13:05 +07:00
dscyrescotti
8c799b7973 docs: update contributing guideline 2024-11-28 22:12:51 +07:00
Aye Chan
9cf4e6ac10 docs: create contributing markdown 2024-11-28 21:47:59 +07:00
Aye Chan
a8580edd29 Merge pull request #78 from dscyrescotti/docs/readme-revamp
[Docs] Set up Github templates
2024-11-28 21:22:10 +07:00
dscyrescotti
ccbf1016d1 chore: update template 2024-11-28 21:19:01 +07:00
dscyrescotti
1e1f8b4049 chore: add pull request template 2024-11-28 21:07:25 +07:00
dscyrescotti
85c35e5a01 Merge remote-tracking branch 'origin/main' into docs/readme-revamp 2024-11-28 16:41:18 +07:00
Aye Chan
7d42d8c204 docs: add code of conduct 2024-11-28 16:39:55 +07:00
Aye Chan
de364d894b docs: set up issue templates 2024-11-28 16:35:20 +07:00
dscyrescotti
a51f9ae83c docs: add motivation 2024-11-28 15:21:13 +07:00
dscyrescotti
d4c999f90c chore: bump version number 2024-11-26 03:04:09 +07:00
Aye Chan
30efeb99db Merge pull request #75 from dscyrescotti/bug/color-picker-anchor
Fix color picker clipped by frame
2024-11-26 02:55:07 +07:00
dscyrescotti
b5287c0552 bug: fix color picker clipped by frame 2024-11-26 02:47:30 +07:00
9 changed files with 421 additions and 25 deletions

34
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[Bug]"
labels: bug
assignees: ''
---
### Description
<!-- A clear and concise description of what the bug is. -->
### Steps to reproduce
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
### Device (please complete the following information)
- OS: <!-- [e.g. iOS] -->
- Model: <!-- [e.g. iPhone13] -->
- Version <!-- [e.g. v1.0.1] -->
### Additional context
<!-- Add any other context about the problem here. -->

View File

@@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "[Dev] "
labels: enhancement
assignees: ''
---
### Backstory
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when ... -->
### Proposal
<!-- A clear and concise description of what you want to happen. -->
### Alternative
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
### Addition Context
<!-- Add any other context or screenshots about the feature request here, if applicable. -->

27
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,27 @@
### Description
<!--- REQUIRED: Describe what changed in detail -->
### Related Issues
<!--- REQUIRED: Tag all related issues (e.g. * #123) -->
<!--- If this PR resolves the issue please specify (e.g. * closes #123) -->
<!--- If this PR addresses multiple issues, these issues must be related to one other -->
* #ISSUE_NUMBER
### Checklist
<!--- Add things that are not yet implemented above -->
- [ ] I read and understood the [contributing guide](https://github.com/dscyrescotti/Memola/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/dscyrescotti/Memola/blob/main/CODE_OF_CONDUCT.md)
- [ ] The issues this PR addresses are related to each other
- [ ] My changes generate no new warnings
- [ ] My code builds and runs on my machine
- [ ] My changes are all related to the related issue above
### Screenshots
<!--- REQUIRED: if issue is UI related -->
<!--- IMPORTANT: Fill out all required fields. Otherwise we might close this PR temporarily -->

128
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
@dscyrescotti.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

70
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,70 @@
# Contributing to Memola
Be a part of Memola! Pull requests, bug reports, suggestions and any other contributions are welcomed and highly encouraged.
## Table of Contents
- [Getting Start](#getting-started)
- [Contributing](#contributing)
- [Branching](#branching)
- [Pull Request](#pull-request)
- [Feature Request](#feature-request)
- [Bug Report](#bug-report)
- [Code of Conduct](#code-of-conduct)
## Getting Started
Tap the "Fork" button on the top of the site. After forking, clone the forked repository to your Mac.
```bash
git clone https://github.com/dscyrescotti/Memola.git
cd Memola
```
Make sure you have already installed the latest Xcode and open the project.
```bash
xed Memola.xcodeproj
```
Now you are good to run the project and explore the codebase.
> [!IMPORTANT]
> You need to change the bundle identifier and run the project on a real device that supports for Metal.
> You can check Metal compatibility [here](https://support.apple.com/en-us/102894).
## Contributing
Were excited to have you contribute and be part of our projects growth! Whether youre fixing bugs, implementing new features, or suggesting improvements, your input is invaluable.
- Explore our [project board](https://github.com/users/dscyrescotti/projects/12) to find "Todo" items, feature requests, and enhancements. Choose an item that interests you and aligns with your skills. You can always ask questions if you need clarification.
- Our list of open bug issues is a great way to contribute and improve the apps stability. Browse the "Issues" tab to find bugs labeled as “bug” or “help wanted”.
- Feel free to bring your own commits for enhancements—whether its a new feature, optimization, or improvement, your input matters!
## Branching
When contributing to Memola, please follow these branching guidelines to ensure smooth collaboration:
- Always create your branches starting from the `develop` branch.
- Use a clear and descriptive name that reflects the purpose of the branch, such as:
- `feature/your-feature-name` for new features.
- `bug/issue-description` for bug fixes.
## Pull Request
Once you are happy with your changes, submit a "Pull Request" targeting the `develop` branch for review.
The pull request opens with a template loaded. Fill out all fields that are relevant.
The "Pull Request" should include following information:
* A descriptive **title** on what changed.
* A detailed **description** of changes.
* If you made changes to the UI please add a **screenshot** or **video** as well.
* If there is a related issue please add a **reference to the issue**. If not, create one beforehand and link it.
* If your PR is still in progress mark it as **Draft**.
## Feature Request
Feature requests are welcome! If you have an idea for a new feature that could enhance the apps functionality or improve the user experience, please dont hesitate to share it. However, please follow these steps when requesting a new feature:
- Do not open a duplicate feature request. Search for existing feature requests first. If you find your feature (or one very similar) previously requested, comment on that issue.
- Fully complete the provided issue template. The feature request template asks for all necessary information for us to begin a productive conversation.
- Be precise about the proposed outcome of the feature and how it relates to existing features. Include implementation details if possible.
## Bug Report
We appreciate your help in improving the project by reporting bugs! Your contributions play a vital role in maintaining the quality and functionality of the app. To ensure we can address issues effectively, please follow these steps when reporting a bug:
- Visit the "Issues" page to see if the bug has already been reported or is currently being worked on.
- If the bug hasnt been reported, click “New Issue” and provide a clear and concise title that summarizes the problem.
- Provide the detail information according to "Bug Report" template.
- If you have ideas or a potential fix, feel free to share your thoughts or even submit a pull request referencing the issue.
## Code of Conduct
Please review our [Code of Conduct](\CODE_OF_CONDUCT.md) to understand the guidelines for contributing respectfully and collaboratively. We value a community where everyone is treated with dignity, inclusivity, and respect, regardless of background or experience. Lets work together to foster a positive and supportive environment for all contributors.

View File

@@ -1386,7 +1386,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_ASSET_PATHS = "\"Memola/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HQSP3Q2MC6;
@@ -1406,7 +1406,7 @@
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
MTLLINKER_FLAGS = "";
MTL_COMPILER_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.dscyrescotti.memola.dev;
@@ -1433,7 +1433,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_ASSET_PATHS = "\"Memola/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HQSP3Q2MC6;
@@ -1453,7 +1453,7 @@
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
MTLLINKER_FLAGS = "";
MTL_COMPILER_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.dscyrescotti.memola;

View File

@@ -9,6 +9,8 @@ import SwiftUI
import Foundation
struct ColorPicker: View {
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@State private var hue: Double = 1
@State private var saturation: Double = 0
@State private var brightness: Double = 1
@@ -16,16 +18,32 @@ struct ColorPicker: View {
@Binding private var color: Color
private let size: CGFloat = 20
private let isCompact: Bool
private let boundSize: CGFloat
private let size: CGFloat = 25
init(color: Binding<Color>) {
init(color: Binding<Color>, boundSize: CGFloat, isCompact: Bool = false) {
self._color = color
self.isCompact = isCompact
self.boundSize = boundSize
}
var body: some View {
VStack(spacing: 10) {
#if os(macOS)
colorPicker
#else
if horizontalSizeClass == .regular {
colorPicker
.frame(width: 200, height: 200)
} else {
compactColorPicker
}
#endif
}
private var colorPicker: some View {
VStack(spacing: 10) {
colorPalette
.frame(width: boundSize, height: boundSize)
HStack(spacing: 10) {
hueSlider
alphaSlider
@@ -47,7 +65,29 @@ struct ColorPicker: View {
}
@ViewBuilder
private var colorPicker: some View {
private var compactColorPicker: some View {
let padding: CGFloat = 30 + (isCompact ? size * 2 + 10 : 0)
VStack(spacing: 10) {
colorPalette
.frame(width: boundSize - padding, height: boundSize - padding)
HStack(spacing: 10) {
hueSlider
alphaSlider
}
}
.padding(15)
.padding(.top, 10)
.onAppear {
let hsba = color.hsba
hue = hsba.hue
saturation = hsba.saturation
brightness = hsba.brightness
alpha = hsba.alpha * 1.43 - 0.43
}
}
@ViewBuilder
private var colorPalette: some View {
GeometryReader { proxy in
ZStack {
Color(hue: hue, saturation: 1, brightness: 1)

View File

@@ -67,7 +67,7 @@ struct PenDock: View {
compactPenItemList
.fixedSize(horizontal: false, vertical: true)
HStack(spacing: 0) {
compactPenPropertyTool
compactPenPropertyTool(bounds: proxy.frame(in: .global).size)
Divider()
.padding(.vertical, 4)
.frame(height: size)
@@ -360,9 +360,10 @@ struct PenDock: View {
@ViewBuilder
private var penPropertyTool: some View {
if let pen = tool.selectedPen {
let size: CGFloat = 250
VStack(spacing: 5) {
if pen.strokeStyle == .marker {
penColorPicker(pen)
penColorPicker(pen, bounds: .init(width: size, height: size))
}
penThicknessPicker(pen)
}
@@ -379,14 +380,14 @@ struct PenDock: View {
}
@ViewBuilder
private var compactPenPropertyTool: some View {
private func compactPenPropertyTool(bounds: CGSize) -> some View {
if let pen = tool.selectedPen {
HStack(spacing: 8) {
penThicknessPicker(pen)
.frame(width: penPropertySize)
.rotationEffect(.degrees(-90))
if pen.strokeStyle == .marker {
penColorPicker(pen)
penColorPicker(pen, bounds: bounds)
.frame(width: penPropertySize)
.transition(.move(edge: .trailing).combined(with: .opacity))
}
@@ -395,7 +396,7 @@ struct PenDock: View {
}
}
private func penColorPicker(_ pen: Pen) -> some View {
private func penColorPicker(_ pen: Pen, bounds: CGSize) -> some View {
Button {
opensColorPicker = true
} label: {
@@ -437,8 +438,45 @@ struct PenDock: View {
tool.objectWillChange.send()
}
)
ColorPicker(color: color)
.presentationCompactAdaptation(.popover)
#if os(macOS)
ColorPicker(color: color, boundSize: min(bounds.height, bounds.width))
.onDisappear {
withPersistence(\.viewContext) { context in
try context.saveIfNeeded()
}
}
#else
if horizontalSizeClass == .regular {
ColorPicker(color: color, boundSize: min(bounds.height, bounds.width))
.onDisappear {
withPersistence(\.viewContext) { context in
try context.saveIfNeeded()
}
}
} else {
compactColorPicker(color: color, bounds: bounds)
}
#endif
}
}
@ViewBuilder
func compactColorPicker(color: Binding<Color>, bounds: CGSize) -> some View {
let size = min(bounds.height, bounds.width)
if bounds.height > bounds.width {
ColorPicker(color: color, boundSize: size)
.presentationDetents([.height(size + 40)])
.presentationDragIndicator(.visible)
.onDisappear {
withPersistence(\.viewContext) { context in
try context.saveIfNeeded()
}
}
} else {
ColorPicker(color: color, boundSize: size, isCompact: true)
.presentationCompactAdaptation(.sheet)
.presentationDetents([.large])
.presentationDragIndicator(.visible)
.onDisappear {
withPersistence(\.viewContext) { context in
try context.saveIfNeeded()

View File

@@ -1,29 +1,68 @@
<div align="center">
<img width="30%" src="Assets/app-logo.png">
<img width="25%" src="Assets/app-logo.png">
<h1>
Memola
</h1>
<div>
<a href="https://apps.apple.com/app/memola/id6738171174">
<img height="40px" src="Assets/ios-app-store.svg">
<img height="35px" src="Assets/ios-app-store.svg">
</a>
<a href="https://apps.apple.com/app/memola/id6738171174">
<img height="40px" src="Assets/mac-app-store.svg">
<img height="35px" src="Assets/mac-app-store.svg">
</a>
</div>
</div>
<br>
**Memola** is an open-source note-taking application, fully built using the Metal framework, allowing you to seamlessly jot down ideas and sketch your visions across iOS, iPadOS, and macOS.
<p>
<img src="https://img.shields.io/badge/iOS-17+-blue.svg" />
<img src="https://img.shields.io/badge/macOS-14+-blue.svg" />
<a href="https://github.com/dscyrescotti/Memola/releases/latest">
<img src="https://img.shields.io/github/v/release/dscyrescotti/Memola?color=green&label=latest%20release&sort=semver&style=flat-round" />
</a>
<a href="https://github.com/dscyrescotti/Memola/stargazers">
<img src="https://img.shields.io/github/stars/dscyrescotti/Memola?color=red&style=flat-round" />
</a>
<a href="https://github.com/dscyrescotti/Memola/forks">
<img src="https://img.shields.io/github/forks/dscyrescotti/Memola?style=flat-round&color=red" />
</a>
</p>
Memola is an open-source note-taking application, fully built using the Metal framework, allowing you to seamlessly jot down ideas and sketch your visions across iOS, iPadOS, and macOS.
<p align="center">
<img width="100%" src="Assets/app-demo.png">
</p>
## 👨‍💻 Contributions
**Memola** welcomes all developers to contribute if you have any idea to enhance and open an issue if you encounter any bug.
## Table of Contents
- [Motivation](#motivation)
- [Roadmap](#ro)
- [Community](#community)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
## 🙇 Credits
## Motivation
Metal is a fascinating framework where we can leverage the optimal power of GPUs through compute shaders and rendering shaders to build advanced applications powered by GPUs. This raised multiple questions like "How is the render pipeline constructed?" and "How are renders generated?" which led to an adventurous journey of crafting a 2D render engine.
That's how Memola started to dive into the world of GPU programming.
## Roadmap
Our goal for Memola is to create a fully functional open-source note-taking application built with Metal. To dive deeper into the development progress and priorities, check out the following:
- Visit the [GitHub Project](https://github.com/users/dscyrescotti/projects/12) to explore the backlog and see what tasks are in progress or planned.
- Check the [Milestones](https://github.com/dscyrescotti/Memola/milestones) section for prioritized goals and timelines to understand our development focus.
## Community
We encourage open and constructive discussions within our [GitHub Discussions](https://github.com/dscyrescotti/Memola/discussions) to help improve the project, share ideas, and address challenges together. Whether youre looking for help, proposing new features, or sharing your insights, our community is here to collaborate and grow.
## Contributing
Memola welcomes all developers to contribute! Share your enhancement ideas or report bugs by opening an issue with detailed information. Your input is invaluable to the projects success!
Before contributing, please review our [Contributing Guideline](/CONTRIBUTING.md) for more information.
## Credits
Memola wouldnt exist without the incredible work of these repositories.
- [BezierKit](https://github.com/hfutrell/BezierKit)
- [FastDraw](https://github.com/collinzrj/FastDraw)
- [hand-drawing-swift-metal](https://github.com/owengombas/hand-drawing-swift-metal)
@@ -37,5 +76,5 @@
- [Sketch](https://github.com/daihase/Sketch)
- [THST](https://github.com/tuxalin/THST)
## © License
**Memola** is available under the MIT license. See the [LICENSE](/LICENSE) file for more info.
## License
Memola is available under the MIT license. See the [LICENSE](/LICENSE) file for more info.