Code Monkey home page Code Monkey logo

flying-cards's Introduction

Flying Cards

原力甩卡

如果开两个网页,就可以来回传送卡片。

如果拿两台手机,都打开这个网站,也可以来回传送卡片。

Demo

http://flyingcards.fastbreakfast.top/

在两个页面(设备)中打开这个网站。 在输入框里输入对应的号码,点击connect。也可以点random。 如果一个页面被清空了,就可以开始滑动啦。

Preview

虽然原理很简单,但是我觉得这个效果很有趣。

完整的图太大了,就不放到仓库里了

效果动图

Usage

  • 项目由两个部分组成:
    • 前端react:用来显示卡片的动效 (FlyingCards/react-cards)
    • 后端Django:用Websockets来模拟传输 (FlyingCards/mysite)
  • 修改react-cards/src/index.js 里的 cards 就可以修改图片
  • mysite是直接通过修改Channels的教程完成的。所以连名字都没改。
  • 可以通过修改mysite/chat/consumers.py完成Websockets的一些修改。

Installation

首先,你需要安装一个redis

git clone https://github.com/GavBaros/react-tinder-cards.git
cd Flying-Cards/react-cards
npm install
npm start

# 再开一个终端,或者把npm start放到后台

cd Flying-Cards/mysite
mkvirtualenv flyingcards
pip install -r requirements.txt
python3 manage.py runserver

# 修改 Flying-Cards/react-cards/src/index.js 里 150行 domin 为自己的地址
# 直接打开 http://localhost:3006/
# 或者部署

Acknowledgements

flying-cards's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.