-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement settings dialog for examples (#1)
- Loading branch information
Showing
16 changed files
with
264 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {AppSettingsBase, Property, SettingsBase, SettingsGroup} from "./base.js"; | ||
import {RenderConfigGroup} from "./renderer.js"; | ||
import {SolverConfigGroup} from "./solver.js"; | ||
import {DebugConfigGroup} from "./debug.js"; | ||
|
||
export class DefaultBootstrapSettings extends AppSettingsBase { | ||
static Types = { | ||
...RenderConfigGroup, | ||
...SolverConfigGroup, | ||
...DebugConfigGroup, | ||
} | ||
} | ||
|
||
export class CommonSettings extends SettingsBase { | ||
static Properties = { | ||
gravity: Property.float("resistance", 100) | ||
.setName("Gravity") | ||
.setConstraints(-10000, 10000), | ||
resistance: Property.float("resistance", 1) | ||
.setName("Resistance") | ||
.setConstraints(0, 1), | ||
friction: Property.float("friction", 0.5) | ||
.setName("Friction") | ||
.setConstraints(0, 1), | ||
restitution: Property.float("restitution", 0.2) | ||
.setName("Restitution") | ||
.setConstraints(0, 1), | ||
} | ||
} | ||
|
||
export class CommonBootstrapSettings extends AppSettingsBase { | ||
static Types = { | ||
common: SettingsGroup.of(CommonSettings).setName("Common"), | ||
...RenderConfigGroup, | ||
...SolverConfigGroup, | ||
...DebugConfigGroup, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
body { | ||
color: #555; | ||
background: #ece9e9 linear-gradient(180deg, #fff, #ece9e9) no-repeat; | ||
} | ||
|
||
button { | ||
border: 0.1em solid black; | ||
color: black; | ||
} | ||
|
||
button:hover { | ||
background: rgba(155, 155, 155, 0.1); | ||
} | ||
|
||
button:active { | ||
background: rgba(110, 110, 110, 0.2); | ||
} | ||
|
||
input[type=text] { | ||
color: black; | ||
border-bottom: 0.1em solid #606060; | ||
} | ||
|
||
input[type=text]:disabled { | ||
color: #606060; | ||
} | ||
|
||
input[type=checkbox] { | ||
border: 0.1em solid #606060; | ||
} | ||
|
||
input[type=checkbox]::before { | ||
background: #606060; | ||
} | ||
|
||
.dialog { | ||
background: white; | ||
border: 0.1rem solid rgba(90, 90, 90, 0.5); | ||
} | ||
|
||
.dialog .dialog-caption { | ||
border-bottom: 0.1rem solid #606060; | ||
} | ||
|
||
[data-tooltip]:before { | ||
background: #f3f3f3; | ||
} | ||
|
||
.dialog button.dialog-close { | ||
border: 0.1em solid #606060; | ||
} | ||
|
||
.settings-button { | ||
position: absolute; | ||
right: 1em; | ||
bottom: 1em; | ||
} | ||
|
||
.settings-dialog .dialog { | ||
padding: 0 1em 1em 1em; | ||
box-sizing: border-box; | ||
max-height: calc(100vh - 1em); | ||
max-width: max(40vw, 400px); | ||
} | ||
|
||
.settings-dialog .dialog-close.settings-close { | ||
position: absolute; | ||
right: 0; | ||
border: none; | ||
} | ||
|
||
.settings-close > img { | ||
width: 1.5em; | ||
height: 1.5em; | ||
} | ||
|
||
.settings-dialog .settings-dialog-caption { | ||
position: sticky; | ||
top: 0; | ||
background: white; | ||
z-index: 1; | ||
padding-top: 0.5em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.