name-generator.page.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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-col size="12">
  15. <ion-label>小说类型</ion-label>
  16. <ion-input [(ngModel)]="type" (ionInput)="typeInput($event)" placeholder="请输入小说类型"
  17. class="input-field"></ion-input>
  18. </ion-col>
  19. </ion-row>
  20. <ion-row>
  21. <ion-col size="12">
  22. <ion-label>读者人群</ion-label>
  23. <ion-row>
  24. <ion-col size="4">
  25. <ion-button (click)="selectReaderGroup('不限人群')"
  26. [color]="selectedReaderGroup === '不限人群' ? 'primary' : 'default'"
  27. class="reader-group-button">不限人群</ion-button>
  28. </ion-col>
  29. <ion-col size="4">
  30. <ion-button (click)="selectReaderGroup('男频小说')"
  31. [color]="selectedReaderGroup === '男频小说' ? 'primary' : 'default'"
  32. class="reader-group-button">男频小说</ion-button>
  33. </ion-col>
  34. <ion-col size="4">
  35. <ion-button (click)="selectReaderGroup('女频小说')"
  36. [color]="selectedReaderGroup === '女频小说' ? 'primary' : 'default'" color="warning"
  37. class="reader-group-button">女频小说</ion-button>
  38. </ion-col>
  39. </ion-row>
  40. </ion-col>
  41. </ion-row>
  42. <ion-row>
  43. <ion-col size="12">
  44. <ion-label>故事梗概</ion-label>
  45. <ion-textarea [value]="userPrompt" (ionChange)="promptInput($event)" placeholder="请输入小说故事梗概"
  46. class="textarea-field" rows="5"></ion-textarea> <!-- 增加 rows 属性 -->
  47. </ion-col>
  48. </ion-row>
  49. <ion-row>
  50. <ion-col size="12">
  51. <ion-button expand="block" (click)="sendMessage()" class="generate-button">生成小说书名</ion-button>
  52. </ion-col>
  53. </ion-row>
  54. <ion-row *ngIf="responseMsg">
  55. <ion-col size="12">
  56. <ion-label>生成的小说书名</ion-label>
  57. <ion-textarea [value]="responseMsg" readonly class="response-textarea" rows="10"></ion-textarea>
  58. <!-- 增加 rows 属性 -->
  59. <ion-button expand="block" (click)="copyToClipboard()" class="copy-button">复制</ion-button>
  60. </ion-col>
  61. </ion-row>
  62. </ion-grid>
  63. </ion-content>