GithubHelp home page GithubHelp logo

valorad / 3yibao-react Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 119 KB

A screen-saver for teasing 3yibao, re-written in React

Home Page: https://www.wcnexus.com/3yibao

License: MIT License

HTML 2.87% CSS 12.04% TypeScript 85.09%
screensaver react funny chart console notifications random-generation screen-saver typescript

3yibao-react's Introduction

3yibao-react

A screen-saver for teasing 3yibao, re-written in React 三怡宝的日常放松专属屏保

中文版

demo

Original Image: https://i.imgur.com/Vv8xw8g.gif (If Github says max content length exceeded)

3yibao(三怡宝, Troisième C'est bon) was bootstrapped with Create React App v3.

Description

This funny site is used as a dashboard to describe the general attributes of the funny character 3yibao (e.g. the energy level, bad-luck points, jackpot chances and probability of losing weight) by some random algorithms. The attributes are all customizable. It is now using react framework at the front, and a simple go echo framework at the back-end.

Yibao Attributes

The program calculates the yibao attributes during the time based on the input and put them in the charts.

The yibao attributes can be categorized into two: experience type and probability type.

Experience type has level thresholds, in which levels can go up or go down, and threshold order decides the leveling-up direction, while the probability type has a fixed range of 0 - 100%.

You need to specify the name, and algorithm parameters in advance for both of them, and additionally the level thresholds and orders for experience type.

As for now, the experiences are using Random walk model, in which a Gaussian number needs to be generated by the polar form of Box–Muller transform first, while for the probability part, the model is relatively simple, just normal javascript random numbers. The parameters available to set are magnitude and offset, which do nothing but the linear transformation to the original model. Hopefully, we can customize the algorithms in future updates.

Billboard

billboard

3yibao's alias, as you can see the 1, 2, ..., 9 yibao, are randomly generated by index part. This alias will be used across the site.

The billboard up front will dynamically display the current yibao in place. The two lights are programmed to circling around, and "恭喜N怡宝" moves left and right periodically.

Dashboard

dashboard

The dashboard in the middle shows the current status of yibao attributes. It automatically tells which level it is now and shows the next level value for experience type, and also show the current probability or status for probability type.

The charts from FusionCharts display the newly generated value. By default (when the chart type is not specified), they are line charts that have a memory of 30 points. Alternatively, you can select simple gauge. The "boom" effect is given near the chart every time there is an experience "level up" or probability "Off the charts". The charts will also grey out if the value reaches the pre-configured minimum value.

Console and notification system

console

You can press "~" key or click the billboard to open the console, and check the log of various events (upgrade / downgrade / probability too low, etc.) there.

notification

Also, the events will pop up by notification system (which utilizes react-toastify). Note that the maximum number of notifications on the screen is limited to 5.

Credit

react logo from Create React App

explosion svg from OnlyGFX

various icons from iconfont

react-toastify

FusionCharts

3yibao-react's People

Contributors

valorad avatar

Watchers

 avatar  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.