Skip to content

Commit

Permalink
adding WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicSyntax committed Feb 18, 2024
1 parent 13a09bf commit 62ca0b2
Show file tree
Hide file tree
Showing 23 changed files with 524 additions and 40 deletions.
Binary file added files/0477beb99a044831d2f9.module.wasm
Binary file not shown.
Binary file added files/300d6d637e5bf64a16ef.module.wasm
Binary file not shown.
Binary file added files/5fb8879e6b79b9e20a1c.module.wasm
Binary file not shown.
Binary file added files/626c868b7f0abde67fc3.module.wasm
Binary file not shown.
Binary file added files/70fb10772a0bd9e78257.module.wasm
Binary file not shown.
Binary file added files/b83462ba388d9d52c585.module.wasm
Binary file not shown.
Binary file added files/eab78e09b4c32c8317f1.module.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion files/main.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<!-- End of Toast -->

<div id="daBod">
<p class="mt-5 fs-5">Hello there! Welcome to my little nook. This page is a work in progress...</p>
<p class="mt-5 fs-5">Hello there! Welcome to my little nook. This page is a work in progress... over-engineered using TypeScript and WASM.</p>
<p class="t-5 fs-5">My name is Dan: I am a dad, a software development engineer, a lifelong learner,
and a service member in the US Armed Forces.</p>
<p class="mt-5 fs-5">I am a full stack developer with a heavier emphasis in the back-end and data science.</p>
Expand All @@ -83,6 +83,10 @@
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/Kubernetes_logo_without_workmark.svg/1200px-Kubernetes_logo_without_workmark.svg.png" alt="" width="60" height="60">
Kubernetes
</li>
<li class="list-group-item list-group-item-dark text-truncate">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/WebAssembly_Logo.svg/600px-WebAssembly_Logo.svg.png" alt="" width="60" height="60">
WebAssembly
</li>
<li class="list-group-item list-group-item-dark text-truncate">
<img src="https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png" alt="" width="60" height="60">
Docker
Expand Down Expand Up @@ -165,7 +169,7 @@
</div>
<div class="pt-5">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 mt-0 text-muted">Last Updated: 2024-01-02</p>
<p class="col-md-4 mb-0 mt-0 text-muted">Last Updated: 2024-02-18</p>
<a href="./files/public-key.pem" class="btn btn-dark">Public Key</a>
</footer>
</div>
Expand Down
36 changes: 20 additions & 16 deletions src/material.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// import * as $ from "jquery";
import {greeting} from "./time";
import {vidGen} from "./video";
import { greeting } from "./time";
import { vidGen } from "./video";
import * as BS from "bootstrap";

// window.showem = function(iden) {
Expand All @@ -12,10 +12,10 @@ import * as BS from "bootstrap";
// let mCollection = new Object;
//
function timer(ms: number) {
return new Promise(resolve => setTimeout(() => resolve(true), ms));
return new Promise(resolve => setTimeout(() => resolve(true), ms));
}
async function startToast(x: number) {
await timer(x);
await timer(x);
let toastLive = document.getElementById('liveToast');
let toastbody = document.querySelector('#liveToast .toast-body');
let toastheader = document.querySelector('#liveToast .me-auto');
Expand All @@ -31,18 +31,22 @@ async function startToast(x: number) {
// mCollection.sidenav[0].close();
// }
//
document.addEventListener('DOMContentLoaded', function() {
// let elems = [
// document.querySelectorAll('.collapsible'),
// document.querySelectorAll('.tooltipped'),
// document.querySelectorAll('.sidenav'),
// ];
// mCollection.collInst = M.Collapsible.init(elems[0]);
// mCollection.toolInst = M.Tooltip.init(elems[1], {"position": "right"});
// mCollection.sidenav = M.Sidenav.init(elems[2]);
startToast(5000).then(() => console.log("Toast has launched!"));
vidGen();
console.log("STARTING!");
document.addEventListener('readystatechange', function() {
if (document.readyState === "complete") {
// let elems = [
// document.querySelectorAll('.collapsible'),
// document.querySelectorAll('.tooltipped'),
// document.querySelectorAll('.sidenav'),
// ];
// mCollection.collInst = M.Collapsible.init(elems[0]);
// mCollection.toolInst = M.Tooltip.init(elems[1], {"position": "right"});
// mCollection.sidenav = M.Sidenav.init(elems[2]);
console.log("STARTING!");
startToast(5000).then(() => console.log("Toast has launched!"));
vidGen();
console.log("STARTED!");

}
});
//
// document.querySelector("#menu").addEventListener("click", function() {
Expand Down
11 changes: 11 additions & 0 deletions src/pweb/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
install:
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- if not defined RUSTFLAGS rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustc -V
- cargo -V

build: false

test_script:
- cargo test --locked
8 changes: 8 additions & 0 deletions src/pweb/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "08:00"
open-pull-requests-limit: 10
6 changes: 6 additions & 0 deletions src/pweb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/target
**/*.rs.bk
Cargo.lock
bin/
pkg/
wasm-pack.log
69 changes: 69 additions & 0 deletions src/pweb/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
language: rust
sudo: false

cache: cargo

matrix:
include:

# Builds with wasm-pack.
- rust: beta
env: RUST_BACKTRACE=1
addons:
firefox: latest
chrome: stable
before_script:
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate)
- cargo install-update -a
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f
script:
- cargo generate --git . --name testing
# Having a broken Cargo.toml (in that it has curlies in fields) anywhere
# in any of our parent dirs is problematic.
- mv Cargo.toml Cargo.toml.tmpl
- cd testing
- wasm-pack build
- wasm-pack test --chrome --firefox --headless

# Builds on nightly.
- rust: nightly
env: RUST_BACKTRACE=1
before_script:
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate)
- cargo install-update -a
- rustup target add wasm32-unknown-unknown
script:
- cargo generate --git . --name testing
- mv Cargo.toml Cargo.toml.tmpl
- cd testing
- cargo check
- cargo check --target wasm32-unknown-unknown
- cargo check --no-default-features
- cargo check --target wasm32-unknown-unknown --no-default-features
- cargo check --no-default-features --features console_error_panic_hook
- cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook
- cargo check --no-default-features --features "console_error_panic_hook wee_alloc"
- cargo check --target wasm32-unknown-unknown --no-default-features --features "console_error_panic_hook wee_alloc"

# Builds on beta.
- rust: beta
env: RUST_BACKTRACE=1
before_script:
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate)
- cargo install-update -a
- rustup target add wasm32-unknown-unknown
script:
- cargo generate --git . --name testing
- mv Cargo.toml Cargo.toml.tmpl
- cd testing
- cargo check
- cargo check --target wasm32-unknown-unknown
- cargo check --no-default-features
- cargo check --target wasm32-unknown-unknown --no-default-features
- cargo check --no-default-features --features console_error_panic_hook
- cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook
# Note: no enabling the `wee_alloc` feature here because it requires
# nightly for now.
28 changes: 28 additions & 0 deletions src/pweb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "pweb"
version = "0.1.0"
authors = ["Daniel Choi <[email protected]>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["console_error_panic_hook"]

[dependencies]
wasm-bindgen = "0.2.84"

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.7", optional = true }
chrono = { version = "0.4.34", features = ["wasmbind"] }

[dev-dependencies]
wasm-bindgen-test = "0.3.34"

[profile.release]
# Tell `rustc` to optimize for small code size.
opt-level = "s"
Loading

0 comments on commit 62ca0b2

Please sign in to comment.