PageRenderTime 75ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/py/mainpage.py

https://github.com/scelfo/plexode
Python | 54 lines | 51 code | 2 blank | 1 comment | 0 complexity | db1621c3b1ffd5204d25015022decf4e MD5 | raw file
  1. #!/usr/bin/env python
  2. import format
  3. def formatMain():
  4. name = 'main'
  5. h = []
  6. h.append(format.headStart(name, 0))
  7. h.append('</head><body>')
  8. h.append(format.navDiv(name, 0))
  9. h.append(format.mainDiv("""
  10. <p>
  11. <i>2011-06-27</i><br>
  12. Upgraded <a href="/vorp">Vorp</a> graphics and handling a bit.<br>
  13. Now plexode's source is on github, at
  14. <a href="https://github.com/aaronwhyte/plexode">https://github.com/aaronwhyte/plexode</a>.
  15. <p>
  16. <i>2011-01-23</i><br>
  17. Added a new game, <a href="/vorp">Vorp</a>, to the nav bar.
  18. <p>
  19. <i>2010-06-26</i><br>
  20. Refactored the whole site!<br>
  21. For example, now you can go to <a href="eval3">plexode.com/eval3</a>
  22. instead of <a href="cgi-bin/eval3.py">plexode.com/cgi-bin/eval3.py</a>
  23. <br>All old-style URLs should get redirected to the new URLs. eval2 and eval3 URL hash fragments are preserved, even on IE.
  24. <p>
  25. I also got rid of some cruft, and added some stuff.
  26. <p>
  27. <i>2009-02-22</i><br>
  28. Insta-html and eval have a beautiful baby and it is <a href="eval3">eval3</a>.
  29. It is full of wonders. Here is a snake I made with it:
  30. <a href="eval3#ht=DUDE%20OMG%20%3Cb%20id%3D%22wave%22%20style%3D%22font-size%3A150%25%3B%20color%3Agreen%22%3E%3C%2Fb%3E%20IT%20IS%20A%20SNAKE&ohh=1&ohj=1&jt=var%20a%20%3D%20[]%3B%0Avar%20n%20%3D%20(new%20Date()).getTime()%3B%0Afor%20(var%20i%20%3D%200%3B%20i%20%3C%2020%3B%20%2B%2Bi)%20{%0A%20%20var%20s%20%3D%20Math.sin(n%2F210%20%2B%20i%2F1.1)%20*%2025%20%2B%20Math.sin(n%2F240%20%2B%20i%2F3)%20*%2025%3B%0A%20%20var%20c%20%3D%20-Math.cos(n%2F200%20%2B%20i%2F2)%20*%2025%20-%20Math.cos(n%2F260%20%2B%20i%2F2.9)%20*%2025%3B%0A%20%20a.push(%27%3Cb%20style%3D%22position%3Arelative%3Bleft%3A%27%2C%20s%2C%20%27px%3Btop%3A%27%2C%20c%2C%20%27px%22%3Es%3C%2Fb%3E%20%27)%3B%0A}%0Agebi(%27wave%27).innerHTML%20%3D%20a.join(%27%27)%3B%0A%0An%20%25%20100000%3B%0A&ojh=1&ojj=1&ms=30&oth=0&otj=1&cex=1">A snake.</a>
  31. <p>
  32. <i>2008-03-02</i><br>
  33. Now <a href="eval2">eval2</a> saves and loads content using the href
  34. fragment, so you can save a JS program as a bookmark, or send one to a friend.<br>
  35. See <a href="eval2#%2F%2Feval%20every%20100ms!%0Avar%20a%20%3D%20%5B%5D%3B%0Afor%20(var%20i%20%3D%201%3B%20i%20%3C%3D%2020%3B%20%2B%2Bi)%20%7B%0A%20%20var%20n%20%3D%20(new%20Date()).getTime()%3B%0A%20%20var%20s%20%3D%20Math.sin(n%2F200%20%2B%20i)%20*%209%3B%0A%20%20var%20c%20%3D%20-Math.cos(n%2F200%20%2B%20i)%20*%209%3B%0A%20%20a.push('%26nbsp%3B%3Cb%20style%3D%22position%3Arelative%3Bleft%3A'%2C%20s%2C%20'px%3Btop%3A'%2C%20c%2C%20'px%22%3E%23%3C%2Fb%3E%26nbsp%3B')%3B%0A%7D%0Agebi('d').innerHTML%20%3D%20a.join('')%3B%0A''%3B">Super
  36. Fun Time Example URL</a>.
  37. Good idea, Julie!
  38. <p>
  39. <i>Many moons ago...</i><br>
  40. Welcome to Plexode!<br>
  41. Want to <a href="/fracas">play a game</a>?
  42. """))
  43. h.append(format.footer())
  44. return ''.join(h)
  45. def main():
  46. print formatMain()
  47. if __name__ == "__main__":
  48. main()