diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de0cb06 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +*.sublime* diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..771cbfc --- /dev/null +++ b/TODO.md @@ -0,0 +1,8 @@ +# Todo + +- Update all texts with polite ones +- Achievements (at least alert only) +- Wikipedia/additional info about everything +- More feedback + - Money change indicators (+ green / - red) + - Detector feedback for workers \ No newline at end of file diff --git a/assets/github.png b/assets/github.png new file mode 100644 index 0000000..8b25551 Binary files /dev/null and b/assets/github.png differ diff --git a/assets/github@2x.png b/assets/github@2x.png new file mode 100644 index 0000000..182a1a3 Binary files /dev/null and b/assets/github@2x.png differ diff --git a/assets/icons/png/BBbar.png b/assets/icons/png/BBbar.png new file mode 100644 index 0000000..95be602 Binary files /dev/null and b/assets/icons/png/BBbar.png differ diff --git a/assets/icons/png/BBbar@2x.png b/assets/icons/png/BBbar@2x.png new file mode 100644 index 0000000..272c964 Binary files /dev/null and b/assets/icons/png/BBbar@2x.png differ diff --git a/assets/icons/png/CPV.png b/assets/icons/png/CPV.png new file mode 100644 index 0000000..f13aee1 Binary files /dev/null and b/assets/icons/png/CPV.png differ diff --git a/assets/icons/png/CPV@2x.png b/assets/icons/png/CPV@2x.png new file mode 100644 index 0000000..7addbed Binary files /dev/null and b/assets/icons/png/CPV@2x.png differ diff --git a/assets/icons/png/H.png b/assets/icons/png/H.png new file mode 100644 index 0000000..7a59746 Binary files /dev/null and b/assets/icons/png/H.png differ diff --git a/assets/icons/png/H@2x.png b/assets/icons/png/H@2x.png new file mode 100644 index 0000000..9c2f027 Binary files /dev/null and b/assets/icons/png/H@2x.png differ diff --git a/assets/icons/png/Jpsi.png b/assets/icons/png/Jpsi.png new file mode 100644 index 0000000..785cc26 Binary files /dev/null and b/assets/icons/png/Jpsi.png differ diff --git a/assets/icons/png/Jpsi@2x.png b/assets/icons/png/Jpsi@2x.png new file mode 100644 index 0000000..3125c41 Binary files /dev/null and b/assets/icons/png/Jpsi@2x.png differ diff --git a/assets/icons/png/antihydrogen.png b/assets/icons/png/antihydrogen.png new file mode 100644 index 0000000..dbc4c6b Binary files /dev/null and b/assets/icons/png/antihydrogen.png differ diff --git a/assets/icons/png/antihydrogen@2x.png b/assets/icons/png/antihydrogen@2x.png new file mode 100644 index 0000000..341964e Binary files /dev/null and b/assets/icons/png/antihydrogen@2x.png differ diff --git a/assets/icons/png/b.png b/assets/icons/png/b.png new file mode 100644 index 0000000..ebeb63c Binary files /dev/null and b/assets/icons/png/b.png differ diff --git a/assets/icons/png/b@2x.png b/assets/icons/png/b@2x.png new file mode 100644 index 0000000..8a0a199 Binary files /dev/null and b/assets/icons/png/b@2x.png differ diff --git a/assets/icons/png/t.png b/assets/icons/png/t.png new file mode 100644 index 0000000..04a58a2 Binary files /dev/null and b/assets/icons/png/t.png differ diff --git a/assets/icons/png/t@2x.png b/assets/icons/png/t@2x.png new file mode 100644 index 0000000..8f26264 Binary files /dev/null and b/assets/icons/png/t@2x.png differ diff --git a/assets/icons/png/tau.png b/assets/icons/png/tau.png new file mode 100644 index 0000000..b468a68 Binary files /dev/null and b/assets/icons/png/tau.png differ diff --git a/assets/icons/png/tau@2x.png b/assets/icons/png/tau@2x.png new file mode 100644 index 0000000..1ad34d5 Binary files /dev/null and b/assets/icons/png/tau@2x.png differ diff --git a/assets/icons/png/unknown.png b/assets/icons/png/unknown.png new file mode 100644 index 0000000..1ce5f8c Binary files /dev/null and b/assets/icons/png/unknown.png differ diff --git a/assets/icons/png/unknown@2x.png b/assets/icons/png/unknown@2x.png new file mode 100644 index 0000000..0947e3f Binary files /dev/null and b/assets/icons/png/unknown@2x.png differ diff --git a/assets/icons/png/weak.png b/assets/icons/png/weak.png new file mode 100644 index 0000000..5a5f429 Binary files /dev/null and b/assets/icons/png/weak.png differ diff --git a/assets/icons/png/weak@2x.png b/assets/icons/png/weak@2x.png new file mode 100644 index 0000000..82cadc3 Binary files /dev/null and b/assets/icons/png/weak@2x.png differ diff --git a/assets/icons/svg/BBbar.svg b/assets/icons/svg/BBbar.svg new file mode 100644 index 0000000..74bca0b --- /dev/null +++ b/assets/icons/svg/BBbar.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + B + diff --git a/assets/icons/svg/CPV.svg b/assets/icons/svg/CPV.svg new file mode 100644 index 0000000..aeb2ba2 --- /dev/null +++ b/assets/icons/svg/CPV.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + CP + + diff --git a/assets/icons/svg/H.svg b/assets/icons/svg/H.svg new file mode 100644 index 0000000..821829f --- /dev/null +++ b/assets/icons/svg/H.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + H + diff --git a/assets/icons/svg/Jpsi.svg b/assets/icons/svg/Jpsi.svg new file mode 100644 index 0000000..19e0b85 --- /dev/null +++ b/assets/icons/svg/Jpsi.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + cc _ + + diff --git a/assets/icons/svg/antihydrogen.svg b/assets/icons/svg/antihydrogen.svg new file mode 100644 index 0000000..99a0da0 --- /dev/null +++ b/assets/icons/svg/antihydrogen.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + p _ e+ + diff --git a/assets/icons/svg/b.svg b/assets/icons/svg/b.svg new file mode 100644 index 0000000..7855ccb --- /dev/null +++ b/assets/icons/svg/b.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + b + diff --git a/assets/icons/svg/t.svg b/assets/icons/svg/t.svg new file mode 100644 index 0000000..0119855 --- /dev/null +++ b/assets/icons/svg/t.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + t + diff --git a/assets/icons/svg/tau.svg b/assets/icons/svg/tau.svg new file mode 100644 index 0000000..661b307 --- /dev/null +++ b/assets/icons/svg/tau.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + τ + diff --git a/assets/icons/svg/unknown.svg b/assets/icons/svg/unknown.svg new file mode 100644 index 0000000..a3990b5 --- /dev/null +++ b/assets/icons/svg/unknown.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + ? + diff --git a/assets/icons/svg/weak.svg b/assets/icons/svg/weak.svg new file mode 100644 index 0000000..70bdd3d --- /dev/null +++ b/assets/icons/svg/weak.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + Z0 + W± + diff --git a/assets/info/b.png b/assets/info/b.png new file mode 100644 index 0000000..8314d94 Binary files /dev/null and b/assets/info/b.png differ diff --git a/assets/info/cpv.png b/assets/info/cpv.png new file mode 100644 index 0000000..a7cce3c Binary files /dev/null and b/assets/info/cpv.png differ diff --git a/assets/info/jpsi.png b/assets/info/jpsi.png new file mode 100644 index 0000000..ced44c3 Binary files /dev/null and b/assets/info/jpsi.png differ diff --git a/assets/info/tau.png b/assets/info/tau.png new file mode 100644 index 0000000..0a717fc Binary files /dev/null and b/assets/info/tau.png differ diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..e7ca1a0 --- /dev/null +++ b/css/style.css @@ -0,0 +1,112 @@ +* { + border-radius: 0 !important; +} + +h1 br { + display: none; +} + +#InfoBox { + color: #666; + position: fixed; + right: 0; + left: 0; + bottom: 0; + padding: 5px; + text-align: center; +} + +#detector { + cursor: pointer; + margin: 0 auto; + position: relative; + width: 400px; + height: 400px; +} + +#detector canvas { + position: absolute; + left: 0; + top: 0; +} + +#detector-core { + z-index: 0; +} + +#detector-events { + z-index: 1; +} + +#ResearchHist { + margin: 20px; +} + +.bar rect { + fill: steelblue; + shape-rendering: crispEdges; +} + +.bar text { + fill: #fff; +} + +.axis path, .axis line { + fill: none; + stroke: #000; + shape-rendering: crispEdges; +} + +.scrollable { + overflow: auto; +} + +#achievements-container { + position: fixed; bottom: 0px; left: 0px; +} + +#achievements-container .alert { + margin-bottom: 10px; position: relative; +} + +#achievements-container .alert-glyph { + float:left; font-size: 20px; margin-right: 10px; +} + +#achievements-container .alert-text { + font-size: 14px; font-weight: bold; +} + +.achievements-button { + margin-top: -48px; +} + +#Status { + font-size: x-large; +} + +#Status strong { + color: #666; +} + +.update-value { + position: relative; +} + +.update-plus { + color: green; + float: left; + right: 5px; + position: absolute; +} + +.update-minus { + color: red; + float: left; + right: 5px; + position: absolute; +} + +#mylab { + margin-right: 48px; +} diff --git a/html/BBbar.html b/html/BBbar.html new file mode 100644 index 0000000..b0da8bb --- /dev/null +++ b/html/BBbar.html @@ -0,0 +1,11 @@ +

You discovered the Oscillation of Neutral B Mesons.

+
The Oscillation of Neutral B mesons
+A plot from one of the original publications +

+More information will come soon... +

+ +
Resources
+ diff --git a/html/CPV.html b/html/CPV.html new file mode 100644 index 0000000..0872ff8 --- /dev/null +++ b/html/CPV.html @@ -0,0 +1,32 @@ +

You discovered CP-violation!

+ +

CP Symmetry

+

C (Charge) and P (Parity) are discrete transformations that can be applied to a physical system.

+

