character-generator.page.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <ion-header>
  2. <ion-toolbar>
  3. <ion-buttons slot="start">
  4. <ion-back-button defaultHref="/toolbox"></ion-back-button>
  5. </ion-buttons>
  6. <ion-title>人物设定生成</ion-title>
  7. </ion-toolbar>
  8. </ion-header>
  9. <ion-content [fullscreen]="true" class="ion-padding"
  10. style="background-image: url('../../assets/images/background-image6.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat;">
  11. <!-- 使用 ion-grid 包裹所有行,确保布局正确 -->
  12. <ion-grid>
  13. <ion-row>
  14. <ion-label>人物性别</ion-label>
  15. </ion-row>
  16. <ion-row class="type-buttons">
  17. <ion-col size="4">
  18. <ion-button (click)="selectGender('男')" [color]="selectedGender === '男' ? 'primary' : 'default'"
  19. class="type-button">男</ion-button>
  20. </ion-col>
  21. <ion-col size="4">
  22. <ion-button (click)="selectGender('女')" [color]="selectedGender === '女' ? 'primary' : 'default'"
  23. class="type-button">女</ion-button>
  24. </ion-col>
  25. </ion-row>
  26. <ion-row>
  27. <ion-label>小说类型</ion-label>
  28. </ion-row>
  29. <ion-row class="type-buttons">
  30. <ion-col size="4">
  31. <ion-button (click)="selectType('重生')" [color]="selectedType === '重生' ? 'primary' : 'default'"
  32. class="type-button">重生</ion-button>
  33. </ion-col>
  34. <ion-col size="4">
  35. <ion-button (click)="selectType('都市')" [color]="selectedType === '都市' ? 'primary' : 'default'"
  36. class="type-button">都市</ion-button>
  37. </ion-col>
  38. <ion-col size="4">
  39. <ion-button (click)="selectType('穿越')" [color]="selectedType === '穿越' ? 'primary' : 'default'"
  40. class="type-button">穿越</ion-button>
  41. </ion-col>
  42. </ion-row>
  43. <ion-row class="type-buttons">
  44. <ion-col size="4">
  45. <ion-button (click)="selectType('玄幻')" [color]="selectedType === '玄幻' ? 'primary' : 'default'"
  46. class="type-button">玄幻</ion-button>
  47. </ion-col>
  48. <ion-col size="4">
  49. <ion-button (click)="selectType('系统文')" [color]="selectedType === '系统文' ? 'primary' : 'default'"
  50. class="type-button">系统文</ion-button>
  51. </ion-col>
  52. <ion-col size="4">
  53. <ion-button (click)="selectType('搞笑轻松')" [color]="selectedType === '搞笑轻松' ? 'primary' : 'default'"
  54. class="type-button">搞笑轻松</ion-button>
  55. </ion-col>
  56. </ion-row>
  57. <ion-row>
  58. <ion-col size="12">
  59. <ion-label>期望描述</ion-label>
  60. <ion-textarea [value]="userPrompt" (ionChange)="promptInput($event)" placeholder="请输入期望描述"
  61. class="textarea-field" rows="5"></ion-textarea> <!-- 增加 rows 属性 -->
  62. </ion-col>
  63. </ion-row>
  64. <ion-row>
  65. <ion-col size="12">
  66. <ion-button expand="block" (click)="sendMessage()" class="generate-button">生成人物设定</ion-button>
  67. </ion-col>
  68. </ion-row>
  69. <ion-row *ngIf="responseMsg">
  70. <ion-col size="12">
  71. <ion-label>生成的人物设定</ion-label>
  72. <ion-textarea [value]="responseMsg" readonly class="response-textarea" rows="10"></ion-textarea>
  73. <!-- 增加 rows 属性 -->
  74. <ion-button expand="block" (click)="copyToClipboard()" class="copy-button">复制</ion-button>
  75. </ion-col>
  76. </ion-row>
  77. </ion-grid>
  78. </ion-content>