File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed
Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 11let animationCanvas ;
2+ let circleSize = 0 ;
3+ let growing = true ;
24
35function setup ( ) {
46 const parent = document . getElementById (
@@ -9,13 +11,29 @@ function setup() {
911 parent . offsetHeight ,
1012 ) ;
1113 animationCanvas . parent ( "menuAnimationCanvas" ) ;
12- background ( 22 , 27 , 34 ) ;
14+ background ( 22 , 27 , 34 ) ; // 背景色を一度だけ設定
1315}
1416
1517function draw ( ) {
18+ background ( 22 , 27 , 34 , 50 ) ;
1619 noStroke ( ) ;
17- fill ( 255 , 255 , 255 , 50 ) ;
18- ellipse ( random ( width ) , random ( height ) , 10 , 10 ) ;
20+ fill ( 255 , 255 , 255 , 150 ) ;
21+
22+ if ( growing ) {
23+ circleSize += 0.5 ;
24+ if ( circleSize > 50 ) {
25+ growing = false ;
26+ }
27+ } else {
28+ circleSize -= 0.5 ;
29+ if ( circleSize < 10 ) {
30+ growing = true ;
31+ }
32+ }
33+ ellipse ( width / 2 , height / 2 , circleSize , circleSize ) ;
34+
35+ fill ( 255 , 255 , 255 , 80 ) ;
36+ ellipse ( mouseX , mouseY , 15 , 15 ) ;
1937}
2038
2139function windowResized ( ) {
Original file line number Diff line number Diff line change @@ -454,10 +454,9 @@ <h3>Contact</h3>
454454 </ section >
455455 </ main >
456456 </ div >
457- <!-- 共通JS -->
457+
458458 < script src ="assets/js/layout.js " defer > </ script >
459459 < script src ="assets/js/ui.js "> </ script >
460- <!-- トップページ専用JS(今は空でもOK) -->
461460 < script src ="assets/js/top.js " defer > </ script >
462461 </ body >
463462</ html >
Original file line number Diff line number Diff line change 3838 > Contact</ a
3939 >
4040
41- < canvas id ="menuAnimationCanvas "> </ canvas >
42- < script src ="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js "> </ script >
43- < script src ="assets/js/menuAnimation.js "> </ script >
41+ <!-- < canvas id="menuAnimationCanvas"></canvas> -- >
42+ <!-- < script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js"></script> -- >
43+ <!-- < script src="assets/js/menuAnimation.js"></script> -- >
4444 </ nav >
4545 </ div >
4646</ header >
You can’t perform that action at this time.
0 commit comments