If a theory is symmetric under C, then it works the same if all particles are exchanged with their antiparticles. +If it has P-symmetry, then it is invariant under inversion ("mirroring") of all spatial coordinates

+ +

For a long time, physicists believed that all of physics is invariant under the combination CP of both symmetries. +It turned out that this is wrong, as was discovered by Cronin, Fitch et al. in 1964 when they studied the decay of the neutral K meson.

+ +
+
+
CPV in the Kaon System
+
+ A plot from the original publication +
+
+

In 1964, Cronin, Fitch, et al. showed that CP symmetry is broken in the decay of the long-lived neutral K meson.

+

If all of physics was invariant under CP transformation, then this long-lived version of the K meson would never decay into 2 pions.

+

Yet, this kind of decay was discovered!

+

You can see their results on the left: In the middle plot (the one relevant for K meson decays), a clear excess is recognizable.

+

For their discovery, Cronin and Fitch received the Nobel price in 1980.

+
+
+ +
Resources
+ +
diff --git a/html/H.html b/html/H.html new file mode 100644 index 0000000..fa158fe --- /dev/null +++ b/html/H.html @@ -0,0 +1,11 @@ +

You discovered the Higgs-boson.

+
The Higgs boson
+A plot from one of the original publications +

+More information will come soon... +

+ +
Resources
+ diff --git a/html/Jpsi.html b/html/Jpsi.html new file mode 100644 index 0000000..8d85015 --- /dev/null +++ b/html/Jpsi.html @@ -0,0 +1,17 @@ +

You discovered the J/ψ meson.

+
The J/ψ meson
+A plot from one of the original publications +

The J/ψ is a meson consisting of a charm quark and a charm antiquark. It is the first excited state of the charmonium (the bound state of a charm-anticharm state), that was discovered independently by two research groups in 1974: one at the Stanford Linear Accelerator Center, headed by Burton Richter, and one at the Brookhaven National Laboratory, headed by Samuel Ting of MIT. Richter and Ting were rewarded for their shared discovery with the 1976 Nobel Prize in Physics. +

+ +
History of the name
+

+Because of the nearly simultaneous discovery, the J/ψ is the only particle to have a two-letter name. Richter named it "SP", after the SPEAR accelerator used at SLAC; however, none of his coworkers liked that name. After consulting with Greek-born Leo Resvanis to see which Greek letters were still available, and rejecting "iota" because its name implies insignificance, Richter chose "ψ" – a name which, as Gerson Goldhaber pointed out, contains the original name "SP", but in reverse order.
Since the scientific community considered it unjust to give one of the two discoverers priority, most subsequent publications have referred to the particle as the "J/ψ" +

+ +
Resources
+ diff --git a/html/antihydrogen.html b/html/antihydrogen.html new file mode 100644 index 0000000..f771694 --- /dev/null +++ b/html/antihydrogen.html @@ -0,0 +1,11 @@ +

You discovered Antihydrogen.

+
The antihidrogen
+A plot from one of the original publications +

+More information will come soon... +

+ +
Resources
+ diff --git a/html/b.html b/html/b.html new file mode 100644 index 0000000..ec9ae9a --- /dev/null +++ b/html/b.html @@ -0,0 +1,18 @@ +

You discovered the bottom quark.

+ +
The bottom quark
+A plot from one of the original publications +
+

The bottom (or beauty) quark is a third-generation quark with a charge of -1/3. It has a large mass (around 4.2 GeV/c^2 — more that 4 times the proton mass!). The bottom quark is notable because it is a product in almost all top quark decays, and is a frequent decay product for the Higgs boson. +

+ +
History of the discovery
+

+The bottom quark was predicted in 1973 by physicists Makoto Kobayashi and Toshihide Maskawa as part of their explanation for CP violation. The name "bottom" was introduced in 1975 by Haim Harari. The bottom quark was discovered in 1977 by the Fermilab E288 experiment team led by Leon M. Lederman, when collisions produced bottomonium. Kobayashi and Maskawa won the 2008 Nobel Prize in Physics for their explanation of CP-violation. Upon its discovery, there were efforts to name the bottom quark "beauty", but "bottom" became the predominant name. +

+ +
Resources
+ diff --git a/html/detector.html b/html/detector.html new file mode 100644 index 0000000..4c27f20 --- /dev/null +++ b/html/detector.html @@ -0,0 +1,35 @@ +

The description of the detector.

+
The particle detectors
+ +

+Particle detectors are high-tech devices used to study the interactions of composite and elementary particles. +The detected particles can originate from nuclear decays, cosmic radiation or interactions in a particle accelerator. +Modern detectors, such as those used at the LHC consist of many components, of which many are specialized to detect certain particles or certain particle properties. +

+ +
Layers
+
  Tracker
+

+ The tracker helps us to calculate the momentum of charged particles. They bend due to magnetic field. The smaller the curve radius is, the less momentum the particle had. We also differentiate positive and negative particles based on the direction of the track. +

+ +
  Electromagnetic calorimeter
+

+ The Electromagnetic Calorimeter (ECAL) is used to measur with the energies of electrons and photons. +

+ +
  Hadronic calorimeter
+

+ The Hadron Calorimeter (HCAL) is used to measure the energy of hadrons, particles made of quarks and gluons. Some examples of them are protons, neutrons and pions. It also helps us detect neutrinos but indirectly. Energy needs to be conserved, so if we observe missing enery, this indicates neutrinos. +

+ +
  Muon chamber
+

+ Muons are charged particles that are just like electrons and positrons, but are 200 times more massive. Because they can penetrate several metres of iron without interacting, the muon chamber is placed at the very edge of the detector where they are the only particles likely to register a signal. +

+ +
Resources
+ diff --git a/html/t.html b/html/t.html new file mode 100644 index 0000000..e19a8fa --- /dev/null +++ b/html/t.html @@ -0,0 +1,16 @@ +

You discovered the top quark.

+
The top quark
+A plot from one of the original publications +

+More information will come here... +

+ +
History
+

+...and also here. +

+ +
Resources
+ diff --git a/html/tau.html b/html/tau.html new file mode 100644 index 0000000..5ba991d --- /dev/null +++ b/html/tau.html @@ -0,0 +1,17 @@ +

You discovered the Tau lepton.

+
The tau lepton
+A plot from the original publication +The tau is an elementary particle similar to the electron, with negative electric charge and a spin of 1/2. Together with the electron, the muon, and the three neutrinos, it is classified as a lepton. Despite of the meaning of the word lepton (fine, small, thin) the tau is very massive: it has mass of 1776.82 MeV/c^2 (for comparison: the mass of the electron is 0.511 MeV/c^2, the mass of the proton is 938.27 MeV/c^2). +

+ +
The discovery of the tau
+

+The tau was detected in a series of experiments between 1974 and 1977 by Martin Lewis Perl with his colleagues at the SLAC-LBL group. Their equipment consisted of SLAC's then-new e+–e− colliding ring, called SPEAR, and the LBL magnetic detector. They could detect and distinguish between leptons, hadrons and photons.
+Martin Perl shared the 1995 Nobel Prize in Physics with Frederick Reines. The latter was awarded his share of the prize for experimental discovery of the neutrino. +

+ +
Resources
+ diff --git a/html/weak.html b/html/weak.html new file mode 100644 index 0000000..0783329 --- /dev/null +++ b/html/weak.html @@ -0,0 +1,11 @@ +

You discovered the W and Z bosons.

+
The weak force
+A plot from one of the original publications +

+More information will come soon... +

+ +
Resources
+ diff --git a/index.html b/index.html new file mode 100644 index 0000000..4b17ed8 --- /dev/null +++ b/index.html @@ -0,0 +1,177 @@ + + + + Particle Clicker + + + + + + + +
+
+

Research

+
+ +
+ +
+

{{ lc.lab.name }} Click here to change the name

+
+ +
+ + Your detector. Click on it to generate events. + + + Your detector. Click on it to generate events. + +
+
+
+ Data +
+ {{ lc.lab.data | niceNumber }} +
+
+
+ Reputation +
+ {{ lc.lab.reputation | niceNumber }} +
+
+
+ Funding +
+ {{ lc.lab.money | currency }} +
+
+
+
+ +
+

HR

+
+ +
+ +
+

Upgrades

