├── .editorconfig
├── .gitignore
├── README.md
├── assets
├── README.md
└── Users:mw:Desktop:projects:s.textClipping
├── components
├── Logo.vue
└── README.md
├── demo.gif
├── js
└── Radar.js
├── layouts
├── README.md
└── default.vue
├── middleware
└── README.md
├── nuxt.config.js
├── package.json
├── pages
├── README.md
└── index.vue
├── plugins
└── README.md
├── static
├── README.md
└── favicon.ico
└── store
└── README.md
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Node template
3 | # Logs
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Runtime data
11 | pids
12 | *.pid
13 | *.seed
14 | *.pid.lock
15 |
16 | # Directory for instrumented libs generated by jscoverage/JSCover
17 | lib-cov
18 |
19 | # Coverage directory used by tools like istanbul
20 | coverage
21 |
22 | # nyc test coverage
23 | .nyc_output
24 |
25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26 | .grunt
27 |
28 | # Bower dependency directory (https://bower.io/)
29 | bower_components
30 |
31 | # node-waf configuration
32 | .lock-wscript
33 |
34 | # Compiled binary addons (https://nodejs.org/api/addons.html)
35 | build/Release
36 |
37 | # Dependency directories
38 | node_modules/
39 | jspm_packages/
40 |
41 | # TypeScript v1 declaration files
42 | typings/
43 |
44 | # Optional npm cache directory
45 | .npm
46 |
47 | # Optional eslint cache
48 | .eslintcache
49 |
50 | # Optional REPL history
51 | .node_repl_history
52 |
53 | # Output of 'npm pack'
54 | *.tgz
55 |
56 | # Yarn Integrity file
57 | .yarn-integrity
58 |
59 | # dotenv environment variables file
60 | .env
61 |
62 | # parcel-bundler cache (https://parceljs.org/)
63 | .cache
64 |
65 | # next.js build output
66 | .next
67 |
68 | # nuxt.js build output
69 | .nuxt
70 |
71 | # Nuxt generate
72 | dist
73 |
74 | # vuepress build output
75 | .vuepress/dist
76 |
77 | # Serverless directories
78 | .serverless
79 |
80 | # IDE
81 | .idea
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # p5VueDemo
2 | **Sample image**
3 | * 
4 |
--------------------------------------------------------------------------------
/assets/README.md:
--------------------------------------------------------------------------------
1 | # ASSETS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
6 |
7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
8 |
--------------------------------------------------------------------------------
/assets/Users:mw:Desktop:projects:s.textClipping:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mitsuyacider/p5VueDemo/565613a7b3a5397994064bc5e6b48e6fedb2248b/assets/Users:mw:Desktop:projects:s.textClipping
--------------------------------------------------------------------------------
/components/Logo.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
80 |
--------------------------------------------------------------------------------
/components/README.md:
--------------------------------------------------------------------------------
1 | # COMPONENTS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | The components directory contains your Vue.js Components.
6 |
7 | _Nuxt.js doesn't supercharge these components._
8 |
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mitsuyacider/p5VueDemo/565613a7b3a5397994064bc5e6b48e6fedb2248b/demo.gif
--------------------------------------------------------------------------------
/js/Radar.js:
--------------------------------------------------------------------------------
1 | const circleNum = 100;
2 | const degree = 360 / circleNum;
3 | const spinNum = 4;
4 |
5 | let p5;
6 | let delegate;
7 | let radius = 50;
8 | let speed = 2;
9 |
10 | export function main(_p5) {
11 | p5 = _p5
12 |
13 | p5.setup = _ => {
14 | var canvas = p5.createCanvas(500, 500)
15 | canvas.parent("p5Canvas");
16 |
17 | p5.background(100);
18 |
19 | radius = 0;
20 | }
21 |
22 | p5.draw = _ => {
23 | p5.background(0);
24 | p5.push();
25 | p5.translate(p5.width / 2, p5.height / 2);
26 | p5.noFill();
27 | p5.stroke(255);
28 | for (var i = 0, step = 0; i < 360 * spinNum; i+=degree, step+=1) {
29 | const angle = p5.radians(i);
30 | var x = (radius + step) * p5.cos(angle);
31 | var y = (radius + step) * p5.sin(angle);
32 | p5.stroke(255);
33 | p5.rotate(1);
34 | p5.ellipse(x, y, 15, 15);
35 | var r = p5.map(i, 0, 360 * spinNum, 0, 255);
36 | var rand = p5.random(255);
37 | p5.stroke(r, rand, r, r);
38 | p5.line(0, 0, x, y);
39 | }
40 |
41 | p5.pop();
42 |
43 | radius += speed;
44 |
45 | if (radius > 360 || radius < -360 * 2 ) {
46 | speed *= -1;
47 | }
48 |
49 | notifyCurrentTime();
50 | }
51 | }
52 |
53 | function notifyCurrentTime() {
54 | if (delegate !== undefined) {
55 | const message = p5.hour() + ":" + p5.minute() + ":" + p5.second();
56 |
57 | delegate(message);
58 | }
59 | }
60 |
61 | export function setDelegate(_delegate) {
62 | delegate = _delegate;
63 | }
64 |
--------------------------------------------------------------------------------
/layouts/README.md:
--------------------------------------------------------------------------------
1 | # LAYOUTS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your Application Layouts.
6 |
7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
8 |
--------------------------------------------------------------------------------
/layouts/default.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
56 |
--------------------------------------------------------------------------------
/middleware/README.md:
--------------------------------------------------------------------------------
1 | # MIDDLEWARE
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your application middleware.
6 | The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts).
7 |
8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
9 |
--------------------------------------------------------------------------------
/nuxt.config.js:
--------------------------------------------------------------------------------
1 | const pkg = require('./package')
2 |
3 | module.exports = {
4 | mode: 'universal',
5 |
6 | /*
7 | ** Headers of the page
8 | */
9 | head: {
10 | title: pkg.name,
11 | meta: [
12 | { charset: 'utf-8' },
13 | { name: 'viewport', content: 'width=device-width, initial-scale=1' },
14 | { hid: 'description', name: 'description', content: pkg.description }
15 | ],
16 | link: [
17 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
18 | ]
19 | },
20 |
21 | /*
22 | ** Customize the progress-bar color
23 | */
24 | loading: { color: '#fff' },
25 |
26 | /*
27 | ** Global CSS
28 | */
29 | css: [
30 | ],
31 |
32 | /*
33 | ** Plugins to load before mounting the App
34 | */
35 | plugins: [
36 | ],
37 |
38 | /*
39 | ** Nuxt.js modules
40 | */
41 | modules: [,
42 | // Doc: https://bootstrap-vue.js.org/docs/
43 | 'bootstrap-vue/nuxt'
44 | ],
45 |
46 | /*
47 | ** Build configuration
48 | */
49 | build: {
50 | /*
51 | ** You can extend webpack config here
52 | */
53 | extend(config, ctx) {
54 |
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "p5VueDemo",
3 | "version": "1.0.0",
4 | "description": "My delightful Nuxt.js project",
5 | "author": "Mitsuya.Watanabe",
6 | "private": true,
7 | "scripts": {
8 | "dev": "nuxt",
9 | "build": "nuxt build",
10 | "start": "nuxt start",
11 | "generate": "nuxt generate"
12 | },
13 | "dependencies": {
14 | "bootstrap": "^4.1.3",
15 | "bootstrap-vue": "^2.0.0-beta",
16 | "cross-env": "^5.2.0",
17 | "nuxt": "^2.0.0",
18 | "p5": "^0.7.2"
19 | },
20 | "devDependencies": {
21 | "nodemon": "^1.11.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/pages/README.md:
--------------------------------------------------------------------------------
1 | # PAGES
2 |
3 | This directory contains your Application Views and Routes.
4 | The framework reads all the `*.vue` files inside this directory and create the router of your application.
5 |
6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).
7 |
--------------------------------------------------------------------------------
/pages/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{message}}
6 |
7 |
8 |
9 |
10 |
36 |
37 |
42 |
--------------------------------------------------------------------------------
/plugins/README.md:
--------------------------------------------------------------------------------
1 | # PLUGINS
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your Javascript plugins that you want to run before mounting the root Vue.js application.
6 |
7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins).
8 |
--------------------------------------------------------------------------------
/static/README.md:
--------------------------------------------------------------------------------
1 | # STATIC
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your static files.
6 | Each file inside this directory is mapped to `/`.
7 |
8 | Example: `/static/robots.txt` is mapped as `/robots.txt`.
9 |
10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).
11 |
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mitsuyacider/p5VueDemo/565613a7b3a5397994064bc5e6b48e6fedb2248b/static/favicon.ico
--------------------------------------------------------------------------------
/store/README.md:
--------------------------------------------------------------------------------
1 | # STORE
2 |
3 | **This directory is not required, you can delete it if you don't want to use it.**
4 |
5 | This directory contains your Vuex Store files.
6 | Vuex Store option is implemented in the Nuxt.js framework.
7 |
8 | Creating a file in this directory activate the option in the framework automatically.
9 |
10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store).
11 |
--------------------------------------------------------------------------------