diff options
| author | raysan5 <raysan5@gmail.com> | 2016-02-07 12:36:48 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-02-07 12:36:48 +0100 |
| commit | 002db3ac4092fea0db28c67440bcd8024e097c89 (patch) | |
| tree | 9a9cd4ce46c932086f5341d3a9b6c82e01fa2f81 | |
| parent | 1d48ada50526b4d36902ff858f025e0b1c75add3 (diff) | |
| download | raylib-002db3ac4092fea0db28c67440bcd8024e097c89.tar.gz raylib-002db3ac4092fea0db28c67440bcd8024e097c89.zip | |
Corrected links to games
| -rw-r--r-- | games/sample_main.html | 49 | ||||
| -rw-r--r-- | js/games_code.js | 7 |
2 files changed, 27 insertions, 29 deletions
diff --git a/games/sample_main.html b/games/sample_main.html index a85b2bd3..60523f2c 100644 --- a/games/sample_main.html +++ b/games/sample_main.html @@ -27,27 +27,28 @@ <style type="text/css"> @font-face { font-family: 'grixel_acme_7_wide_xtnd'; - src: url('font/acme_7_wide_xtnd.eot'); - src: url('font/acme_7_wide_xtnd.eot?#iefix') format('embedded-opentype'), - url('font/acme_7_wide_xtnd.woff') format('woff'), - url('font/acme_7_wide_xtnd.ttf') format('truetype'); + src: url('../font/acme_7_wide_xtnd.eot'); + src: url('../font/acme_7_wide_xtnd.eot?#iefix') format('embedded-opentype'), + url('../font/acme_7_wide_xtnd.woff') format('woff'), + url('../font/acme_7_wide_xtnd.ttf') format('truetype'); font-weight: normal; font-style: normal; font-size-adjust:0.49; } - #eximage { width: 802px; height: 452px; text-align: center; } - #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + + #sampledata { width: 802px; height: 452px; text-align: center; } + #sampledata img { margin: 0 auto; border: 1px solid; border-color: black; } + #sampledata canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } - .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; + + .viewcodebtn{ margin-top: 10px; width:795px; height:30px; float:right; position:relative; cursor:pointer; font-weight:bold; font-size:10px; line-height:30px; text-align: center; border-width:5px; background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888; font-family: grixel_acme_7_wide_xtnd, Courier New, Verdana, Arial;} - #exdowncode .exdownbtn:hover{background-color:#f0d6d6; color:#c55757; border:4px solid #e66666;} - #exdownexec .exdownbtn:hover{background-color:#bedce8; color:#417794; border:4px solid #5d9cbd;} + #viewcode .viewcodebtn:hover{background-color:#bedce8; color:#417794; border:4px solid #5d9cbd;} - .fancybox-wrap fancybox-desktop fancybox-type-iframe fancybox-opened { width: 860px!important;} - .fancybox-inner { width: 850px!important; } + .fancybox-wrap fancybox-desktop fancybox-type-iframe fancybox-opened { width: 860px!important; } + .fancybox-inner { width: 850px!important; height:520px!important; } .fancybox-iframe { width: 830px!important; } </style> @@ -59,24 +60,17 @@ document.title = "raylib - " + name.replace('_', ' '); - //var codeUrl = '../examples/' + name + '.c'; + var codeUrl = 'https://github.com/raysan5/raylib/blob/develop/games/samples/' + name.substring(7) + '.c'; var imageUrl = 'img/' + name + '.png'; - $('#eximage img').attr('src', imageUrl); - - /* - $.get(codeUrl, function(data) { - $('pre code').text(data); - $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - */ - - // #eximage filling code: canvas sample and image - $('#eximage').append( + // #sampledata filling code: canvas sample and image + $('#sampledata').append( '<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()">' + '<img src="' + imageUrl + '" alt=" ">' + '</canvas>'); + $('#viewcode').attr('href', codeUrl); + Module.canvas = document.getElementById('canvas'); Module.canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false); @@ -96,11 +90,12 @@ </div> <!-- Canvas example or image, filled on loading --> - <div id="eximage"></div> + <div id="sampledata"></div> - <!--<textarea id="output" rows="8"></textarea>--> + <a id="viewcode" href=" " target="_blank"><div class="viewcodebtn">View code on Github</div></a> - <pre><code class="cpp"></code></pre> + <!--<textarea id="output" rows="8"></textarea>--> + <!--<pre><code class="cpp"></code></pre>--> <script type='text/javascript'> //var statusElement = document.getElementById('status'); diff --git a/js/games_code.js b/js/games_code.js index 028a9982..f79cad4f 100644 --- a/js/games_code.js +++ b/js/games_code.js @@ -49,9 +49,12 @@ $(document).ready(function() { // TODO: samples open an exmain.html samples page while full games open a brand new page - var linkTag = '<a class="fancybox fancybox.iframe" href="examples_web/exmain.html?name=' + exampleName[i] + '" title="' + exampleDesc[i] + '">' + var linkTag - if (filterType == 'game') linkTag = '<a target="_blank" href="games/' + exampleName[i].substring(5) + '.html" title="' + exampleDesc[i] + '">' + if (filterType == 'sample') linkTag = '<a class="fancybox fancybox.iframe" href="games/sample_main.html?name=' + exampleName[i] + '" title="' + exampleDesc[i] + '">' + else if (filterType == 'game') linkTag = '<a target="_blank" href="games/' + exampleName[i].substring(5) + '.html" title="' + exampleDesc[i] + '">' + + if (exampleName[i] == 'game_koala_seasons') linkTag = '<a target="_blank" href="http://www.koalaseasons.com" title="' + exampleDesc[i] + '">' $('#container').append( '<div class="mix f' + filterType + '">' + linkTag + |