+
+ +
+
+ + + + + +
+ Particle Clicker GitHub +
+ + + +
+ +
+ + + + + + + + + + + + + diff --git a/js/achievements.js b/js/achievements.js new file mode 100644 index 0000000..27ec3f0 --- /dev/null +++ b/js/achievements.js @@ -0,0 +1,140 @@ +var achievements = +{ + list: [], + listSpecial: [], + listSummary: [], + + startTime: new Date(), + + count: + { + clicks: 0, + data: 0, + money: 0, + reputation: 0, + workers: 0, + dataSpent: 0, + moneyWorkers: 0, + moneyUpgrades: 0 + }, + + workers: {}, + research: {}, + + setList: function(list) + { + for (var i = 0; i < list.length; i++) { + if (list[i].type == list[i].target) { + achievements.listSpecial.push(list[i]); + for (var item in achievements[list[i].type]) { + var a = $.extend(true, {}, list[i]); + a.target = item; + if (list[i].type == 'workers' && list[i].threshold == 1) { + a.description = a.description.replace('${name}', item.substring(0, item.length - 1)); + } else { + a.description = a.description.replace('${name}', item); + } + achievements.list.push(a); + } + } else { + achievements.list.push(list[i]); + } + } + + achievements.list.map(function(item) { + item.completed = false; + item.alerted = false; + item.is_visible = function() { + return this.completed; + }; + }); + }, + + addWorkers: function(list) + { + for (var i = 0; i < list.length; i++) { + achievements.workers[list[i].name] = 0; + } + }, + + addResearch: function(list) + { + for (var i = 0; i < list.length; i++) { + achievements.research[list[i].name] = 0; + } + }, + + update: function(type, subtype, val) + { + achievements[type][subtype] += val; + + for (var i = 0; i < achievements.list.length; i++) { + if (achievements.list[i].type == type && + achievements.list[i].target == subtype && + achievements[type][subtype] >= achievements.list[i].threshold + ) + { + console.log(achievements.list[i].threshold, achievements[type][subtype]); + + achievements.list[i].completed = true; + achievements.displayAchievement(i); + } + } + }, + + displayAchievement: function(i) + { + var alert = ''; + + alert = $(alert); + + if (achievements.list[i].completed && !achievements.list[i].alerted) { + $('#achievements-container').prepend(alert); + + var remove = function(a) + { + return function() + { + a.slideUp(300); + }; + }; + + window.setTimeout(remove(alert), 2000); + achievements.list[i].alerted = true; + + var a = $.extend(true, {}, achievements.list[i]); + a.time = achievements.timeFormatter(new Date().getTime() - achievements.startTime.getTime()); + achievements.listSummary.push(a); + } + }, + + timeFormatter: function(msec) + { + var totals = Math.ceil(msec / 1000); + var days = Math.floor(totals / (24 * 60 * 60)); + var hours = Math.floor((totals % (24 * 60 * 60)) / (60 * 60)); + var totalmin = (totals % (24 * 60 * 60)) % (60 * 60); + var mins = Math.floor(totalmin / 60); + var secs = totalmin % 60; + + var str = []; + if (days > 0) { + str.push(days + ' day' + (days % 100 == 1 ? '' : 's')); + } + if (hours > 0) { + str.push(hours + ' h'); + } + if (mins > 0) { + str.push(mins + ' min'); + } + if (secs > 0) { + str.push(secs + ' s'); + } + + return str.join(', '); + } +}; + diff --git a/js/detector.js b/js/detector.js new file mode 100644 index 0000000..b6959fb --- /dev/null +++ b/js/detector.js @@ -0,0 +1,316 @@ +var detector = +{ + core: + { + canvas: null, + ctx: null + }, + + events: + { + canvas: null, + ctx: null, + list: [], + }, + + visible: true, + + width: 400, + height: 400, + + ratio: 1, + + colors: + { + siliconRing: '#FFF371', + siliconRingLine: '#EAC918', + ecal: '#C5FF82', + ecalLine: '#9EFF28', + hcal: '#E1FF79', + hcalLine: '#C9FF2D', + lightRing: '#A0B3FF', + lightRingLine: '#A0B3FF', + darkRing: '#7280B8', + darkRingLine: '#7280B8', + + mucalLight: '#FFDFB7', + mucalLightLine: '#FFDFB7', + mucalDark: '#EA301F', + mucalDarkLine: '#C5291A' + }, + + radius: + { + siliconInner: 10, + silicon: 30, + siliconSpace: 35, + ecal: 50, + hcal: 80, + darkRing1: 83, + darkRing1Space: 86, + lightRing: 92, + lightRingSpace: 94, + darkRing2: 100, + + mucal: 107, + mucalLight: 8, + mucalDark: 18 + }, + + tracks: + [ + { + name: 'electron', + color: '#0016EA' + }, + + { + name: 'jet', + color: '#0B7700' + }, + + { + name: 'muon', + color: '#775400' + } + ], + + animate: function() + { + requestAnimFrame(detector.animate); + detector.draw(); + }, + + init: function() + { + detector.core.canvas = document.getElementById('detector-core'); + detector.core.ctx = detector.core.canvas.getContext('2d'); + + detector.events.canvas = document.getElementById('detector-events'); + detector.events.ctx = detector.events.canvas.getContext('2d'); + + var devicePixelRatio = window.devicePixelRatio || 1; + var backingStoreRatio = detector.core.ctx.webkitBackingStorePixelRatio || + detector.core.ctx.mozBackingStorePixelRatio || + detector.core.ctx.msBackingStorePixelRatio || + detector.core.ctx.oBackingStorePixelRatio || + detector.core.ctx.backingStorePixelRatio || 1; + + var ratio = devicePixelRatio / backingStoreRatio; + + detector.ratio = detector.core.canvas.width / 400; + + detector.width = detector.core.canvas.width; + detector.height = detector.core.canvas.height; + + if (devicePixelRatio !== backingStoreRatio) { + var oldWidth = detector.core.canvas.width; + var oldHeight = detector.core.canvas.height; + + detector.core.canvas.width = oldWidth * ratio; + detector.core.canvas.height = oldHeight * ratio; + detector.core.canvas.style.width = oldWidth + 'px'; + detector.core.canvas.style.height = oldHeight + 'px'; + + detector.events.canvas.width = oldWidth * ratio; + detector.events.canvas.height = oldHeight * ratio; + detector.events.canvas.style.width = oldWidth + 'px'; + detector.events.canvas.style.height = oldHeight + 'px'; + + // now scale the context to counter + // the fact that we've manually scaled + // our canvas element + detector.core.ctx.scale(ratio, ratio); + detector.events.ctx.scale(ratio, ratio); + } + + detector.core.ctx.scale(detector.ratio, detector.ratio); + detector.events.ctx.scale(detector.ratio, detector.ratio); + + detector.coreDraw(); + detector.animate(); + }, + + coreDraw: function() + { + var ctx = detector.core.ctx; + var cx = detector.width / 2; + var cy = detector.height / 2; + + ctx.clearRect(0, 0, 400, 400); + + var muSplit = 2/12; + for (var k = 3; k >= 1; k--) { + ctx.strokeStyle = detector.colors.mucalDarkLine; + ctx.fillStyle = detector.colors.mucalDark; + + ctx.beginPath(); + ctx.moveTo(cx + (detector.radius.mucal + k * detector.radius.mucalLight + k * detector.radius.mucalDark) * Math.cos(Math.PI * muSplit), cx + (detector.radius.mucal + k * detector.radius.mucalLight + k * detector.radius.mucalDark) * Math.sin(Math.PI * muSplit)); + for (var i = 1; i <= 13; i++) { + ctx.lineTo(cx + (detector.radius.mucal + k * detector.radius.mucalLight + k * detector.radius.mucalDark) * Math.cos(Math.PI * i * muSplit), cx + (detector.radius.mucal + k * detector.radius.mucalLight + k * detector.radius.mucalDark) * Math.sin(Math.PI * i * muSplit)); + } + ctx.stroke(); + ctx.fill(); + + ctx.beginPath(); + ctx.moveTo(cx + (detector.radius.mucal + k * detector.radius.mucalLight + (k-1) * detector.radius.mucalDark) * Math.cos(Math.PI * muSplit), cx + (detector.radius.mucal + k * detector.radius.mucalLight + (k-1) * detector.radius.mucalDark) * Math.sin(Math.PI * muSplit)); + for (var i = 1; i <= 13; i++) { + ctx.lineTo(cx + (detector.radius.mucal + k * detector.radius.mucalLight + (k-1) * detector.radius.mucalDark) * Math.cos(Math.PI * i * muSplit), cx + (detector.radius.mucal + k * detector.radius.mucalLight + (k-1) * detector.radius.mucalDark) * Math.sin(Math.PI * i * muSplit)); + } + ctx.stroke(); + ctx.fillStyle = detector.colors.mucalLight; + ctx.fill(); + } + + ctx.strokeStyle = detector.colors.mucalDarkLine; + ctx.beginPath(); + ctx.moveTo(cx + detector.radius.mucal * Math.cos(Math.PI * muSplit), cx + detector.radius.mucal * Math.sin(Math.PI * muSplit)); + for (var i = 1; i <= 13; i++) { + ctx.lineTo(cx + detector.radius.mucal * Math.cos(Math.PI * i * muSplit), cx + detector.radius.mucal * Math.sin(Math.PI * i * muSplit)); + } + ctx.stroke(); + ctx.globalCompositeOperation = 'destination-out'; + ctx.fill(); + ctx.globalCompositeOperation = 'source-over'; + + + ctx.beginPath(); + ctx.strokeStyle = detector.colors.darkRingLine; + ctx.fillStyle = detector.colors.darkRing; + ctx.arc(cx, cy, detector.radius.darkRing2, 0, Math.PI * 2, true); + ctx.fill(); + ctx.stroke(); + + ctx.beginPath(); + ctx.globalCompositeOperation = 'destination-out'; + ctx.arc(cx, cy, detector.radius.lightRingSpace, 0, Math.PI * 2, true); + ctx.fill(); + ctx.globalCompositeOperation = 'source-over'; + + ctx.beginPath(); + ctx.strokeStyle = detector.colors.lightRingLine; + ctx.fillStyle = detector.colors.lightRing; + ctx.arc(cx, cy, detector.radius.lightRing, 0, Math.PI * 2, true); + ctx.fill(); + ctx.stroke(); + + ctx.beginPath(); + ctx.globalCompositeOperation = 'destination-out'; + ctx.arc(cx, cy, detector.radius.darkRing1Space, 0, Math.PI * 2, true); + ctx.fill(); + ctx.globalCompositeOperation = 'source-over'; + + ctx.beginPath(); + ctx.strokeStyle = detector.colors.darkRingLine + ctx.fillStyle = detector.colors.darkRing; + ctx.arc(cx, cy, detector.radius.darkRing1, 0, Math.PI * 2, true); + ctx.fill(); + ctx.stroke(); + + ctx.beginPath(); + ctx.globalCompositeOperation = 'destination-out'; + ctx.arc(cx, cy, detector.radius.ecal, 0, Math.PI * 2, true); + ctx.fill(); + ctx.globalCompositeOperation = 'source-over'; + + + ctx.strokeStyle = detector.colors.hcalLine; + ctx.fillStyle = detector.colors.hcal; + var calSplit = 20/2; + for (var i = 0; i < 20; i++) { + ctx.beginPath(); + ctx.moveTo(cx + detector.radius.ecal * Math.cos(Math.PI * i / calSplit), cx + detector.radius.ecal * Math.sin(Math.PI * i / calSplit)); + ctx.lineTo(cx + detector.radius.hcal * Math.cos(Math.PI * i / calSplit), cx + detector.radius.hcal * Math.sin(Math.PI * i / calSplit)); + ctx.arc(cx, cy, detector.radius.hcal, Math.PI * i / calSplit, Math.PI * (i+1) / calSplit, false); + ctx.lineTo(cx + detector.radius.ecal * Math.cos(Math.PI * (i+1) / calSplit), cx + detector.radius.ecal * Math.sin(Math.PI * (i+1) / calSplit)); + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + + ctx.strokeStyle = detector.colors.ecalLine; + ctx.fillStyle = detector.colors.ecal; + var calSplit = 20/2; + for (var i = 0; i < 20; i++) { + ctx.beginPath(); + ctx.moveTo(cx + detector.radius.siliconSpace * Math.cos(Math.PI * i / calSplit), cx + detector.radius.siliconSpace * Math.sin(Math.PI * i / calSplit)); + ctx.lineTo(cx + detector.radius.ecal * Math.cos(Math.PI * i / calSplit), cx + detector.radius.ecal * Math.sin(Math.PI * i / calSplit)); + ctx.lineTo(cx + detector.radius.ecal * Math.cos(Math.PI * (i+1) / calSplit), cx + detector.radius.ecal * Math.sin(Math.PI * (i+1) / calSplit)); + ctx.lineTo(cx + detector.radius.siliconSpace * Math.cos(Math.PI * (i+1) / calSplit), cx + detector.radius.siliconSpace * Math.sin(Math.PI * (i+1) / calSplit)); + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + + ctx.beginPath(); + ctx.strokeStyle = detector.colors.siliconRingLine; + ctx.fillStyle = detector.colors.siliconRing; + ctx.arc(cx, cy, detector.radius.silicon, 0, Math.PI * 2, true); + ctx.fill(); + ctx.stroke(); + + ctx.beginPath(); + ctx.strokeStyle = detector.colors.siliconRingLine; + ctx.fillStyle = detector.colors.siliconRing; + ctx.arc(cx, cy, detector.radius.siliconInner, 0, Math.PI * 2, true); + ctx.fill(); + ctx.stroke(); + }, + + addEvent: function() + { + var num = Math.ceil(20 * Math.random()); + + for (var i = 0; i < num; i++) { + var index = Math.round(Math.random() * (detector.tracks.length - 1)); + var event = new ParticleEvent(detector.tracks[index], num); + detector.events.list.push(event); + } + }, + + addEventExternal: function() + { + if (!detector.visible) { + return; + } + + var num = Math.min(30 * achievements.count.workers / 10, 30); + + for (var i = 0; i < num; i++) { + var index = Math.round(Math.random() * (detector.tracks.length - 1)); + var event = new ParticleEvent(detector.tracks[index], num, true); + detector.events.list.push(event); + } + }, + + draw: function() + { + detector.events.ctx.clearRect(0, 0, 400, 400); + + var del = -1; + for (var e in detector.events.list) { + if (detector.events.list[e].alpha > 0) { + detector.events.list[e].draw(); + } else { + del = detector.events.list[e].count; + } + } + + if (del >= 0) { + detector.events.list.splice(0, del); + } + } +}; + +window.requestAnimFrame = (function(){ + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(/* function */ callback, /* DOMElement */ element){ + window.setTimeout(callback, 1000 / 60); + }; +})(); + +(function() { detector.init(); })(); diff --git a/js/event.js b/js/event.js new file mode 100644 index 0000000..a21ee8a --- /dev/null +++ b/js/event.js @@ -0,0 +1,62 @@ +function ParticleEvent(type, count, external) +{ + this.work = typeof external !== 'undefined' ? external : false; + this.type = type; + this.length = 0; + this.radius = 0; + this.direction = 0; + this.sign = (Math.random() - 0.5 >= 0) ? 1 : -1; + this.alpha = this.work ? 0.5 : 1; + this.count = count; + + switch (this.type.name) + { + case 'electron': + this.length = detector.radius.siliconSpace + Math.round((detector.radius.ecal + 10 - detector.radius.siliconSpace) * Math.random()); + this.direction = Math.random() * Math.PI * 2; + this.radius = 20 + Math.round((100 - 20) * Math.random()); + break; + case 'jet': + this.length = detector.radius.ecal + Math.round((detector.radius.mucal - detector.radius.ecal) * Math.random()); + this.direction = Math.random() * Math.PI * 2; + this.radius = 40 + Math.round((200 - 40) * Math.random()); + break; + case 'muon': + this.length = detector.radius.mucal + 3 * detector.radius.mucalDark + Math.round((4 * detector.radius.mucalLight + 2 * detector.radius.mucalDark) * Math.random()); + this.direction = Math.random() * Math.PI * 2; + this.radius = 200 + Math.round((600 - 200) * Math.random()); + break; + } + + this.draw(true); +}; + +ParticleEvent.prototype.draw = function(init) +{ + init = typeof init !== 'undefined' ? init : false; + + var ctx = detector.events.ctx; + var cx = detector.width / 2; + var cy = detector.height / 2; + + ctx.save(); + + ctx.globalAlpha = this.alpha; + ctx.strokeStyle = this.type.color; + ctx.fillStyle = this.type.color; + ctx.lineWidth = 2; + + ctx.translate(cx, cy); + ctx.rotate(this.direction); + ctx.translate(-cx, -cy); + + ctx.beginPath(); + ctx.arc(cx + this.length / 2, cy + this.sign * Math.round(Math.sqrt(Math.abs(this.radius * this.radius - this.length * this.length / 4))), this.radius, - this.sign * Math.PI / 2 - Math.asin(this.length / (2 * this.radius)), - this.sign * Math.PI / 2 + Math.asin(this.length / (2 * this.radius)), false); + ctx.stroke(); + + ctx.restore(); + + if (!init) { + this.alpha -= 0.02; + } +}; diff --git a/js/external/retina.js b/js/external/retina.js new file mode 100755 index 0000000..38d5515 --- /dev/null +++ b/js/external/retina.js @@ -0,0 +1,196 @@ +/*! + * Retina.js v1.3.0 + * + * Copyright 2014 Imulus, LLC + * Released under the MIT license + * + * Retina.js is an open source script that makes it easy to serve + * high-resolution images to devices with retina displays. + */ + +(function() { + var root = (typeof exports === 'undefined' ? window : exports); + var config = { + // An option to choose a suffix for 2x images + retinaImageSuffix : '@2x', + + // Ensure Content-Type is an image before trying to load @2x image + // https://github.com/imulus/retinajs/pull/45) + check_mime_type: true, + + // Resize high-resolution images to original image's pixel dimensions + // https://github.com/imulus/retinajs/issues/8 + force_original_dimensions: true + }; + + function Retina() {} + + root.Retina = Retina; + + Retina.configure = function(options) { + if (options === null) { + options = {}; + } + + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + config[prop] = options[prop]; + } + } + }; + + Retina.init = function(context) { + if (context === null) { + context = root; + } + + var existing_onload = context.onload || function(){}; + + context.onload = function() { + var images = document.getElementsByTagName('img'), retinaImages = [], i, image; + for (i = 0; i < images.length; i += 1) { + image = images[i]; + if (!!!image.getAttributeNode('data-no-retina')) { + image.setAttribute('data-at2x-loaded', true); + retinaImages.push(new RetinaImage(image)); + } + } + existing_onload(); + }; + }; + + Retina.recheck = function() { + var images = document.getElementsByTagName('img'), retinaImages = [], i, image; + for (i = 0; i < images.length; i += 1) { + image = images[i]; + if (!!!image.getAttributeNode('data-no-retina')) { + if (!!!image.getAttributeNode('data-at2x-loaded')) { + image.setAttribute('data-at2x-loaded', true); + retinaImages.push(new RetinaImage(image)); + } + } + } + }; + + Retina.isRetina = function(){ + var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)'; + + if (root.devicePixelRatio > 1) { + return true; + } + + if (root.matchMedia && root.matchMedia(mediaQuery).matches) { + return true; + } + + return false; + }; + + + var regexMatch = /\.\w+$/; + function suffixReplace (match) { + return config.retinaImageSuffix + match; + } + + function RetinaImagePath(path, at_2x_path) { + this.path = path || ''; + if (typeof at_2x_path !== 'undefined' && at_2x_path !== null) { + this.at_2x_path = at_2x_path; + this.perform_check = false; + } else { + if (undefined !== document.createElement) { + var locationObject = document.createElement('a'); + locationObject.href = this.path; + locationObject.pathname = locationObject.pathname.replace(regexMatch, suffixReplace); + this.at_2x_path = locationObject.href; + } else { + var parts = this.path.split('?'); + parts[0] = parts[0].replace(regexMatch, suffixReplace); + this.at_2x_path = parts.join('?'); + } + this.perform_check = true; + } + } + + root.RetinaImagePath = RetinaImagePath; + + RetinaImagePath.confirmed_paths = []; + + RetinaImagePath.prototype.is_external = function() { + return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) ); + }; + + RetinaImagePath.prototype.check_2x_variant = function(callback) { + var http, that = this; + if (this.is_external()) { + return callback(false); + } else if (!this.perform_check && typeof this.at_2x_path !== 'undefined' && this.at_2x_path !== null) { + return callback(true); + } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) { + return callback(true); + } else { + http = new XMLHttpRequest(); + http.open('HEAD', this.at_2x_path); + http.onreadystatechange = function() { + if (http.readyState !== 4) { + return callback(false); + } + + if (http.status >= 200 && http.status <= 399) { + if (config.check_mime_type) { + var type = http.getResponseHeader('Content-Type'); + if (type === null || !type.match(/^image/i)) { + return callback(false); + } + } + + RetinaImagePath.confirmed_paths.push(that.at_2x_path); + return callback(true); + } else { + return callback(false); + } + }; + http.send(); + } + }; + + + function RetinaImage(el) { + this.el = el; + this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x')); + var that = this; + this.path.check_2x_variant(function(hasVariant) { + if (hasVariant) { + that.swap(); + } + }); + } + + root.RetinaImage = RetinaImage; + + RetinaImage.prototype.swap = function(path) { + if (typeof path === 'undefined') { + path = this.path.at_2x_path; + } + + var that = this; + function load() { + if (! that.el.complete) { + setTimeout(load, 5); + } else { + if (config.force_original_dimensions) { + that.el.setAttribute('width', that.el.width); + that.el.setAttribute('height', that.el.height); + } + + that.el.setAttribute('src', path); + } + } + load(); + }; + + + if (Retina.isRetina()) { + Retina.init(root); + } +})(); diff --git a/js/game.js b/js/game.js new file mode 100644 index 0000000..f499add --- /dev/null +++ b/js/game.js @@ -0,0 +1,253 @@ +'use strict'; +(function() { + var loadFile = function(filename) { + var res; + $.ajax({ + async: false, + url : filename, + success : function(data) { + res = data; + } + }); + return res; + } + + var showModal = function(title, text) { + var $modal = $('#infoBox'); + $modal.find('#infoBoxLabel').html(title); + $modal.find('.modal-body').html(text); + $modal.modal({show: true}); + }; + + var lab = { + name: 'My Awesome Lab', + detector: { + rate: 1 + }, + factor: { + rate: 5 + }, + data: 0, + reputation: 0, + money: 0, + getGrant: function () { + var addition = this.reputation * this.factor.rate; // TODO: adjust factor + this.money += addition; + showUpdateValue("#update-funding", formatNiceNumber(addition)); + achievements.update('count', 'money', addition); + }, + acquire: function(amount) { + this.data += amount; + achievements.update('count', 'data', amount); + showUpdateValue("#update-data", formatNiceNumber(amount)); + }, + research: function(cost, reputation) { + if (this.data >= cost) { + this.data -= cost; + this.reputation += reputation; + achievements.update('count', 'reputation', reputation); + showUpdateValue("#update-data", formatNiceNumber(-cost)); + showUpdateValue("#update-reputation", formatNiceNumber(reputation)); + return true; + } + return false; + }, + buy: function(cost) { + if (this.money >= cost) { + this.money -= cost; + showUpdateValue("#update-funding", formatNiceNumber(-cost)); + return true; + } + return false; + }, + sell: function(cost) { + this.money += cost; + } + }; + + var research = loadFile('json/research.json'); + achievements.addResearch(research); + research.map(function(item) { + item.level = 0; + item.is_visible = function() { + return this.level > 0 || lab.data >= this.cost * .7; + }; + item.is_available = function() { + return lab.data >= this.cost; + }; + item.research = function() { + if (lab.research(this.cost, this.reputation)) { + achievements.update('count', 'dataSpent', this.cost); + this.level++; + this.cost = Math.round(this.cost * this.cost_increase); + achievements.update('research', this.name, 1); + } + }; + item.getInfo = function() { + if (!this._info) { + this._info = loadFile(this.info); + } + return this._info; + }, + item.showInfo = function() { + showModal(this.name, this.getInfo()); + }; + }); + + var workers = loadFile('json/workers.json'); + achievements.addWorkers(workers); + workers.map(function(worker) { + worker.hired = 0; + worker.is_visible = function() { + return this.hired > 0 || lab.money >= this.cost * .7; + }; + worker.is_available = function() { + return lab.money >= this.cost; + }; + worker.hire = function() { + if (lab.buy(this.cost)) { + achievements.update('count', 'moneyWorkers', this.cost); + this.hired++; + this.cost = Math.round(this.cost * this.cost_increase); + achievements.update('workers', this.name, 1); + achievements.update('count', 'workers', 1); + } + }; + }); + + var upgrades = loadFile('json/upgrades.json'); + upgrades.map(function(upgrade) { + upgrade.getReceiver = function() { + if (this.type === "detector") { + return lab.detector; + } else if (this.type === "reputation"){ + return lab.factor; + } + else { + var context; + if (this.type === "research") { context = research; } + else if (this.type === "hr") { context = workers; } + else { return null; } + for (var i = 0; i < context.length; i++) { + if (context[i].name === this.receiver) { + return context[i]; + } + } + return null; + } + }; + upgrade.hasReceiver = function() { + if (this.type === "detector") { + return true; + } + if (this.type === "reputation") { + return true; + } + var rec = this.getReceiver(); + if (this.type === "research") { + return rec.level > 0; + } else if (this.type === "hr") { + return rec.hired > 0; + } + return false; + }; + upgrade.is_visible = function() { + return !this.used && this.hasReceiver() && lab.money >= this.cost * .7; + }; + upgrade.is_available = function() { + return !this.used && this.hasReceiver() && lab.money >= this.cost; + }; + upgrade.buy = function() { + if (!this.used && lab.buy(this.cost)) { + achievements.update('count', 'moneyUpgrades', this.cost); + this.used = true; + var rec = this.getReceiver(); + if (rec) { + rec[this.property] = rec[this.property] * this.factor + this.constant; + } + } + }; + }); + + var app = angular.module('particleClicker', []); + + app.filter('currency', ['$filter', function($filter) { + return function(input) { + return 'JTN ' + $filter('niceNumber')(input); + }; + }]); + + + function formatNiceNumber(number) { + var abs = Math.abs(number); + if (abs >= Math.pow(10, 12)) { + number = (number / Math.pow(10, 12)).toFixed(1) + "T"; + } else if (abs >= Math.pow(10, 9)) { + number = (number / Math.pow(10, 9)).toFixed(1) + "B"; + } else if (abs >= Math.pow(10, 6)) { + number = (number / Math.pow(10, 6)).toFixed(1) + "M"; + } else if (abs >= Math.pow(10, 3)) { + number = (number / Math.pow(10, 3)).toFixed(1) + "k"; + } else { + number = number.toFixed(0); + } + return number; + } + + app.filter('niceNumber', ['$filter', function($filter) { + return formatNiceNumber; + }]); + + app.filter('reverse', ['$filter', function($filter) { + return function(items) { + return items.slice().reverse(); + }; + }]); + + app.controller('DetectorController', function() { + this.click = function() { + lab.acquire(lab.detector.rate); + detector.addEvent(); + achievements.update('count', 'clicks', 1); + return false; + }; + }); + + app.controller('LabController', ['$interval', function($interval) { + this.lab = lab; + this.showDetectorInfo = function() { + if (!this._detectorInfo) { + this._detectorInfo = loadFile('html/detector.html'); + } + showModal('Detector', this._detectorInfo); + }; + $interval(function() { // one tick + lab.getGrant(); + var sum = 0; + for (var i = 0; i < workers.length; i++) { + sum += workers[i].hired * workers[i].rate; + } + lab.acquire(sum); + detector.addEventExternal(); + }, 1000); + }]); + + app.controller('ResearchController', function() { + this.research = research; + }); + + app.controller('HRController', function() { + this.workers = workers; + }); + + app.controller('UpgradesController', function() { + this.upgrades = upgrades; + }); + + app.controller('AchievementsController', function() { + this.achievements = achievements.listSummary; + this.achievementsAll = achievements.list; + }); + + achievements.setList(loadFile('json/achievements.json')); +})(); diff --git a/js/histogram.js b/js/histogram.js new file mode 100644 index 0000000..e04f1e5 --- /dev/null +++ b/js/histogram.js @@ -0,0 +1,137 @@ + +function draw_hist(ident, vals) { + + // A formatter for counts. + var formatCount = d3.format(",0d"); + + var margin = {top: 10, right: 30, bottom: 30, left: 30}, + width = 400 - margin.left - margin.right, + height = 200 - margin.top - margin.bottom; + + var x = d3.scale.linear() + .domain([-5, 5]) + .range([0, width]); + + // Generate a histogram using twenty uniformly-spaced bins. + var data = d3.layout.histogram() + .bins(x.ticks(20)) + (vals); + + var y = d3.scale.linear() + .domain([0, d3.max(data, function(d) { return d.y + Math.sqrt(d.y); })]) + .range([height, 0]); + + correction = y(0); + + var xAxis = d3.svg.axis() + .scale(x) + .ticks(3) + .tickFormat(function(d) { return '';}) + .orient("bottom"); + + var yAxis = d3.svg.axis() + .scale(y) + .ticks(4) + //.tickFormat(function(d) { return ''; }) + .orient("left"); + + var svg = d3.select(ident).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + var bar = svg.selectAll(".bar") + .data(data) + .enter().append("svg:circle") + .attr("stroke", "black") + .attr("fill", function(d, i) { return "black" }) + .attr("transform", function(d) { return "translate(" + x(d.x) + "," + y(d.y) + ")"; }) + .attr("r", function(d, i) { return 1 }); + + svg.selectAll(".bar") + .data(data) + .enter().append("svg:line") + .attr("x1", 0) + .attr("x2", 0) + .attr("y1", function(d) { return y(Math.sqrt(d.y))-correction; }) + .attr("y2", function(d) { return -y(Math.sqrt(d.y))+correction; }) + .attr("transform", function(d) { return "translate(" + x(d.x) + "," + y(d.y) + ")"; }) + .attr("stroke", "black") + .attr("stroke-width", 1) + + svg.selectAll(".bar") + .data(data) + .enter().append("svg:line") + .attr("x1", -2) + .attr("x2", 2) + .attr("y1", function(d) { return y(Math.sqrt(d.y))-correction; }) + .attr("y2", function(d) { return y(Math.sqrt(d.y))-correction; }) + .attr("transform", function(d) { return "translate(" + x(d.x) + "," + y(d.y) + ")"; }) + .attr("stroke", "black") + .attr("stroke-width", 1) + + svg.selectAll(".bar") + .data(data) + .enter().append("svg:line") + .attr("x1", -2) + .attr("x2", 2) + .attr("y1", function(d) { return -y(Math.sqrt(d.y))+correction; }) + .attr("y2", function(d) { return -y(Math.sqrt(d.y))+correction; }) + .attr("transform", function(d) { return "translate(" + x(d.x) + "," + y(d.y) + ")"; }) + .attr("stroke", "black") + .attr("stroke-width", 1) + + bar.append("rect") + .attr("x", 1) + .attr("width", x(data[0].dx)) + .attr("height", function(d) { return height - y(d.y); }); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + (height ) + ")") + .call(xAxis); + + svg.append("text") + .attr("class", "x label") + .attr("text-anchor", "end") + .attr("x", width) + .attr("y", height + 20) + .text("m (GeV)"); + + svg.append("g") + .attr("class", "y axis") + .attr("transform", "translate(0, 0)") + .call(yAxis); + + svg.append("text") + .attr("class", "y label") + .attr("text-anchor", "end") + .attr("y", -20) + .attr("dy", "-1em") + .attr("dx", "-0.5em") + .attr("transform", "rotate(-90)") + .text("events"); + + return svg; +} + +function Histogram(ident) { + // TODO: Allow for arbitrary numbers of events + this.values = []; + draw_hist(ident, []); + + this.add_events = function(num) { + var new_vals = d3.range(num).map(d3.random.normal(0, 1)); + this.values = $.merge(this.values, new_vals); + d3.select(ident).select("svg").remove(); + draw_hist(ident, this.values); + } + + this.clear = function() { + d3.select(ident).select("svg").remove(); + this.values = []; + draw_hist(ident, []); + } +} + diff --git a/js/ui.js b/js/ui.js new file mode 100644 index 0000000..9e137bd --- /dev/null +++ b/js/ui.js @@ -0,0 +1,70 @@ +$(function() { + var h = $(window).height(); + $('.scrollable').height(h + 'px'); + + $(window).resize(function() { + var h = $(window).height(); + $('.scrollable').height(h + 'px'); + }); +}); + +(function() { + var hidden = "hidden"; + + // Standards: + if (hidden in document) + document.addEventListener("visibilitychange", onchange); + else if ((hidden = "mozHidden") in document) + document.addEventListener("mozvisibilitychange", onchange); + else if ((hidden = "webkitHidden") in document) + document.addEventListener("webkitvisibilitychange", onchange); + else if ((hidden = "msHidden") in document) + document.addEventListener("msvisibilitychange", onchange); + // IE 9 and lower: + else if ('onfocusin' in document) + document.onfocusin = document.onfocusout = onchange; + // All others: + else + window.onpageshow = window.onpagehide + = window.onfocus = window.onblur = onchange; + + function onchange (evt) { + var v = 'visible', h = 'hidden', + evtMap = { + focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h + }; + + evt = evt || window.event; + if (evt.type in evtMap) + detector.visible = evtMap[evt.type] == 'visible'; + else + detector.visible = !this[hidden]; + } +})(); + +function showUpdateValue(ident, num) { + if (num != 0) { + if (num > 0) { + insert = $("
") + .attr("class", "update-plus") + .html("+" + num); + } else { + insert = $("
") + .attr("class", "update-minus") + .html(num); + } + showUpdate(ident, insert); + } +} + +function showUpdate(ident, insert) { + elem = $(ident); + elem.append(insert); + insert.animate({ + "bottom":"+=30px", + "opacity": 0 + }, { duration: 500, complete: function() { + $(this).remove(); + }}); +} + diff --git a/json/achievements.json b/json/achievements.json new file mode 100644 index 0000000..3c4b85d --- /dev/null +++ b/json/achievements.json @@ -0,0 +1,334 @@ +[ + { + "description": "${name} discovery!", + "icon": "glyphicon-cog", + "type": "research", + "target": "research", + "threshold": 1 + }, + { + "description": "${name} research level 5!", + "icon": "glyphicon-cog", + "type": "research", + "target": "research", + "threshold": 5 + }, + { + "description": "${name} research level 25!", + "icon": "glyphicon-cog", + "type": "research", + "target": "research", + "threshold": 25 + }, + { + "description": "${name} research level 50!", + "icon": "glyphicon-cog", + "type": "research", + "target": "research", + "threshold": 50 + }, + { + "description": "${name} research level 100!", + "icon": "glyphicon-cog", + "type": "research", + "target": "research", + "threshold": 100 + }, + + + { + "description": "The first ${name} hired!", + "icon": "glyphicon-user", + "type": "workers", + "target": "workers", + "threshold": 1 + }, + { + "description": "5 ${name} working for you!", + "icon": "glyphicon-user", + "type": "workers", + "target": "workers", + "threshold": 5 + }, + { + "description": "25 ${name} working for you!", + "icon": "glyphicon-user", + "type": "workers", + "target": "workers", + "threshold": 25 + }, + { + "description": "50 ${name} working for you!", + "icon": "glyphicon-user", + "type": "workers", + "target": "workers", + "threshold": 50 + }, + { + "description": "100 ${name} working for you!", + "icon": "glyphicon-user", + "type": "workers", + "target": "workers", + "threshold": 100 + }, + + + { + "description": "Your first click!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 1 + }, + { + "description": "100 clicks!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 100 + }, + { + "description": "1000 clicks!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 1000 + }, + { + "description": "10.0k clicks!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 10000 + }, + { + "description": "10.0k0 clicks!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 100000 + }, + { + "description": "1.0M clicks!", + "icon": "glyphicon-hand-up", + "type": "count", + "target": "clicks", + "threshold": 1000000 + }, + + { + "description": "100 data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 100 + }, + { + "description": "10.0k data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 10000 + }, + { + "description": "1.0M data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 1000000 + }, + { + "description": "100.0M data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 100000000 + }, + { + "description": "10.0B data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 10000000000 + }, + { + "description": "10.0B data collected!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "data", + "threshold": 10000000000 + }, + + { + "description": "JTN 100 funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 100 + }, + { + "description": "JTN 10.0k funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 10000 + }, + { + "description": "JTN 1.0M funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 1000000 + }, + { + "description": "JTN 100.0M funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 100000000 + }, + { + "description": "JTN 10.0B funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 10000000000 + }, + { + "description": "JTN 10.0B funding gathered!", + "icon": "glyphicon-usd", + "type": "count", + "target": "money", + "threshold": 10000000000 + }, + + + { + "description": "100 data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 100 + }, + { + "description": "10.0k data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 10000 + }, + { + "description": "1.0M data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 1000000 + }, + { + "description": "100.0M data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 100000000 + }, + { + "description": "10.0B data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 10000000000 + }, + { + "description": "10.0B data processed!", + "icon": "glyphicon-hdd", + "type": "count", + "target": "dataSpent", + "threshold": 10000000000 + }, + + { + "description": "JTN 100 funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 100 + }, + { + "description": "JTN 10.0k funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 10000 + }, + { + "description": "JTN 1.0M funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 1000000 + }, + { + "description": "JTN 100.0M funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 100000000 + }, + { + "description": "JTN 10.0B funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 10000000000 + }, + { + "description": "JTN 10.0B funding spent in HR department!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyWorkers", + "threshold": 10000000000 + }, + + { + "description": "JTN 100 funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 100 + }, + { + "description": "JTN 10.0k funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 10000 + }, + { + "description": "JTN 1.0M funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 1000000 + }, + { + "description": "JTN 100.0M funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 100000000 + }, + { + "description": "JTN 10.0B funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 10000000000 + }, + { + "description": "JTN 10.0B funding spent for upgrades!", + "icon": "glyphicon-usd", + "type": "count", + "target": "moneyUpgrades", + "threshold": 10000000000 + } +] diff --git a/json/messages.json b/json/messages.json new file mode 100644 index 0000000..81ffa8d --- /dev/null +++ b/json/messages.json @@ -0,0 +1,10 @@ +{ + { + "name": "01", + "message": "Nobody knows you.", + }, + { + "name": "02", + "message": "If you were working in McDonalds, you were more successfull.", + } +} diff --git a/json/research.json b/json/research.json new file mode 100644 index 0000000..9479581 --- /dev/null +++ b/json/research.json @@ -0,0 +1,83 @@ +[ + { + "name": "CP violation", + "description": "CP symmetry is broken!", + "reputation": 1, + "cost": 10, + "cost_increase": 1.4, + "image": "assets/icons/png/CPV.png", + "info": "html/CPV.html" + }, + { + "name": "J/ψ", + "description": "The J/ψ meson consists a c and an anti-c quark.", + "reputation": 5, + "cost": 100, + "cost_increase": 1.45, + "image": "assets/icons/png/Jpsi.png", + "info": "html/Jpsi.html" + }, + { + "name": "τ lepton", + "description": "The third generation charged lepton.", + "reputation": 50, + "cost": 2000, + "cost_increase": 1.5, + "image": "assets/icons/png/tau.png", + "info": "html/tau.html" + }, + { + "name": "Beauty quark", + "description": "The third generation down-type quark.", + "reputation": 100, + "cost": 25000, + "cost_increase": 1.55, + "image": "assets/icons/png/b.png", + "info": "html/b.html" + }, + { + "name": "W and Z boson", + "description": "The carriers of the weak force.", + "reputation": 200, + "cost": 50000, + "cost_increase": 1.6, + "image": "assets/icons/png/weak.png", + "info": "html/weak.html" + }, + { + "name": "Top quark", + "description": "The heaviest of the quarks.", + "reputation": 1000, + "cost": 2000000, + "cost_increase": 2, + "image": "assets/icons/png/t.png", + "info": "html/top.html" + }, + { + "name": "Antihydrogen", + "description": "The lightest anti-atom, it consists and antiproton and a positron.", + "reputation": 5000, + "cost": 10000000, + "cost_increase": 2.5, + "image": "assets/icons/png/antihydrogen.png", + "info": "html/antihydrogen.html" + }, + { + "name": "B oscillations", + "description": "B mesons turn into their antiparticles and vice versa!", + "reputation": 5000, + "cost": 50000000, + "cost_increase": 2.5, + "image": "assets/icons/png/BBbar.png", + "info": "html/BBbar.html" + }, + { + "name": "Higgs boson", + "description": "Spontaneous symmetry breaking and Goldstone bosons sound familiar to you, right?", + "reputation": 10000, + "cost": 72500000, + "cost_increase": 3, + "image": "assets/icons/png/H.png", + "info": "html/H.html" + } +] diff --git a/json/upgrades.json b/json/upgrades.json new file mode 100644 index 0000000..f9f37ec --- /dev/null +++ b/json/upgrades.json @@ -0,0 +1,556 @@ +[ + { + "name": "Free beer", + "description": "The work is easier when the worker is happy. Your PhD Students will produce +2 data.", + "cost": 1000, + "used": false, + "type": "hr", + "receiver": "PhD Students", + "property": "rate", + "factor": 1, + "constant": 2 + }, + { + "name": "Extra coffee", + "description": "Sleeping is the coffee of the weaks. Your PhD Students will produce 1.3 times more data.", + "cost": 3000, + "used": false, + "type": "hr", + "receiver": "PhD Students", + "property": "rate", + "factor": 1.5, + "constant": 0 + }, + { + "name": "Motivation", + "description": "There are other, you know... more diligent Students... Your PhD Students will produce 2 times more data.", + "cost": 10000, + "used": false, + "type": "hr", + "receiver": "PhD Students", + "property": "rate", + "factor": 2, + "constant": 0 + }, + { + "name": "Division of labor", + "description": "Teamwork between PhD Students is a great invention. Your PhD Students will produce much more data.", + "cost": 175000, + "used": false, + "type": "hr", + "receiver": "PhD Students", + "property": "rate", + "factor": 3, + "constant": 3 + }, + + { + "name": "Free beer", + "description": "The work is easier when the worker is happy. Your Postdocs will produce +4 data.", + "cost": 5000, + "used": false, + "type": "hr", + "receiver": "Postdocs", + "property": "rate", + "factor": 1, + "constant": 4 + }, + { + "name": "Extra coffee", + "description": "Sleeping is the coffee of the weaks. Your Postdocs will produce 1.5 times more data.", + "cost": 20000, + "used": false, + "type": "hr", + "receiver": "Postdocs", + "property": "rate", + "factor": 1.5, + "constant": 0 + }, + + { + "name": "Motivation", + "description": "There are other, you know... more diligent Postdocs... Your Postdocs will produce 2 times more data.", + "cost": 500000, + "used": false, + "type": "hr", + "receiver": "Postdocs", + "property": "rate", + "factor": 2, + "constant": 0 + }, + + { + "name": "Division of labor", + "description": "Teamwork between Postdocs is a great invention. Your Postdocs will produce much more data.", + "cost": 2000000, + "used": false, + "type": "hr", + "receiver": "Postdocs", + "property": "rate", + "factor": 1.5, + "constant": 18 + }, + + { + "name": "Increased budget", + "description": "Your Research Fellows get a little more money. They will produce +25 more data.", + "cost": 200000, + "used": false, + "type": "hr", + "receiver": "Research Fellows", + "property": "rate", + "factor": 1, + "constant": 25 + }, + + { + "name": "New gadgets", + "description": "Your Research Fellows receive new techs. They will produce 1.2 times more data.", + "cost": 800000, + "used": false, + "type": "hr", + "receiver": "Research Fellows", + "property": "rate", + "factor": 1.2, + "constant": 0 + }, + + { + "name": "More PhD Students", + "description": "Your Mighty Professors get some Students to work. They will produce +75 more data.", + "cost": 20000000, + "used": false, + "type": "hr", + "receiver": "Tenured Professors", + "property": "rate", + "factor": 1, + "constant": 75 + }, + + { + "name": "2. Nobel Prize", + "description": "So your Brightest Minds now are demigods... They will produce 1.7 times more data.", + "cost": 100000000, + "used": false, + "type": "hr", + "receiver": "Nobel Prize Winners", + "property": "rate", + "factor": 1.7, + "constant": 0 + }, + + { + "name": "Accelerator upgrade", + "description": "Increases the luminosity (you get 3 times more data with clicks).", + "cost": 1000, + "used": false, + "type": "detector", + "receiver": "", + "property": "rate", + "factor": 3, + "constant": 0 + }, + + { + "name": "Accelerator upgrade 2", + "description": "Increases the luminosity (you get 3 times more data with clicks).", + "cost": 10000, + "used": false, + "type": "detector", + "receiver": "", + "property": "rate", + "factor": 3, + "constant": 0 + }, + + { + "name": "Accelerator upgrade 3", + "description": "Increases the luminosity (you get 3 times more data with clicks).", + "cost": 100000, + "used": false, + "type": "detector", + "receiver": "", + "property": "rate", + "factor": 3, + "constant": 0 + }, + + { + "name": "Detector upgrade", + "description": "Your amazing detector works with better efficiency (you get +4 data with clicks).", + "cost": 500, + "used": false, + "type": "detector", + "receiver": "detector", + "property": "rate", + "factor": 1, + "constant": 4 + }, + + { + "name": "Detector upgrade 2", + "description": "Your amazing detector works with better efficiency (you get +12 data with clicks).", + "cost": 5000, + "used": false, + "type": "detector", + "receiver": "", + "property": "rate", + "factor": 1, + "constant": 12 + }, + + { + "name": "Detector upgrade 3", + "description": "Your amazing detector works with better efficiency (you get +42 data with clicks).", + "cost": 50000, + "used": false, + "type": "detector", + "receiver": "detector", + "property": "rate", + "factor": 1, + "constant": 42 + }, + + { + "name": "Public Relations, lvl 1", + "description": "Mainstream press writes about your research of the CP violation. Future research yields 1.2 times more reputation.", + "cost": 5000, + "used": false, + "type": "research", + "receiver": "CP violation", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Science is cool!! lvl 1", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 700, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.2, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 2", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 50000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.18, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 3", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 200000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.16, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 4", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 800000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.14, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 5", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 1200000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.12, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 6", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 1800000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.12, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 7", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 3000000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.12, + "constant": 0 + }, + + { + "name": "Science is cool!! lvl 8", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 10000000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.12, + "constant": 0 + }, + + { + "name": "Public Relations, lvl 1", + "description": "Mainstream press writes about your research of the CP violation. Future research yields 1.2 times more reputation.", + "cost": 5000, + "used": false, + "type": "research", + "receiver": "CP violation", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "Mainstream press writes about your research of the CP violation. Future research yields 1.2 times more reputation.", + "cost": 100000, + "used": false, + "type": "research", + "receiver": "CP violation", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "Your research on J/ψ is featured on national television. Future research yields 1.2 times more reputation.", + "cost": 40000, + "used": false, + "type": "research", + "receiver": "J/ψ", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "Your research on J/ψ is featured on national television. Future research yields 1.2 times more reputation.", + "cost": 130000, + "used": false, + "type": "research", + "receiver": "J/ψ", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "In a scientific documentary you speak about the τ lepton. Future research yields 1.2 times more reputation.", + "cost": 100000, + "used": false, + "type": "research", + "receiver": "τ lepton", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "In a scientific documentary you speak about the τ lepton. Future research yields 1.2 times more reputation.", + "cost": 250000, + "used": false, + "type": "research", + "receiver": "τ lepton", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "You just discovered the most beautiful quark ever! Future research yields 1.2 times more reputation.", + "cost": 100000, + "used": false, + "type": "research", + "receiver": "Beauty quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "You discovered the most beautiful quark ever! Future research yields 1.2 times more reputation.", + "cost": 500000, + "used": false, + "type": "research", + "receiver": "Beauty quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "You give lectures about this very important part of the Standard modell! Future research yields 1.2 times more reputation.", + "cost": 250000, + "used": false, + "type": "research", + "receiver": "W and Z boson", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "You give lectures about this very important part of the Standard modell! Future research yields 1.2 times more reputation.", + "cost": 1000000, + "used": false, + "type": "research", + "receiver": "W and Z boson", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "This is the top your career! Future research yields 1.2 times more reputation.", + "cost": 5000000, + "used": false, + "type": "research", + "receiver": "Top quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + { + "name": "Public Relations, lvl 2", + "description": "This is the top your career! Future research yields 1.2 times more reputation.", + "cost": 7500000, + "used": false, + "type": "research", + "receiver": "Top quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "Hollywood makes a movie about the antihydrogen. Your future research yields 1.2 times more reputation.", + "cost": 22500000, + "used": false, + "type": "research", + "receiver": "Antihydrogen", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "Hollywood makes a movie about the antihydrogen. Your future research yields 1.2 times more reputation.", + "cost": 40000000, + "used": false, + "type": "research", + "receiver": "Antihydrogen", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 1", + "description": "Your little daughter writes about your research on B oscillations in her homework. Future research yields 1.2 times more reputation.", + "cost": 75000000, + "used": false, + "type": "research", + "receiver": "B oscillations", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + + { + "name": "Public Relations, lvl 2", + "description": "Your little daughter writes about your research on B oscillations in her homework. Future research yields 1.2 times more reputation.", + "cost": 90000000, + "used": false, + "type": "research", + "receiver": "B oscillations", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + { + "name": "Public Relations, lvl 1", + "description": "You know more about Top quark than everybody else. Future research yields 1.2 times more reputation.", + "cost": 50000000, + "used": false, + "type": "research", + "receiver": "Top quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + { + "name": "Public Relations, lvl 2", + "description": "You know more about Top quark then everybody else. Future research yields 1.2 times more reputation.", + "cost": 120000000, + "used": false, + "type": "research", + "receiver": "Top quark", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + { + "name": "Public Relations, lvl 1", + "description": "You've found the last missing element of the Standard Modell! Future research yields 1.2 times more reputation.", + "cost": 90000000, + "used": false, + "type": "research", + "receiver": "Higgs boson", + "property": "reputation", + "factor": 1.2, + "constant": 1 + }, + { + "name": "Public Relations, lvl 2", + "description": "You've found the last missing element of the Standard Modell! Future research yields 1.2 times more reputation.", + "cost": 110000000, + "used": false, + "type": "research", + "receiver": "Higgs boson", + "property": "reputation", + "factor": 1.2, + "constant": 1 + } +] diff --git a/json/workers.json b/json/workers.json new file mode 100644 index 0000000..d721879 --- /dev/null +++ b/json/workers.json @@ -0,0 +1,44 @@ +[ + { + "name": "PhD Students", + "description": "Cheap and enthusiastic manpower, they can save you a lot of work.", + "cost": 100, + "cost_increase": 1.4, + "rate": 1 + }, + { + "name": "Postdocs", + "description": "These brilliant minds are here only to serve your needs.", + "cost": 2000, + "cost_increase": 1.4, + "rate": 5 + }, + { + "name": "Research Fellows", + "description": "You pay them a lot. They work a lot.", + "cost": 50000, + "cost_increase": 1.5, + "rate": 50 + }, + { + "name": "Tenured Professors", + "description": "They bring their own group along and are able to get a lot of work done.", + "cost": 1000000, + "cost_increase": 1.6, + "rate": 100 + }, + { + "name": "Nobel Prize Winners", + "description": "They received their prize with reason... Why don't you give them more money?.", + "cost": 50000000, + "cost_increase": 2, + "rate": 500 + }, + { + "name": "Summer Students", + "description": "They are AWESOME. They best ideas come between two parties.", + "cost": 99999999, + "cost_increase": 3, + "rate": 1000 + } +] diff --git a/pitch/Makefile b/pitch/Makefile deleted file mode 100644 index 17fba9a..0000000 --- a/pitch/Makefile +++ /dev/null @@ -1,4 +0,0 @@ - -build/main.pdf: main.tex - lualatex --shell-escape --output-directory=build $^ - diff --git a/pitch/beamerthemevertex.sty b/pitch/beamerthemevertex.sty deleted file mode 100644 index 73d8ae0..0000000 --- a/pitch/beamerthemevertex.sty +++ /dev/null @@ -1,155 +0,0 @@ - -% Vertex beamer theme - -\ProvidesPackage{beamerthemevertex}[2014/03/31] - -\mode - -% Process options -\newif\if@simplefootline\@simplefootlinefalse -\DeclareOption{simplefootline}{\@simplefootlinetrue} -\ProcessOptions - -% Table of contents -\useoutertheme[subsection=false,shadow]{miniframes} -\setbeamertemplate{section in toc}[sections numbered] -\setbeamertemplate{subsection in toc}[subsections numbered] - -% Itemize -\setbeamertemplate{itemize item}{→} -\setbeamertemplate{itemize subitem}{→} -\setbeamertemplate{itemize subsubitem}{→} -\setlength{\parskip}{0.5em} - -% Colors -\definecolor{vertexDarkGrey}{rgb}{0.3019607844,0.2803921571,0.258823530} -\definecolor{vertexLightGrey}{rgb}{0.833333333,0.8117647064,0.790196078} -\setbeamercolor{normal text}{fg=vertexDarkGrey} -\setbeamercolor{math text}{parent=normal text} -\setbeamercolor{structure}{fg=vertexDarkGrey} -\setbeamercolor{palette1}{fg=white, bg=vertexDarkGrey} -\setbeamercolor{palette2}{fg=vertexDarkGrey,bg=vertexLightGrey} -\setbeamercolor{title page}{parent=palette2} -\setbeamercolor{title}{parent=normal text} -\setbeamercolor{subtitle}{parent=normal text} -\setbeamercolor{institute}{parent=normal text} -\setbeamercolor{frametitle}{parent=palette1} -\setbeamercolor{block title}{parent=palette1} -\setbeamercolor{block body}{parent=palette2} -\setbeamercolor{block title example}{parent=palette2} -\setbeamercolor{block body example}{parent=palette2} - -% Fonts -\usepackage{fontspec}% -\usefonttheme{professionalfonts} -\usepackage{unicode-math} -\newfontfamily\Light{Source Sans Pro Light}% -\newfontfamily\Regular{Source Sans Pro}% -\newfontfamily\Bold{Source Sans Pro Bold}% -\setsansfont{Source Sans Pro}% -\setmonofont[Scale=MatchLowercase]{Source Code Pro}% -\setmathfont{Latin Modern Math} -\setbeamerfont{title}{family=\Light,size=\fontsize{30}{30}} -\setbeamerfont{subtitle}{family=\Light,size=\fontsize{18}{20}} -\setbeamerfont{date}{size=\fontsize{10}{12}} -\setbeamerfont{author}{size=\fontsize{16}{18}} -\setbeamerfont{institute}{size=\fontsize{14}{16}} -\setbeamerfont{section title}{size=\LARGE} -\setbeamerfont{frametitle}{family=\Regular,size=\Large} -\setbeamerfont{block title}{family=\Regular,size=\large} -\setbeamerfont{caption name}{family=\Regular} - -% Titlepage -\def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi} -\def\titlepage{\usebeamertemplate{title page}} -\setbeamertemplate{title page} -{ - \begin{minipage}[b][\paperheight]{\textwidth} - \centering% - \begin{beamercolorbox}[wd=\paperwidth,ht=9em,dp=1em]{title page}% - \centering% - \ifx\insertsubtitle\@empty% - \else% - {\usebeamerfont{title}\inserttitle\par}% - \fi% - \ifx\insertsubtitle\@empty% - \else% - \vspace{6mm} - {\usebeamerfont{subtitle}\insertsubtitle\par}% - \fi% - \end{beamercolorbox}% - \ifx\insertauthor\@empty% - \else% - \vspace*{5mm}% - {\usebeamerfont{author}\insertauthor\par}% - \fi% - \ifx\insertinstitute\@empty% - \else% - \vspace*{5mm}% - {\usebeamerfont{institute}\insertinstitute\par}% - \fi% - \vfill - \ifx\insertdate\@empty% - \else% - {\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate\par}% - \fi% - \vspace{10mm}% - \end{minipage} -} - -% Frametitle -\setbeamertemplate{frametitle} -{ -\nointerlineskip % This one's tricky -\begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=3ex,dp=1.5ex]{frametitle} - \usebeamerfont{frametitle}\insertframetitle% -\end{beamercolorbox} -} - -% Footline -\usenavigationsymbolstemplate{} -\setbeamertemplate{footline} -{% -\leavevmode% -\if@simplefootline% - \hfill -\else% - \begin{beamercolorbox}[wd=.2\paperwidth, ht=1.8em, dp=1em, left, leftskip=1em]{normal text}% - \insertshortauthor% - \end{beamercolorbox}% - \begin{beamercolorbox}[wd=.6\paperwidth, ht=1.8em, dp=1em, center]{}% - \insertshorttitle% - \end{beamercolorbox}% -\fi% -\begin{beamercolorbox}[wd=.2\paperwidth, ht=1.8em, dp=1em, right, rightskip=1em]{}% -\insertframenumber{} / \inserttotalframenumber% -\end{beamercolorbox}% -} - -% Blocks -\setbeamertemplate{block begin} -{ - \setbeamercolor{item}{parent=block body} - \par\vskip\medskipamount% - \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]{block title} - \usebeamerfont*{block title}\insertblocktitle% - \end{beamercolorbox}% - {\parskip0pt\par}% - {\nointerlineskip\vskip-0.5pt}% - \usebeamerfont{block body}% - \begin{beamercolorbox}[sep=.5ex,dp=0.4ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body}% -} -\setbeamertemplate{block end} -{\end{beamercolorbox}\vskip\smallskipamount} - -% Captions -\usepackage{caption} -\captionsetup[figure]{labelformat=empty} % get rid of 'figure:' under figures -\captionsetup[subfigure]{labelformat=empty} % and subfigures -\captionsetup[table]{labelformat=empty} % same for tables - -% Headline -\setbeamertemplate{headline}{} - -\mode - diff --git a/pitch/figures/cc.pdf b/pitch/figures/cc.pdf deleted file mode 100644 index 60760ee..0000000 Binary files a/pitch/figures/cc.pdf and /dev/null differ diff --git a/pitch/figures/cms.jpg b/pitch/figures/cms.jpg deleted file mode 100644 index fc1f825..0000000 Binary files a/pitch/figures/cms.jpg and /dev/null differ diff --git a/pitch/figures/git.png b/pitch/figures/git.png deleted file mode 100644 index afb7663..0000000 Binary files a/pitch/figures/git.png and /dev/null differ diff --git a/pitch/figures/html5.png b/pitch/figures/html5.png deleted file mode 100644 index 81d1fcb..0000000 Binary files a/pitch/figures/html5.png and /dev/null differ diff --git a/pitch/figures/js.png b/pitch/figures/js.png deleted file mode 100644 index 5754b37..0000000 Binary files a/pitch/figures/js.png and /dev/null differ diff --git a/pitch/figures/pc.pdf b/pitch/figures/pc.pdf deleted file mode 100644 index 730d4ba..0000000 Binary files a/pitch/figures/pc.pdf and /dev/null differ diff --git a/pitch/main.tex b/pitch/main.tex deleted file mode 100644 index 28451ec..0000000 --- a/pitch/main.tex +++ /dev/null @@ -1,95 +0,0 @@ - -\documentclass[14pt,compress,aspectratio=1610]{beamer} - -\usepackage[english]{babel} -\usepackage[english]{isodate} -\isodate -\usepackage{multicol} -\usepackage{tikz} -\usepackage{varwidth} - -\usetheme{vertex} - -\linespread{1.3} -%\setbeamerfont{itemize/enumerate body}{size=\Large} -%\setbeamerfont{itemize/enumerate subbody}{size=\Large} -%\setbeamerfont{body}{size=\Large} - -\title{Particle Clicker} -%\subtitle{A simple, engaging detector game} -\subtitle{ } -\institute{CERN webfest 2014} - -\begin{document} - -% The title page needs an event display -\maketitle - -{ - \setbeamertemplate{navigation symbols}{} - \begin{frame}[plain] - \begin{tikzpicture}[remember picture,overlay] - \node[at=(current page.center)] { - \includegraphics[width=\paperwidth]{figures/cc.pdf} - }; - \end{tikzpicture} - \end{frame} -} - -{ - \setbeamertemplate{navigation symbols}{} - \begin{frame}[plain] - \begin{tikzpicture}[remember picture,overlay] - \node[at=(current page.center)] { - \includegraphics[width=\paperwidth]{figures/pc.pdf} - }; - \end{tikzpicture} - \end{frame} -} - -\begin{frame}{Goals for the weekend} - \begin{center} - \begin{varwidth}{4in} - \begin{itemize} - \item Create a working game from scratch - \begin{itemize} - \item Single page HTML/Javascript app - \end{itemize} - \item Have lots of fun! - \end{itemize} - \end{varwidth} - \end{center} -\end{frame} - -\begin{frame}{What are we looking for?} - Any of the following: - - \begin{center} - \begin{varwidth}{4in} - \begin{itemize} - \item Experience with HTML/Javascript - \item 2d design skills - \item Desire to test and improve the gameplay - \end{itemize} - \end{varwidth} - \end{center} - - \centering - \includegraphics[width=0.8in]{figures/git.png} - \includegraphics[width=1in]{figures/html5.png} - \includegraphics[width=0.73in]{figures/js.png} -\end{frame} - -\begin{frame}[plain] - \centering - \linespread{1} - \huge - \vspace{1em} - Have a smashing weekend! - \vspace{0.5em} - - \includegraphics[width=0.6\textwidth]{figures/cms.jpg} -\end{frame} - -\end{document} -