Skip to content

Commit

Permalink
Simplify the Bezier-rs interactive web demo code (#2020)
Browse files Browse the repository at this point in the history
* Change demo pane classes into simpler group functions

* Eliminate classes

* Use template strings for HTML

* Reduce files and flatten directories

* Restructuring to reduce redundant code

* Eliminate the module pattern and consolidate both demo types

* Further consolidate into main.ts
  • Loading branch information
Keavon authored Oct 4, 2024
1 parent e6d8c47 commit a2465f4
Show file tree
Hide file tree
Showing 12 changed files with 600 additions and 757 deletions.
17 changes: 8 additions & 9 deletions website/other/bezier-rs-demos/public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body {
color: var(--color-navy);
}

.class-header {
.category-header {
color: var(--color-navy);
font-family: "Bona Nova", serif;
margin-bottom: 0
Expand All @@ -48,7 +48,7 @@ body > h2 {
margin-top: 40px;
}

/* Demo Pane styles */
/* Demo group styles */
.demo-row {
display: flex;
flex-direction: row;
Expand All @@ -59,7 +59,7 @@ body > h2 {
margin-top: 20px;
}

.demo-pane-header {
.demo-group-header {
display: inline-block;
position: relative;
margin-top: 2em;
Expand All @@ -69,7 +69,7 @@ body > h2 {
color: var(--color-navy);
}

.demo-pane-header a {
.demo-group-header a {
display: none;
position: absolute;
left: 0;
Expand All @@ -78,11 +78,11 @@ body > h2 {
opacity: 0.5;
}

.demo-pane-header:hover a {
.demo-group-header:hover a {
display: inline-block;
}

.demo-pane-container {
.demo-group-container {
position: relative;
width: fit-content;
margin: auto;
Expand All @@ -103,7 +103,7 @@ body > h2 {
border: solid 1px black;
}

.parent-slider-container {
.parent-input-container {
display: flex;
justify-content: center;
flex-direction: column;
Expand All @@ -123,7 +123,7 @@ svg text {
padding-bottom: 5px;
}

.slider-label {
.input-label {
font-family: monospace;
display: flex;
justify-content: left;
Expand All @@ -139,7 +139,6 @@ input[type="range"] {
border-radius: 5px;
background: linear-gradient(var(--range-fill-dark), var(--range-fill-dark)) 0 / calc(0.5 * var(--range-thumb-height) + var(--range-ratio) * (100% - var(--range-thumb-height))) var(--range-fill-light);
background-repeat: no-repeat;

}

/* Input Thumb */
Expand Down
114 changes: 0 additions & 114 deletions website/other/bezier-rs-demos/src/components/BezierDemo.ts

This file was deleted.

82 changes: 0 additions & 82 deletions website/other/bezier-rs-demos/src/components/BezierDemoPane.ts

This file was deleted.

101 changes: 0 additions & 101 deletions website/other/bezier-rs-demos/src/components/SubpathDemo.ts

This file was deleted.

Loading

0 comments on commit a2465f4

Please sign in to comment.