mirror of
https://github.com/MatomoCamp/workadventure-map.git
synced 2024-09-10 05:33:44 +02:00
Initial commit
This commit is contained in:
commit
d7d3917183
13 changed files with 7135 additions and 0 deletions
55
.github/workflows/build-and-deploy.yml
vendored
Normal file
55
.github/workflows/build-and-deploy.yml
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: Optimize map and deploy
|
||||
|
||||
on:
|
||||
- push
|
||||
|
||||
jobs:
|
||||
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Optimize map
|
||||
uses: thecodingmachine/map-optimizer-action@master
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: npm install
|
||||
|
||||
- name: "Build scripts"
|
||||
run: npm run build
|
||||
|
||||
- name: "Move scripts"
|
||||
run: mv dist/* .
|
||||
|
||||
- name: Bash
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
ls -al
|
||||
git config --global user.email "d.negrier@thecodingmachine.com"
|
||||
git config --global user.name "David Négrier"
|
||||
git checkout master
|
||||
git add .
|
||||
git commit -am "Adding files"
|
||||
|
||||
- name: Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages # The branch the action should deploy to.
|
||||
FOLDER: . # The folder the action should deploy.
|
||||
BASE_BRANCH: master
|
||||
|
||||
- name: Bash2
|
||||
run: |
|
||||
ls -al
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/node_modules/
|
6
README.md
Normal file
6
README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# WorkAdventure Map Starter Kit
|
||||
|
||||
This is a starter kit to help you build your own map for [WorkAdventure](https://workadventu.re).
|
||||
|
||||
To understand how to use this starter kit, follow the tutorial at [https://workadventu.re/map-building](https://workadventu.re/map-building).
|
||||
|
BIN
floortileset.png
Normal file
BIN
floortileset.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 85 KiB |
70
index.html
Normal file
70
index.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
<html>
|
||||
<head>
|
||||
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
|
||||
<link href="https://unpkg.com/nes.css@2.3.0/css/nes.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
.margin-constraint{
|
||||
/*On indique tout simplement une marge*/
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.useful-width{
|
||||
/*On règle ensuite la largeur utile puis on centre*/
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.margin-constraint, .useful-width{
|
||||
/*Si vous utilisez uniquement des div, cette dernière règle css n'est même pas nécessaire*/
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var path = window.location.pathname;
|
||||
if (path.endsWith('index.html')) {
|
||||
path = path.substr(path, path.length - 'index.html'.length);
|
||||
}
|
||||
var url = 'https://play.workadventu.re/_/global/'+window.location.host+path+'map.json';
|
||||
document.getElementById('mapLink').href = url;
|
||||
document.getElementById('mapLink2').href = url;
|
||||
document.getElementById('mapLink').innerText = url;
|
||||
|
||||
var mapUrl = window.location.protocol+'//'+window.location.host+path+'map.json';
|
||||
document.getElementById('mapUrl').innerText = mapUrl;
|
||||
|
||||
var gettingStartedLink = 'https://workadventu.re/getting-started?name=Map&mapUrl='+mapUrl;
|
||||
document.getElementById('gettingStartedLink').href = gettingStartedLink;
|
||||
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="useful-width">
|
||||
<div style="text-align: center; margin-top: 3rem">
|
||||
<img src="https://workadventu.re/img/logo.png" alt=""/>
|
||||
</div>
|
||||
<div class="nes-container with-title is-centered" style="margin-top: 3rem">
|
||||
<p class="title">WorkAdventure map</p>
|
||||
<p>This website contains a map for <a href="https://workadventu.re">Workadventu.re</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="nes-container with-title is-centered" style="margin-top: 1rem">
|
||||
<p class="title">Test this map</p>
|
||||
<p>You can test this map at <a id="mapLink" href=""></a>.</p>
|
||||
<p><a id="mapLink2" href="" class="nes-btn is-primary">Test this map</a></p>
|
||||
</div>
|
||||
|
||||
<div class="nes-container with-title is-centered" style="margin-top: 1rem">
|
||||
<p class="title">Happy with the result?</p>
|
||||
<p>Register your room on Workadventu.re.</p>
|
||||
<p><a id="gettingStartedLink" href="" class="nes-btn is-primary">Create a new room</a></p>
|
||||
<p>or copy and paste the map URL in WorkAdventu.re's administration panel:</p>
|
||||
<p><span id="mapUrl" style="color: gray" /></p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
908
map.json
Normal file
908
map.json
Normal file
File diff suppressed because one or more lines are too long
5970
package-lock.json
generated
Normal file
5970
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
25
package.json
Normal file
25
package.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "workadventure-map-starter-kit",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@workadventure/iframe-api-typings": "^1.2.1",
|
||||
"eslint": "^7.24.0",
|
||||
"html-webpack-plugin": "^5.3.1",
|
||||
"ts-loader": "^8.1.0",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4",
|
||||
"webpack": "^5.31.2",
|
||||
"webpack-cli": "^4.6.0",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"webpack-merge": "^5.7.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "webpack serve --open",
|
||||
"build": "webpack --config webpack.prod.js",
|
||||
"test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json",
|
||||
"lint": "node_modules/.bin/eslint src/ . --ext .ts",
|
||||
"fix": "node_modules/.bin/eslint --fix src/ . --ext .ts"
|
||||
}
|
||||
}
|
7
src/index.ts
Normal file
7
src/index.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
/// <reference path="../node_modules/@workadventure/iframe-api-typings/iframe_api.d.ts" />
|
||||
|
||||
// You can write your WorkAdventure script here, if any.
|
||||
// The "WA" global object is available from anywhere.
|
||||
|
||||
console.log('Script started successfully');
|
||||
WA.openCoWebSite('https://workadventu.re');
|
BIN
tilesets_deviant_milkian_1.png
Normal file
BIN
tilesets_deviant_milkian_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
25
tsconfig.json
Normal file
25
tsconfig.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"sourceMap": true,
|
||||
"moduleResolution": "node",
|
||||
"module": "CommonJS",
|
||||
"target": "ES2015",
|
||||
"declaration": false,
|
||||
"downlevelIteration": true,
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"strictNullChecks": true, /* Enable strict null checks. */
|
||||
"strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */
|
||||
}
|
||||
}
|
61
webpack.config.js
Normal file
61
webpack.config.js
Normal file
|
@ -0,0 +1,61 @@
|
|||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: './src/index.ts',
|
||||
devtool: 'inline-source-map',
|
||||
devServer: {
|
||||
contentBase: '.',
|
||||
//host: '0.0.0.0',
|
||||
host: 'localhost',
|
||||
//sockPort: 80,
|
||||
disableHostCheck: true,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
||||
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ '.tsx', '.ts', '.js' ],
|
||||
},
|
||||
output: {
|
||||
filename: 'script.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
publicPath: '/'
|
||||
},
|
||||
/*externals:[
|
||||
require('webpack-require-http')
|
||||
],*/
|
||||
plugins: [
|
||||
/*new webpack.ProvidePlugin({
|
||||
WA: ['@workadventure/iframe-api-typings', 'window.WA']
|
||||
}),*/
|
||||
/*new webpack.EnvironmentPlugin({
|
||||
'API_URL': null,
|
||||
'PUSHER_URL': undefined,
|
||||
'UPLOADER_URL': null,
|
||||
'ADMIN_URL': null,
|
||||
'DEBUG_MODE': null,
|
||||
'STUN_SERVER': null,
|
||||
'TURN_SERVER': null,
|
||||
'TURN_USER': null,
|
||||
'TURN_PASSWORD': null,
|
||||
'JITSI_URL': null,
|
||||
'JITSI_PRIVATE_MODE': null,
|
||||
'START_ROOM_URL': null
|
||||
})*/
|
||||
],
|
||||
|
||||
};
|
7
webpack.prod.js
Normal file
7
webpack.prod.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.config.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
});
|
Loading…
Reference in a new issue