Musical keyboard component written in React.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="en-PH">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,shrink-to-fit=no">
  6. <title>Demo | React Musical Keyboard</title>
  7. <meta name="description" content="@theoryofnekomata/react-musical-keyboard">
  8. <style>
  9. :root {
  10. --color-channel-0: #f55;
  11. --color-channel-1: #ff0;
  12. --color-channel-2: #0a0;
  13. --color-channel-3: #05a;
  14. --color-channel-4: #a0f;
  15. --color-channel-5: #a00;
  16. --color-channel-6: #a50;
  17. --color-channel-7: #fa0;
  18. --color-channel-8: #0f0;
  19. --color-channel-9: #0aa;
  20. --color-channel-10: #0ff;
  21. --color-channel-11: #f0a;
  22. --color-channel-12: #aa0;
  23. --color-channel-13: #550;
  24. --color-channel-14: #50a;
  25. --color-channel-15: #f5f;
  26. }
  27. html {
  28. width: 100%;
  29. height: 100%;
  30. color: white;
  31. background-color: black;
  32. font-family: system-ui, sans-serif;
  33. }
  34. body {
  35. margin: 0;
  36. width: 100%;
  37. height: 100%;
  38. display: grid;
  39. grid-template-areas:
  40. 'channel instrument instrument'
  41. 'background background background'
  42. 'keyboard keyboard keyboard';
  43. grid-template-columns: 5rem auto auto;
  44. grid-template-rows: 3rem auto 15rem;
  45. }
  46. #channel {
  47. grid-area: channel;
  48. -webkit-appearance: none;
  49. border: 0;
  50. outline: 0;
  51. background-color: transparent;
  52. color: inherit;
  53. font: inherit;
  54. padding: 0 1rem;
  55. }
  56. #instrument {
  57. grid-area: instrument;
  58. -webkit-appearance: none;
  59. border: 0;
  60. outline: 0;
  61. background-color: transparent;
  62. color: inherit;
  63. font: inherit;
  64. padding: 0 1rem;
  65. }
  66. #keyboard {
  67. grid-area: keyboard;
  68. width: 100%;
  69. position: relative;
  70. overflow-x: auto;
  71. color: black;
  72. background-color: white;
  73. cursor: pointer;
  74. }
  75. #keyboard-scroll {
  76. width: 750%;
  77. height: 100%;
  78. top: 0;
  79. left: 0;
  80. position: absolute;
  81. }
  82. @media (min-width: 1080px) {
  83. body {
  84. grid-template-rows: 5rem auto 5rem;
  85. }
  86. #keyboard-scroll {
  87. width: 100%;
  88. }
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <script src="index.tsx"></script>
  94. </body>
  95. </html>