Selaa lähdekoodia

上传文件至 ''

0225266 4 kuukautta sitten
vanhempi
commit
1b2f678369

+ 27 - 0
game-content.component.html

@@ -0,0 +1,27 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-title>游戏</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item class="go">
+      <ion-label>围棋</ion-label>
+    </ion-item>
+    <ion-item class="chess">
+      <ion-label>象棋</ion-label>
+    </ion-item>
+    <ion-item class="junqi">
+      <ion-label>军棋</ion-label>
+    </ion-item>
+    <ion-item class="more">
+      <ion-label>更多</ion-label>
+    </ion-item>
+  </ion-list>
+  <div class="circles">
+    <div class="circle"></div>
+    <div class="circle"></div>
+    <div class="circle"></div>
+  </div>
+</ion-content>

+ 63 - 0
game-content.component.scss

@@ -0,0 +1,63 @@
+ion-item {
+  font-size: 24px;
+  transition: transform 0.3s;
+
+  ion-label {
+    font-size: 30px;
+  }
+
+  &.go {
+    background-color: #FFD700; /* 金色 */
+  }
+
+  &.chess {
+    background-color: #FF69B4; /* 粉色 */
+  }
+
+  &.junqi {
+    background-color: #87CEEB; /* 天蓝色 */
+  }
+
+  &.more {
+    background-color: #32CD32; /* 青绿色 */
+  }
+
+  &:hover {
+    transform: scale(1.1);
+  }
+}
+
+.circles {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  
+  .circle {
+    width: 20px;
+    height: 20px;
+    background-color: #000;
+    border-radius: 50%;
+    margin: 0 10px;
+    animation: pulse 2s infinite;
+  }
+
+  .circle:nth-child(2) {
+    animation-delay: 0.4s;
+  }
+
+  .circle:nth-child(3) {
+    animation-delay: 0.8s;
+  }
+}
+
+@keyframes pulse {
+  0% {
+    transform: scale(1);
+  }
+  50% {
+    transform: scale(1.5);
+  }
+  100% {
+    transform: scale(1);
+  }
+}

+ 24 - 0
game-content.component.spec.ts

@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { GameContentComponent } from './game-content.component';
+
+describe('GameContentComponent', () => {
+  let component: GameContentComponent;
+  let fixture: ComponentFixture<GameContentComponent>;
+
+  beforeEach(waitForAsync(() => {
+    TestBed.configureTestingModule({
+      declarations: [ GameContentComponent ],
+      imports: [IonicModule.forRoot()]
+    }).compileComponents();
+
+    fixture = TestBed.createComponent(GameContentComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  }));
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 16 - 0
game-content.component.ts

@@ -0,0 +1,16 @@
+import { Component } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+  selector: 'app-game-content',
+  templateUrl: './game-content.component.html',
+  styleUrls: ['./game-content.component.scss']
+})
+export class GameContentComponent {
+
+  constructor(private router: Router) {}
+
+  startGame() {
+    this.router.navigate(['/game']); // 跳转到游戏页面
+  }
+}