Skip to content

Commit

Permalink
First checkin of EMDR.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfe committed Jan 30, 2023
1 parent 4534986 commit fcf329b
Show file tree
Hide file tree
Showing 9 changed files with 6,961 additions and 0 deletions.
2 changes: 2 additions & 0 deletions emdr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
7 changes: 7 additions & 0 deletions emdr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# EMDR Remote

## Run

```
npm run develop
```
14 changes: 14 additions & 0 deletions emdr/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div class="cal">
<center>
<h1>Hello world</h1>
<svg id="cont" height="1000" width="1000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
</svg>
</center>
</div>
</body>
</html>
6,838 changes: 6,838 additions & 0 deletions emdr/package-lock.json

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions emdr/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "emdr",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"develop": "webpack-dev-server --mode development",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"html-webpack-plugin": "^5.5.0",
"ts-loader": "^9.4.2",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
}
37 changes: 37 additions & 0 deletions emdr/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function drawCircle() {
const svgns = "http://www.w3.org/2000/svg";
const container = document.getElementById( 'cont' );
let circle = document.createElementNS(svgns, 'circle');
circle.setAttribute("id", "circle1");
circle.setAttributeNS(null, 'cx', "300");
circle.setAttributeNS(null, 'cy', "300");
circle.setAttributeNS(null, 'r', "50");
circle.setAttributeNS(null, 'style', 'fill: none; stroke: blue; stroke-width: 1px;' );
container.appendChild(circle);
}

function animate() {
let cx = 10;
let step = 2;

const circle = document.getElementById('circle1');

setInterval(function () {
circle.setAttributeNS(null, 'cx', cx.toString())

cx += step;
if (cx > 800) {
step = -2;
} else if (cx < 20) {
step = 2;
}
}, 20);
}

function main() {
console.log("Hello world!")
drawCircle();
animate();
}

main();
7 changes: 7 additions & 0 deletions emdr/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"noImplicitAny": true,
"target": "ES5",
"module": "ES2015"
}
}
32 changes: 32 additions & 0 deletions emdr/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require('path');

module.exports = {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
devServer: {
static: path.join(__dirname, "dist"),
compress: true,
port: 4000,
},
plugins: [
new HtmlWebpackPlugin({
title: 'Remote EMDR',
template: 'index.html' })
],
};
2 changes: 2 additions & 0 deletions rust/hello/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ pub fn run() {

let boo = mo.clone();
println!("boo {:?}", boo);

println!("{}, {}", boo.i, boo.f);
}

0 comments on commit fcf329b

Please sign in to comment.