mirror of
https://github.com/coder/code-server.git
synced 2024-12-23 01:31:50 +03:00
Experimenting with FuseBox
This commit is contained in:
parent
3ec40f49bf
commit
7cfeef36a8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
.fusebox
|
||||||
lib/vscode
|
lib/vscode
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
|
23
fuse.js
Normal file
23
fuse.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
const { FuseBox, SassPlugin, CSSPlugin, CSSResourcePlugin } = require("fuse-box");
|
||||||
|
|
||||||
|
const fuse = FuseBox.init({
|
||||||
|
homeDir: ".",
|
||||||
|
output: "dist/$name.js",
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
SassPlugin(),
|
||||||
|
CSSResourcePlugin({ dist: "dist/css-resources" }),
|
||||||
|
CSSPlugin(),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
fuse.dev();
|
||||||
|
|
||||||
|
fuse
|
||||||
|
.bundle("app")
|
||||||
|
.instructions("> packages/app/src/index.ts")
|
||||||
|
.hmr()
|
||||||
|
.watch();
|
||||||
|
|
||||||
|
fuse.run();
|
@ -10,7 +10,7 @@
|
|||||||
"vscode": "npm-run-all vscode:*",
|
"vscode": "npm-run-all vscode:*",
|
||||||
"packages:install": "cd ./packages && yarn",
|
"packages:install": "cd ./packages && yarn",
|
||||||
"postinstall": "npm-run-all --parallel vscode packages:install",
|
"postinstall": "npm-run-all --parallel vscode packages:install",
|
||||||
"start": "webpack-dev-server --config ./webpack.config.app.js",
|
"start": "node fuse.js",
|
||||||
"test": "cd ./packages && yarn test"
|
"test": "cd ./packages && yarn test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -71,16 +71,6 @@
|
|||||||
<div class="message">
|
<div class="message">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
|
||||||
const overlay = document.getElementById("overlay");
|
|
||||||
const logo = document.getElementById("logo");
|
|
||||||
overlay.addEventListener("mousemove", (event) => {
|
|
||||||
const xPos = ((event.clientX - logo.offsetLeft) / 24).toFixed(2);
|
|
||||||
const yPos = ((logo.offsetTop - event.clientY) / 24).toFixed(2);
|
|
||||||
|
|
||||||
logo.style.transform = `perspective(200px) rotateX(${yPos}deg) rotateY(${xPos}deg)`;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
10
packages/app/src/index.ts
Normal file
10
packages/app/src/index.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const overlay = document.getElementById("overlay");
|
||||||
|
const logo = document.getElementById("logo");
|
||||||
|
if (overlay && logo) {
|
||||||
|
overlay.addEventListener("mousemove", (event) => {
|
||||||
|
const xPos = ((event.clientX - logo.offsetLeft) / 24).toFixed(2);
|
||||||
|
const yPos = ((logo.offsetTop - event.clientY) / 24).toFixed(2);
|
||||||
|
|
||||||
|
logo.style.transform = `perspective(200px) rotateX(${yPos}deg) rotateY(${xPos}deg)`;
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user