Skip to content

Commit

Permalink
Avoid CDN in WASM examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3vu0r committed Jul 6, 2024
1 parent 3dde53a commit 27b1324
Show file tree
Hide file tree
Showing 19 changed files with 435 additions and 9 deletions.
1 change: 1 addition & 0 deletions examples/wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ page: wasm html

target:
mkdir target
cp -a -- woff woff2 *.css *.js $@

.PHONY: update
udpate:;
Expand Down
7 changes: 7 additions & 0 deletions examples/wasm/default-dark.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions examples/wasm/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Coherent virtual trackball controller/camera plugin for Bevy">
<meta property="og:url" content="https://qu1x.dev/bevy_trackball">
<meta property="og:type" content="website">
<meta property="og:title" content="Bevy Trackball">
<meta property="og:description" content="Coherent virtual trackball controller/camera plugin for Bevy">
<meta property="og:image" content="https://qu1x.dev/bevy_trackball/preview.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Interactive example using WebAssembly and WebGL waiting for your input to orbit around.">
<title>Bevy Trackball</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/distr/fira_code.css"
integrity="sha384-4aMEnBa9HzMLsDYaLm5wiA2ZoWDqNSB6pNnINMFUt13g9VOuTY5hZC49pzHzRXVs" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/base16/default-dark.min.css"
integrity="sha384-vH614oDsGRtEnkgS6eWFr651WMxr+cGQ2U2rf6LLG+aAXvGL3EbbUrlwTxAxxAOx" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"
integrity="sha384-g4mRvs7AO0/Ol5LxcGyz4Doe21pVhGNnC3EQw5shw+z+aXDN86HqUdwXWO+Gz2zI" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/languages/rust.min.js"
integrity="sha384-QQ4ARayCN1N/8rQfTBHj5QxximTvixlY/Wqk/T4NJ1NoaA+RtgmQyUUububG6V5N" crossorigin="anonymous"></script>
<title>bevy_trackball/examples/{EXAMPLE}.rs</title>
<link rel="stylesheet" href="fira_code.css">
<link rel="stylesheet" href="default-dark.min.css">
<script src="highlight.min.js"></script>
<script src="rust.min.js"></script>
<style>
html {
height: 100%;
Expand Down
48 changes: 48 additions & 0 deletions examples/wasm/fira_code.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Light.woff2') format('woff2'),
url("woff/FiraCode-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Regular.woff2') format('woff2'),
url("woff/FiraCode-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Medium.woff2') format('woff2'),
url("woff/FiraCode-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-SemiBold.woff2') format('woff2'),
url("woff/FiraCode-SemiBold.woff") format("woff");
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Bold.woff2') format('woff2'),
url("woff/FiraCode-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'Fira Code VF';
src: url('woff2/FiraCode-VF.woff2') format('woff2-variations'),
url('woff/FiraCode-VF.woff') format('woff-variations');
/* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
font-weight: 300 700;
font-style: normal;
}
Loading

0 comments on commit 27b1324

Please sign in to comment.