alpha
Login
or
Join now
flo-bit.dev
/
mandala
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/mandala.
flo-bit.github.io/mandala/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
small fixes
author
Florian
date
3 years ago
(Mar 27, 2023, 5:06 PM +0200)
commit
9913062f
9913062fe1bbaad88b53a9423796f959afb4d996
parent
c71306d9
c71306d96534ee40c2b9e981f5cdd9141d10eddc
+15
-7
2 changed files
Expand all
Collapse all
Unified
Split
Readme.md
script.js
+2
Readme.md
View file
Reviewed
···
20
20
- [x] load file
21
21
- [x] export file as svg/png
22
22
23
23
+
- [ ] save date with file
24
24
+
23
25
- [ ] help button
24
26
- [ ] add help modal
+13
-7
script.js
View file
Reviewed
···
420
420
this.maxBrushSize = 15;
421
421
this.minBrushSize = 0.2;
422
422
423
423
+
this.files = [];
424
424
+
423
425
this.loadFiles();
424
426
this.loadFile();
425
427
···
672
674
673
675
loadFile(name) {
674
676
let json = localStorage.getItem(name ?? "current-project");
677
677
+
if (json === null) {
678
678
+
this.setSettings();
679
679
+
return;
680
680
+
}
675
681
let wrapper = JSON.parse(json);
676
682
677
683
paper.project.importJSON(wrapper.json);
···
694
700
}
695
701
696
702
setSettings(settings) {
697
697
-
this._simplify = settings.simplify ?? true;
698
698
-
this._mirror = settings.mirror ?? true;
703
703
+
this._simplify = settings?.simplify ?? true;
704
704
+
this._mirror = settings?.mirror ?? true;
699
705
700
700
-
this._brushColor = settings.brushColor ?? "#FF0000";
706
706
+
this._brushColor = settings?.brushColor ?? "#FF0000";
701
707
702
702
-
this._rotations = settings.rotations ?? 8;
708
708
+
this._rotations = settings?.rotations ?? 8;
703
709
this.calculateRotationsPercentage();
704
704
-
this._brushSize = settings.brushSize ?? 1;
710
710
+
this._brushSize = settings?.brushSize ?? 1;
705
711
this.calculateBrushSizePercentage();
706
712
707
707
-
this._backgroundColor = settings.backgroundColor ?? "#FFFFFF";
708
708
-
view.element.style.backgroundColor = this.backgroundColor;
713
713
+
this._backgroundColor = settings?.backgroundColor ?? "#FFFFFF";
714
714
+
view.element.style.backgroundColor = this._backgroundColor;
709
715
710
716
updateUI(this);
711
717
}