Skip to content

Commit 1990098

Browse files
committed
Fix merge/rebase to master
2 parents 57880c9 + 4f732d1 commit 1990098

File tree

8 files changed

+104
-22
lines changed

8 files changed

+104
-22
lines changed

app/controllers/MathSwipeController.coffee

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ InputSolver = require '../services/InputSolver'
1010
RandomizedFitLength = require '../services/RandomizedFitLength'
1111
ResetButton = require '../services/ResetButton'
1212
RunningSum = require '../services/RunningSum'
13+
ShareGameService = require '../services/ShareGameService'
1314
SolutionService = require '../services/SolutionService'
1415
Title = require '../services/Title'
1516
TrackingService = require '../services/TrackingService'
@@ -33,12 +34,13 @@ class MathSwipeController
3334
else
3435
TrackingService.desktopView()
3536
@cursorToPointer()
37+
ShareGameService.setMessage()
3638
@initialize()
3739

3840
# # Uncomment the following line to perform general tests
3941
# GeneralTests.tests @board
4042

41-
initialize: () ->
43+
initialize: ->
4244
length = 3
4345
solutionPlacements = []
4446
inputLengths = []

app/services/ShareGameService.coffee

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
TwitterGameService = require './TwitterGameService'
2+
3+
class ShareGameService
4+
5+
@setMessage: ->
6+
TwitterGameService.setTweet()
7+
8+
module.exports = ShareGameService
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
$ = require 'jquery'
2+
3+
class TwitterGameService
4+
5+
@setTweet: ->
6+
possible = ['Play MathSwipe with me! Try to beat my score at',
7+
'Play MathSwipe with me! Try to solve my board at',
8+
'Play MathSwipe with me! Solve my puzzle at']
9+
text = possible[Math.floor(Math.random() * 3)]
10+
$( '#tweet' ).attr( 'data-text' , text )
11+
12+
module.exports = TwitterGameService

bundle.js

+73-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<head>
22
<link rel="StyleSheet" type="text/css" href="./public/assets/stylesheets/GameBackground.css">
33
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
4+
<link rel="shortcut icon" href="/public/assets/images/favicon.ico" type="image/x-icon">
5+
<link rel="icon" href="/public/assets/images/favicon.ico" type="image/x-icon">
46
<script> // GOOGLE ANALYTICS CODE
57
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
68
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -28,6 +30,8 @@
2830
<div id="game-button-wrapper" class="game-button-wrapper">
2931
<div id="reset-button" type="submit" class="game-btn"><p class="button-text">Reset</p></div>
3032
<div id="new-game-button" type="submit" class="game-btn"><p class="button-text">New Game</p></div>
33+
<a id="tweet" href="https://twitter.com/share" class="twitter-share-button" data-text="Play MathSwipe with me! Connect numbered tiles to match the answers." data-size="large" data-hashtags="mathswipe">Tweet</a>
34+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
3135
</div>
3236
</div>
3337
<div class="center-column">

public/assets/images/favicon.ico

1.06 KB
Binary file not shown.

public/assets/stylesheets/GameBackground.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/stylesheets/GameBackground.sass

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ body
3636
font-size: 30px
3737

3838
.game-desc-hr
39-
margin: 40px 0px 20px 0px
39+
margin: 10px 0px 20px 0px
4040

4141
#how-to-play
4242
margin: 10px auto 10px auto
@@ -77,7 +77,7 @@ body
7777
word-wrap: break-word
7878
display: inline-block
7979
width: 40%
80-
margin: 0px 10px
80+
margin: 0 0 10px
8181
background-color: Transparent
8282
border-style: solid
8383
border-color: #a7acb0

0 commit comments

Comments
 (0)