Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Few minor changes #1

Merged
merged 5 commits into from

3 participants

@akoprow

-) Fixed FF bug,
-) added Opa Developer Challenge standard links

@mads379 mads379 merged commit 9b90696 into from
@mads379
Owner

Awesome! Thanks a lot Adam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 24, 2011
  1. @akoprow
  2. @akoprow
  3. @akoprow

    Adding About opp, fork me on GitHub & Built with Opa.

    akoprow authored
    Doesn't look good yet, needs some CSS work.
  4. Fork on github & footer design and positioning

    Ida Swarczewskaja authored
Commits on Nov 25, 2011
  1. @Aqua-Ye
This page is out of date. Refresh to see the latest.
View
1  Makefile
@@ -1,5 +1,6 @@
OPA=opa
EXE=chess.exe
+FLAGS = --minimal-version 991
all: $(EXE)
View
2  dotcloud.yml
@@ -0,0 +1,2 @@
+www:
+ type: opa
View
BIN  resources/opa-logo-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
19 resources/style.css
@@ -19,6 +19,9 @@ time, mark, audio, video {
font: inherit;
vertical-align: baseline;
}
+body {
+ font:normal 13px/100% Verdana, Tahoma, sans-serif;
+}
/* line 20, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
body {
@@ -690,3 +693,19 @@ tr {
.has_errors {
display: block;
}
+/* Footer */
+.footer {
+ width: 445px;
+ position:relative;
+ margin: 0;
+ text-align:right;
+ font-weight:bold;
+ position: absolute;
+ bottom: 10px;
+ right: 45px;
+ font-size:14px;
+}
+.footer, .footer a {color:#8D8D8D;text-decoration:none;}
+.footer span {margin: 0 5px;}
+.footer img {margin:1px 0 0 2px;}
+.footer span, .footer a, .footer img {vertical-align:top;}
View
6 src/game.opa
@@ -159,6 +159,7 @@ Game = {{
game_state = Option.get(Game.get_state())
xml = color ->
+ <>
<div onready={_ -> Network.add_callback(game_finished_recieved, game_observer)}>
<div onready={_ -> Network.add_callback(persistent_game_state_changed(name,_), persistent_game_state)}>
<div onready={_ -> when_ready(name,color, board, game_state, game) } class="game">
@@ -167,7 +168,8 @@ Game = {{
</div>
</div>
</div>
-
+ {Page.footer}
+ </>
if (Option.get(game.white) == user) then
Resource.styled_page("Chess", Page.style, xml({white}))
else
@@ -178,4 +180,4 @@ Game = {{
,User.login_view()) // 404 shouldn't happen
-}}
+}}
View
26 src/page.opa
@@ -19,11 +19,27 @@ Page = {{
*/
fourOfour() = default({ some = "fourofour"}, <h1>404</h1>)
-
+
+ header =
+ <a href="http://github.com/mads379/opa-chess">
+ <img style="position: absolute; top: 0; right: 0; border: 0;"
+ src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"/>
+ </>
+
+ footer =
+ <div class="footer">
+ <span><a target="_blank" href="http://blog.opalang.org/2011/11/spotlight-on-opa-app-opachess-by.html">About the app</a></span> •
+ <span><a target="_blank" href="https://github.com/mads379/opa-chess">Fork on GitHub</a></span> •
+ <span><a target="_blank" href="https://opalang.org">Built with <img src="/resources/opa-logo-small.png" alt="Opa"/></a></span>
+ </>
+ <script src="http://opalang.org/google_analytics.js" />
+
default(idOpt: option(string), content) =
(
id = Option.default("", idOpt)
Resource.styled_page("Chess", style,
+ <>
+ {Page.header}
<div id="{id}" class="container">
<div id="error_container" class="error_container no_errors">
<ul id="errors"></ul>
@@ -32,6 +48,8 @@ Page = {{
{content}
</div>
</div>
+ {Page.footer}
+ </>
)
)
@@ -71,6 +89,8 @@ Page = {{
_)
Resource.styled_page("Chess", style,
+ <>
+ {header}
<div id="lobby" class="container">
<div id="error_container" class="error_container no_errors">
<ul id="errors"></ul>
@@ -103,6 +123,8 @@ Page = {{
</form>
</div>
</div>
+ {footer}
+ </>
)
), User.login_view())
@@ -115,4 +137,4 @@ Page = {{
do Dom.add_class(#error_container,"has_errors")
do Dom.remove_content(#errors)
List.iter( x -> Dom.transform([#errors +<- <li>{x}</li>]), xs)
-}}
+}}
View
2  src/position.opa
@@ -15,7 +15,7 @@ Position = {{
chess_position_from_dom(dom: dom, board): chess_position =
(
// Very hacky. The 7th and 8th chars are the colulm and row number.
- clz = Dom.get_property(dom,"class") |> Option.get(_)
+ clz = Dom.get_attribute(dom,"class") |> Option.get(_)
column = String.get(6, clz)
row = String.get(7, clz) |> String.to_int(_)
Map.get(column, board.chess_positions) |> Option.get(_) |> Map.get(row, _) |> Option.get(_)
Something went wrong with that request. Please try again.