项目作者: hisune

项目描述 :
SockIO PPT, the programmer's PPT!
高级语言: JavaScript
项目地址: git://github.com/hisune/sockio-ppt.git
创建时间: 2016-07-29T05:46:43Z
项目社区:https://github.com/hisune/sockio-ppt

开源协议:MIT License

下载


sockio-ppt

SockIO PPT, the programmer’s PPT!A simple nodejs PPT service that support remote control.Write a pug template as a online PPT!

SockIO PPT, 程序猿的PPT,支持远程控制多个PPT client端,解决远程PPT遥控问题。
不再需要人肉翻页PPT,不再需要共享屏幕。PPT书写简单快捷,只要你懂pug模版格式就能很快的写出你的PPT!

https://hisune.com/view/42/sockio-ppt-remote-control-html-ppt

Online demo

Feature

  • 简单,常用PPT展示功能实现,包括翻页、点击显示、提示器。嗯,代码也很简单
  • 快捷,仅需编写简单的pug模板即可生成PPT,特别适合程序猿
  • 安全,演示端URL和控制端URL均在命令行生成,且可自定义失效时间,再也不怕某些国内浏览器上报你访问的URL泄漏隐私
  • 智能,一个控制端URL可实时控制多个演示端URL,解决跨地域PPT分享痛点,再也无需在远程人肉操作PPT或共享屏幕

QA

  • 每一页PPT是如何定义的?
    • 一个.section类即一页PPT。
  • 如何自定义我自己的样式?
    • views/style.pug中定义了很多公用样式,你可以在你自己的ppt的pug文件中插入style标签定义自己的属性,例如demo中的.customer_css
  • 如何实现一个提示器?
    • 在你的ppt的pug文件中插入.prompt即可,例如demo中的第一个section中的h3.prompt,此类中的文字将仅在手机中可见,可用作手机端的提示器
    • 如果你在某一个.section中加入过.prompt,请在所有.section中加入.prompt,sockio-ppt会将.prompt类的出现当作启动和关闭提示器的开关

Requirement

nodejs 4.+ version

How to use it?

  1. git clone https://github.com/hisune/sockio-ppt.git
  2. cd sockio-ppt
  3. npm install
  4. cp config.default.js config.js # then modify your config.js
  5. node server

Then, write a pug template and copy it to ppts folder.

