mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Compare commits
6 Commits
4b5940e651
...
feature/ap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
250d79162b | ||
|
|
9fc7e64499 | ||
|
|
6223908020 | ||
|
|
c73dd71953 | ||
|
|
c7062de5e6 | ||
|
|
82132d9141 |
@@ -10,6 +10,9 @@ import * as PT from './pt';
|
|||||||
import * as CN from './cn';
|
import * as CN from './cn';
|
||||||
import * as d3 from 'd3';
|
import * as d3 from 'd3';
|
||||||
|
|
||||||
|
const owofy = require("owofy");
|
||||||
|
|
||||||
|
|
||||||
let fallbackTerms = EN.terms;
|
let fallbackTerms = EN.terms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +42,14 @@ export function getLanguage(langCode) {
|
|||||||
const round = function(x, n) { const ten_n = Math.pow(10,n); return Math.round(x * ten_n) / ten_n; };
|
const round = function(x, n) { const ten_n = Math.pow(10,n); return Math.round(x * ten_n) / ten_n; };
|
||||||
|
|
||||||
if(lang === EN) {
|
if(lang === EN) {
|
||||||
translate = (t, x) => { return currentTerms[t + '_' + x] || currentTerms[t] || t; };
|
translate = (t, x) => {
|
||||||
|
if (currentTerms[t + '_' + x]) {
|
||||||
|
return owofy(currentTerms[t + '_' + x])
|
||||||
|
} else if (currentTerms[t]) {
|
||||||
|
return owofy(currentTerms[t])
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
translate = (t, x) => { return currentTerms[t + '_' + x] || currentTerms[t] || fallbackTerms[t + '_' + x] || fallbackTerms[t] || t; };
|
translate = (t, x) => { return currentTerms[t + '_' + x] || currentTerms[t] || fallbackTerms[t + '_' + x] || fallbackTerms[t] || t; };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Ship from '../shipyard/Ship';
|
|||||||
import * as ModuleUtils from '../shipyard/ModuleUtils';
|
import * as ModuleUtils from '../shipyard/ModuleUtils';
|
||||||
import { SizeMap } from '../shipyard/Constants';
|
import { SizeMap } from '../shipyard/Constants';
|
||||||
import Link from '../components/Link';
|
import Link from '../components/Link';
|
||||||
|
const owofy = require("owofy");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts the hardpoints by class/size
|
* Counts the hardpoints by class/size
|
||||||
@@ -177,13 +178,13 @@ export default class ShipyardPage extends Page {
|
|||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={s.id}
|
key={s.id}
|
||||||
style={{ height: '1.5em' }}
|
style={{ height: "1.5em" }}
|
||||||
className={cn({
|
className={cn({
|
||||||
highlighted: noTouch && this.state.shipId === s.id,
|
highlighted: noTouch && this.state.shipId === s.id
|
||||||
})}
|
})}
|
||||||
onMouseEnter={noTouch && this._highlightShip.bind(this, s.id)}
|
onMouseEnter={noTouch && this._highlightShip.bind(this, s.id)}
|
||||||
>
|
>
|
||||||
<td className="ri">{s.manufacturer}</td>
|
<td className="ri">{owofy(s.manufacturer)}</td>
|
||||||
<td className="ri">{fInt(s.retailCost)}</td>
|
<td className="ri">{fInt(s.retailCost)}</td>
|
||||||
<td className="ri cap">{translate(SizeMap[s.class])}</td>
|
<td className="ri cap">{translate(SizeMap[s.class])}</td>
|
||||||
<td className="ri">{fInt(s.crew)}</td>
|
<td className="ri">{fInt(s.crew)}</td>
|
||||||
@@ -302,13 +303,12 @@ export default class ShipyardPage extends Page {
|
|||||||
onMouseEnter={noTouch && this._highlightShip.bind(this, s.id)}
|
onMouseEnter={noTouch && this._highlightShip.bind(this, s.id)}
|
||||||
>
|
>
|
||||||
<td className="le">
|
<td className="le">
|
||||||
<Link href={'/outfit/' + s.id}>{s.name} {s.beta === true ? '(Beta)' : null}</Link>
|
<Link href={'/outfit/' + s.id}>{owofy(s.name)} {s.beta === true ? '(Beta)' : null}</Link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page" style={{ fontSize: sizeRatio + 'em' }}>
|
<div className="page" style={{ fontSize: sizeRatio + 'em' }}>
|
||||||
<div
|
<div
|
||||||
@@ -595,6 +595,7 @@ export default class ShipyardPage extends Page {
|
|||||||
{detailRows}
|
{detailRows}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
61
src/clippy.css
Normal file
61
src/clippy.css
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
.clippy, .clippy-balloon {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1000;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-balloon {
|
||||||
|
|
||||||
|
background: #FFC;
|
||||||
|
color: black;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid black;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-content {
|
||||||
|
max-width: 200px;
|
||||||
|
min-width: 120px;
|
||||||
|
font-family: "Microsoft Sans", sans-serif;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-tip {
|
||||||
|
width: 10px;
|
||||||
|
height: 16px;
|
||||||
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAMAAAAlvKiEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRF///MAAAA////52QwgAAAAAN0Uk5T//8A18oNQQAAAGxJREFUeNqs0kEOwCAIRFHn3//QTUU6xMyyxii+jQosrTPkyPEM6IN3FtzIRk1U4dFeKWQiH6pRRowMVKEmvronEynkwj0uZJgR22+YLopPSo9P34wJSamLSU7lSIWLJU7NkNomNlhqxUeAAQC+TQLZyEuJBwAAAABJRU5ErkJggg==) no-repeat;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-top-left .clippy-tip {
|
||||||
|
top: 100%;
|
||||||
|
margin-top: 0px;
|
||||||
|
left: 100%;
|
||||||
|
margin-left: -50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-top-right .clippy-tip {
|
||||||
|
top: 100%;
|
||||||
|
margin-top: 0px;
|
||||||
|
left: 0;
|
||||||
|
margin-left: 50px;
|
||||||
|
background-position: -10px 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-bottom-right .clippy-tip {
|
||||||
|
top: 0;
|
||||||
|
margin-top: -16px;
|
||||||
|
left: 0;
|
||||||
|
margin-left: 50px;
|
||||||
|
background-position: -10px -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clippy-bottom-left .clippy-tip {
|
||||||
|
top: 0;
|
||||||
|
margin-top: -16px;
|
||||||
|
left: 100%;
|
||||||
|
margin-left: -50px;
|
||||||
|
background-position: 0px -16px;
|
||||||
|
}
|
||||||
1
src/clippy.min.js
vendored
Normal file
1
src/clippy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
108
src/index.ejs
108
src/index.ejs
@@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Coriolis EDCD Edition</title>
|
<title>Coriolis EDCD Edition</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="<%= htmlWebpackPlugin.files.css[0] %>">
|
<link rel="stylesheet" href="<%= htmlWebpackPlugin.files.css[0] %>">
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
<link rel="shortcut icon" href=/favicon2.ico>
|
<link rel="shortcut icon" href=/favicon2.ico>
|
||||||
<link rel="icon" sizes="152x152 192x192" type="image/png"
|
<link rel="icon" sizes="152x152 192x192" type="image/png"
|
||||||
href="/192x192.png">
|
href="/192x192.png">
|
||||||
|
|
||||||
<!-- Apple/iOS headers -->
|
<!-- Apple/iOS headers -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
@@ -29,44 +29,74 @@
|
|||||||
<script>
|
<script>
|
||||||
window.CORIOLIS_GAPI_KEY = '<%- htmlWebpackPlugin.options.gapiKey %>';
|
window.CORIOLIS_GAPI_KEY = '<%- htmlWebpackPlugin.options.gapiKey %>';
|
||||||
window.CORIOLIS_VERSION = '<%- htmlWebpackPlugin.options.version %>';
|
window.CORIOLIS_VERSION = '<%- htmlWebpackPlugin.options.version %>';
|
||||||
window.CORIOLIS_DATE = '<%- htmlWebpackPlugin.options.date.toISOString().slice(0, 10) %>';
|
window.CORIOLIS_DATE = '<%- htmlWebpackPlugin.options.date.toISOString().slice(0, 10) %>';
|
||||||
window.BUGSNAG_VERSION = '<%- htmlWebpackPlugin.options.version + '-' + htmlWebpackPlugin.options.date.toISOString() %>';
|
window.BUGSNAG_VERSION = '<%- htmlWebpackPlugin.options.version + '-' + htmlWebpackPlugin.options.date.toISOString() %>';
|
||||||
</script>
|
</script>
|
||||||
<% if (htmlWebpackPlugin.options.uaTracking) { %>
|
<% if (htmlWebpackPlugin.options.uaTracking) { %>
|
||||||
<script>
|
|
||||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
||||||
ga('create', '<%- htmlWebpackPlugin.options.uaTracking %>', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
</script>
|
|
||||||
<script async src='https://www.google-analytics.com/analytics.js'></script>
|
|
||||||
<% } %>
|
|
||||||
|
|
||||||
<!-- Piwik -->
|
|
||||||
<!-- <script type="text/javascript">
|
|
||||||
var _paq = _paq || [];
|
|
||||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
|
||||||
_paq.push(["setCookieDomain", "*.coriolis.edcd.io"]);
|
|
||||||
_paq.push(['trackPageView']);
|
|
||||||
_paq.push(['enableLinkTracking']);
|
|
||||||
(function() {
|
|
||||||
var u="//stats.isadankme.me/";
|
|
||||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
|
||||||
_paq.push(['setSiteId', '4']);
|
|
||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
|
||||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
|
||||||
})();
|
|
||||||
</script>-->
|
|
||||||
<!-- End Piwik Code -->
|
|
||||||
|
|
||||||
<!-- Bugsnag -->
|
|
||||||
<script src="https://d2wy8f7a9ursnm.cloudfront.net/v5.0.0/bugsnag.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
window.bugsnagClient = bugsnag('ba9fae819372850fb660755341fa6ef5', {appVersion: window.BUGSNAG_VERSION || undefined})
|
window.ga = window.ga || function() {(ga.q = ga.q || []).push(arguments);};
|
||||||
window.Bugsnag = window.bugsnagClient
|
ga.l = +new Date;
|
||||||
</script>
|
ga('create', '<%- htmlWebpackPlugin.options.uaTracking %>', 'auto');
|
||||||
</head>
|
ga('send', 'pageview');
|
||||||
<body style="background-color:#000;">
|
</script>
|
||||||
<section id="coriolis"></section>
|
<script async src='https://www.google-analytics.com/analytics.js'></script>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
</body>
|
<!-- Piwik -->
|
||||||
</html>
|
<!-- <script type="text/javascript">
|
||||||
|
var _paq = _paq || [];
|
||||||
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
|
_paq.push(["setCookieDomain", "*.coriolis.edcd.io"]);
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
(function() {
|
||||||
|
var u="//stats.isadankme.me/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||||
|
_paq.push(['setSiteId', '4']);
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
</script>-->
|
||||||
|
<!-- End Piwik Code -->
|
||||||
|
|
||||||
|
<!-- Bugsnag -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
|
||||||
|
<script src="https://d2wy8f7a9ursnm.cloudfront.net/v5.0.0/bugsnag.min.js"></script>
|
||||||
|
<script src="/clippy.min.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
const advice = ['When all else fails, Put a docking computer in every slot. My name is Clippy.',
|
||||||
|
'Fly in a stright line and roll, your evasion increases by 200%!',
|
||||||
|
'Boost!!!',
|
||||||
|
'If you are running out of power, consider deactivating thrusters!',
|
||||||
|
'Make sure to set fire-groups for your SCBs!',
|
||||||
|
'If you find yourself dying often - git gud!',
|
||||||
|
'Remember, shield boosters increase skill!',
|
||||||
|
'Remember, B rated drives offer greater speed!',
|
||||||
|
'Point directly into the jet cone and full throttle for optimal FSD boost.',
|
||||||
|
'Raxxla can only be found in open play.',
|
||||||
|
'Try silent running when under focus to drop aggro, and reboot when your opponents lose sight of you!'];
|
||||||
|
clippy.load('Clippy', function(agent) {
|
||||||
|
// do anything with the loaded agent
|
||||||
|
agent.show();
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
agent.animate();
|
||||||
|
const toSpeak = advice[Math.random() * advice.length >> 0];
|
||||||
|
agent.speak(toSpeak);
|
||||||
|
}, (20000));
|
||||||
|
setInterval(() => {
|
||||||
|
agent.animate();
|
||||||
|
agent.speak('@everyone FDL. :pray:');
|
||||||
|
}, (69000));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
window.bugsnagClient = bugsnag('ba9fae819372850fb660755341fa6ef5', { appVersion: window.BUGSNAG_VERSION || undefined });
|
||||||
|
window.Bugsnag = window.bugsnagClient;
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body style="background-color:#000;">
|
||||||
|
<section id="coriolis"></section>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
@@ -184,3 +184,5 @@ footer {
|
|||||||
border: 1px @secondary solid;
|
border: 1px @secondary solid;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@import "../../node_modules/clippy.js/build/clippy.css";
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
// Foreground colors
|
// Foreground colors
|
||||||
@fg: #CCC;
|
@fg: #CCC;
|
||||||
@muted: #999;
|
@muted: #999;
|
||||||
@primary: #FF8C0D; // Light Orange
|
@primary: #e64980; // Light Orange
|
||||||
@secondary: #1FB0FF; // Light blue
|
@secondary: #9775fa; // Light blue
|
||||||
@warning: #FF3B00; // Dark Orange
|
@warning: #FF3B00; // Dark Orange
|
||||||
@disabled: #555; // Light grey
|
@disabled: #555; // Light grey
|
||||||
@success: #71a052; // Green
|
@success: #71a052; // Green
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module.exports = {
|
|||||||
publicPath: '/'
|
publicPath: '/'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CopyWebpackPlugin(['src/.htaccess', 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js']),
|
new CopyWebpackPlugin(['src/.htaccess', 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js', 'src/clippy.min.js']),
|
||||||
// new webpack.optimize.CommonsChunkPlugin({
|
// new webpack.optimize.CommonsChunkPlugin({
|
||||||
// name: 'lib',
|
// name: 'lib',
|
||||||
// filename: 'lib.js'
|
// filename: 'lib.js'
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module.exports = {
|
|||||||
from: 'src/images/logo/*',
|
from: 'src/images/logo/*',
|
||||||
flatten: true,
|
flatten: true,
|
||||||
to: ''
|
to: ''
|
||||||
}, 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js']),
|
}, 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js', 'src/clippy.min.js']),
|
||||||
// new webpack.optimize.CommonsChunkPlugin({
|
// new webpack.optimize.CommonsChunkPlugin({
|
||||||
// name: 'lib',
|
// name: 'lib',
|
||||||
// filename: 'lib.[chunkhash:6].js'
|
// filename: 'lib.[chunkhash:6].js'
|
||||||
|
|||||||
Reference in New Issue
Block a user