Skip to content

Commit

Permalink
fix: site on safari
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkf committed Aug 3, 2024
1 parent 8426e83 commit 4756214
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# wasm-pack build --out-dir site/assets/wasm/r --target=web --no-default-features
# cargo rustdoc
# cp target/doc site/docs
# cp site/templates/docs-redirect.html site/docs/index.html
# cp -r target/doc site/docs
cp site/templates/docs-redirect.html site/docs/index.html
#

[build]
Expand Down
15 changes: 13 additions & 2 deletions site/assets/prompt/src.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Repl {
#elem_container;
#elem_input;
// #elem_input_render;
// #elem_input_scroll;
#elem_highlight;
#elem_diagnostics;
#elem_output;
Expand Down Expand Up @@ -131,12 +133,21 @@ class Repl {
this.#elem_output = output;
}

console.log("here");

this.#elem_container = templates.querySelector("#container").content.cloneNode(true);
this.#elem_input = this.#elem_container.querySelector(".prompt-input-textarea");
this.#elem_highlight = this.#elem_container.querySelector(".prompt-highlight")
this.#elem_diagnostics = this.#elem_container.querySelector(".prompt-diagnostics")
// this.#elem_input_scroll = this.#elem_container.querySelector(".prompt-input-scroll");
this.#elem_highlight = this.#elem_container.querySelector(".prompt-highlight");
this.#elem_diagnostics = this.#elem_container.querySelector(".prompt-diagnostics");
this.#elem_output.classList.add("output-mode-" + this.output.mode);

// // synchronize scroll position of textarea
// this.#elem_input.addEventListener("scroll", () => {
// this.#elem_input_scroll.scrollLeft = this.#elem_input.scrollLeft;
// this.#elem_input_scroll.scrollTop = this.#elem_input.scrollTop;
// });

// add output before, buttons after
if (this.output.location === "above") {
this.#elem_container.insertBefore(output, this.#elem_container.firstChild);
Expand Down
10 changes: 7 additions & 3 deletions site/assets/prompt/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@
position: relative;
}

.prompt-input-textarea, .prompt-highlight, .prompt-diagnostics {
-webkit-text-size-adjust: 100%;
.prompt-input-container * {
font-size: calc(1rem * var(--font-scale));
}

.prompt-input-textarea, .prompt-highlight, .prompt-diagnostics {
box-sizing: border-box;

font-family: monospace, mono;
white-space: pre;
line-height: 1.4em;
Expand All @@ -95,6 +98,7 @@
border-style: solid;
border-color: var(--gray2);
padding: 1em;
padding-bottom: 0.5em;
}

.prompt-highlight, .prompt-diagnostics {
Expand Down Expand Up @@ -131,8 +135,8 @@
}

.prompt-run {
top: 1em;
right: 1em;
bottom: 0.75em;
padding: 1em;
}

Expand Down
2 changes: 1 addition & 1 deletion site/release/v0.4.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ <h2>Thanks to all Contributors!</h2>
<p>
If you're interested in getting involved, there are plenty of discussions
on <a href="https://github.com/dgkf/R/issues?q=is%3Aissue+is%3Aopen+label%3Ameta-proposal">language features</a>,
and plenty of <a href="https://github.com/dgkf/R/labels/meta-good%20first%20issue">good first issues</a>!
and some <a href="https://github.com/dgkf/R/labels/meta-good%20first%20issue">good first issues</a>!
</p>

<h2 class="float-right" style="text-align: right; margin: 4em;">
Expand Down

0 comments on commit 4756214

Please sign in to comment.