demo.pug

  1. link(rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/androidstudio.min.css")
  2. script(src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js")
  3. script(src="//cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js")
  4. style.
  5. .customer_css {
  6. }
  7. .left-top-vw {
  8. border-bottom: solid 2px #771074;
  9. width: 100%;
  10. text-align: left;
  11. margin-top: 2vh;
  12. height: 8vh;
  13. font-size: 4vh;
  14. }
  15. .right-top {
  16. height: 5vh;
  17. margin-top: 2vh;
  18. }
  19. .bb1 {
  20. background-color: #00B050;
  21. color: #fff;
  22. display: inline;
  23. padding: .5vh 3vw;
  24. width: 30vw;
  25. }
  26. .section
  27. h2 滑动/滚动/上下键 翻页
  28. h3
  29. a(href="https://github.com/hisune/sockio-ppt" target="_blank") https://github.com/hisune/sockio-ppt
  30. h3.prompt .prompt类起到提示器的作用,仅手机端可见,用来提示内容,例如:大家好,接下来由我来简单分享一下这次的会议内容。
  31. .section
  32. h2 Feature,点击/触摸显示隐藏内容
  33. .center-table(style="max-width: 80%;")
  34. .hidden
  35. h3 ●简单
  36. h4 常用PPT展示功能均已经实现。除此之外,嗯,代码也很简单;
  37. .hidden
  38. h3 快捷
  39. h4
  40. | 仅需编写简单的
  41. a(href="https://github.com/pugjs/pug" target="_blank") pug
  42. | 模板即可生成PPT,特别适合程序猿;
  43. .hidden
  44. h3 安全
  45. h4 演示端URL和控制端URL均在命令行生成,且可自定义失效时间,再也不怕某些国内浏览器上报你访问的URL泄漏隐私;
  46. .hidden
  47. h3 智能
  48. h4 一个控制端URL可实时控制多个演示端URL,解决跨地域PPT分享痛点,再也无需在远程人肉操作PPT或共享屏幕。
  49. .section
  50. .left-top.left-top-vw 顶部样式是这样的
  51. img.right-top(src="./report/mob.png")
  52. div.center-table
  53. h4.bb1 快使用双截棍
  54. h5 哼哼哈嘿
  55. h4.bb1 习武之人切记
  56. h5 仁者无敌
  57. h4.prompt
  58. | 周杰伦
  59. .section
  60. h1 HTTP - ajax轮询,代码高亮
  61. .left.hidden.center-table(style="text-indent: 8vw;")
  62. h4 client: 有消息吗?(req)
  63. h4 server: 木有(res)
  64. h4 client: 有消息吗?(req)
  65. h4 server: 木有!(res)
  66. h4 client: 有消息吗?(req)
  67. h4 server: 木有!!!(res)
  68. h4 client: 有消息吗?(req)
  69. h4 server: 。。。木有!!!(res)
  70. .right.hidden
  71. pre
  72. code(style="font-size: 2vw;")
  73. | var ajax = function()
  74. | {
  75. | $.ajax({
  76. | url: 'http://xxoo.com/xxoo',
  77. | success: function(ret){
  78. | // ... do something
  79. | setTimeout(ajax, 2000);
  80. | }
  81. | });
  82. | };
  83. | ajax();
  84. .section
  85. h2 来张图片
  86. div(style="height: 40vh")
  87. img(src="/demo/girl.jpg")
  88. .section
  89. h1 Q & A
  90. .left
  91. h4 PPT URL
  92. #qrcode-ppt
  93. .right
  94. h4 SockIO PPT 项目地址
  95. #qrcode-sockio
  96. script(type='text/javascript').
  97. var options = {
  98. sectionsColor: ['#f2f2f2', '#4BBFC3', '#fff', '#7BAABE', 'whitesmoke']
  99. };
  100. hljs.initHighlightingOnLoad();
  101. var initQrcode = function()
  102. {
  103. var qrcodeWidth = $(window).width() / 4;
  104. $('#qrcode-ppt').empty().qrcode({width: qrcodeWidth,height: qrcodeWidth,text: window.location.href.split('#')[0]});
  105. $('#qrcode-sockio').empty().qrcode({width: qrcodeWidth,height: qrcodeWidth,text: 'https://github.com/hisune/sockio-ppt'});
  106. };
  107. window.onresize = function(event) {
  108. initQrcode();
  109. };
  110. initQrcode();

Generate a client side online PPT url

  1. # node generate pug_name [pug or ctrl] [link number] [expire sec]
  2. node generate demo pug 5 60 # Generate 5 client side urls whitch will expired after 1 minute
  3. # if set `expire sec` to 0, the link will be only allowed to open once

Generate a control side online PPT url

whitch you can open it in mobile to control client side PPT

  1. # node generate pug_name [pug or ctrl] [link number] [expire sec]
  2. node generate demo ctrl 1 60 # Generate a client side url whitch will expired after 1 minute

Use nginx SSL

  1. server{
  2. listen 443;
  3. ssl on;
  4. ssl_certificate key/sockio.crt;
  5. ssl_certificate_key key/sockio.key;
  6. server_name sockio.com www.sockio.com;
  7. location / {
  8. proxy_set_header Upgrade $http_upgrade;
  9. proxy_set_header Connection "upgrade";
  10. proxy_http_version 1.1;
  11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12. proxy_set_header Host $host;
  13. proxy_pass http://127.0.0.1:3000;
  14. }
  15. access_log /path_to_your_log_dir/sockio.com.log access;
  16. }
  17. server{
  18. listen 80;
  19. server_name sockio.com www.sockio.com;
  20. return 301 https://sockio.com$request_uri;
  21. }

About author

Hisune

Offical site

SockIO

License

MIT