Skip to content

Commit

Permalink
more fixes re #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Conlen committed Aug 16, 2020
1 parent 7f2d9a2 commit 0a11f3a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
9 changes: 5 additions & 4 deletions src/diagrams/details-illustration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
annotationDisplay = true
selectedPoint = i-1
hideFakeImage()
tapBackgroundToHideAnnotation();
}
function changeSelectedImage(i) {
Expand All @@ -68,7 +69,7 @@
}
function tapBackgroundToHideAnnotation() {
document.getElementById('fake-image').onclick = () => changeAnnotationDisplay()
document.getElementById('fake-image-svg-container').onclick = () => changeAnnotationDisplay()
}
function hideFakeImage() {
Expand Down Expand Up @@ -165,7 +166,7 @@
color: var(--gray);
padding-bottom: 5px;
}
#caption-wrapper {
display: flex;
/* flex-direction: column; */
Expand Down Expand Up @@ -201,7 +202,7 @@
opacity: 0;
}
@media(max-width: 768px) {
#grid-wrapper {
Expand Down Expand Up @@ -239,7 +240,7 @@

<div id="grid-wrapper">
<div>
<div>
<div id="fake-image-svg-container">
{@html fakeImages[selectedImage-1]}
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/diagrams/horse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/* border-radius: var(--border-radius); */
/* padding-top: 0em; */
grid-column: page;
max-width: calc(100vw - 2em);
}
#frames {
Expand All @@ -69,13 +70,15 @@
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-column-gap: 2em;
max-width: calc(100vw - 2em);
}
#horse {
grid-column-start: 1;
grid-column-end: 7;
width: 100%;
border-radius: var(--border-radius);
max-width: calc(100vw - 2em);
}
#horse-controls {
Expand All @@ -85,6 +88,7 @@
flex-direction: column;
justify-content: center;
text-align: left;
max-width: calc(100vw - 2em);
}
.slider {
Expand Down Expand Up @@ -152,7 +156,7 @@
}
@media(max-width: 1000px) {
#horse-controls {
grid-column-start: 1;
grid-column-end: 13;
Expand Down
56 changes: 47 additions & 9 deletions src/diagrams/simulation-vis.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@
justify-content: space-around;
}
.controls-bottom {
display: flex;
flex-direction: row;
margin: 0 auto;
font-size: 10px;
text-transform: uppercase;
text-align: center;
justify-content: space-between;
}
.controls-bottom {
margin-bottom: 1.5em;
}
.slider {
-webkit-appearance: none;
appearance: none;
Expand Down Expand Up @@ -154,10 +167,35 @@
cursor: pointer;
}
.control {
line-height: 1.3;
}
.control-label {
user-select: none;
}
@media(max-width: 768px) {
#wrapper {
grid-column: screen !important;
}
width: calc(100% - 2em);
}
.control {
width: 30vw;
/* flex: 1; */
}
.control input {
width: 30vw;
display: block;
margin-top: 0.5em;
/* flex: 1; */
}
.control-label {
width: 25vw;
}
}
@media(max-width: 1000px) {
Expand Down Expand Up @@ -190,31 +228,31 @@
width={CANVAS_WIDTH}
height={CANVAS_HEIGHT}
></canvas>
<div class="controls">
<div class="controls-bottom">
<div class="control">
Separation Distance<br/>
<div class="control-label">Separation Distance</div>
<input type=range bind:value={separationDistance} min=1 max=500 class="slider" />
</div>
<div class="control">
Alignment Distance<br/>
<div class="control-label">Alignment Distance</div>
<input type=range bind:value={alignmentDistance} min=1 max=500 class="slider" />
</div>
<div class="control">
Cohesion Distance<br/>
<div class="control-label">Cohesion Distance</div>
<input type=range bind:value={cohesionDistance} min=1 max=500 class="slider" />
</div>
</div>
<div class="controls">
<div class="controls-bottom">
<div class="control">
Separation Force<br/>
<div class="control-label">Separation Force</div>
<input type=range bind:value={separationForce} min=0.01 max=500 step=0.01 class="slider" />
</div>
<div class="control">
Alignment Force<br/>
<div class="control-label">Alignment Force</div>
<input type=range bind:value={alignmentForce} min=0.01 max=500 step=0.01 class="slider" />
</div>
<div class="control">
Cohesion Force<br/>
<div class="control-label">Cohesion Force</div>
<input type=range bind:value={cohesionForce} min=0.01 max=500 step=0.01 class="slider" />
</div>
</div>
Expand Down

0 comments on commit 0a11f3a

Please sign in to comment.