GetLayerParameters.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="field is-horizontal layer">
  3. <div class="field-label is-normal">
  4. <label class="label lnorm">
  5. <div v-if="particle==='bulk'"> bulk </div>
  6. <div v-else-if="particle==='core-shell'">
  7. <div v-if="index == 0"> core </div>
  8. <div v-else> shell </div>
  9. </div>
  10. <div v-else>
  11. layer {{index+1}}
  12. </div>
  13. </label>
  14. </div>
  15. <div class="field-body">
  16. <div class="field is-grouped is-grouped-multiline">
  17. <div v-if="index == 0" class="rh-input">
  18. <input-with-units title="R" v-bind:units="units"
  19. v-bind:value="layer.R"
  20. @newdata="layer.R=$event"/>
  21. <span class="tooltiptext">Core radius</span>
  22. </div>
  23. <div v-else class="rh-input">
  24. <input-with-units title="h" v-bind:units="units"
  25. v-bind:value="layer.R"
  26. @newdata="layer.R=$event"/>
  27. <span class="tooltiptext">Layer thickness</span>
  28. </div>
  29. <input-with-units title="Re(n)" units=""
  30. v-bind:value="layer.reN"
  31. @newdata="layer.reN=$event"/>
  32. <input-with-units title="Im(n)" units=""
  33. v-bind:value="layer.imN"
  34. @newdata="layer.imN=$event"/>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script>
  40. import InputWithUnits from "./InputWithUnits.vue";
  41. export default {
  42. name: "GetLayerParameters",
  43. components: {
  44. InputWithUnits
  45. },
  46. props: ['layer', 'particle', 'index', 'units']
  47. }
  48. </script>
  49. <style scoped>
  50. .binput {
  51. display:flex;
  52. align-items:center;
  53. margin-left: 1rem;
  54. width:5rem;
  55. }
  56. .layer {
  57. margin: 0.5rem;
  58. }
  59. .lnorm {
  60. font-weight: normal;
  61. }
  62. .rh-input {
  63. margin-right: 12px;
  64. position: relative;
  65. display: inline-block;
  66. }
  67. /* Tooltip text */
  68. .rh-input .tooltiptext {
  69. visibility: hidden;
  70. width: 120px;
  71. background-color: #7957d5;
  72. color: white;
  73. text-align: center;
  74. padding: 5px 0;
  75. border-radius: 6px;
  76. /* Position the tooltip text - see examples below! */
  77. position: absolute;
  78. z-index: 1;
  79. bottom: 120%;
  80. left: 0%;
  81. }
  82. /* Show the tooltip text when you mouse over the tooltip container */
  83. .rh-input:hover .tooltiptext {
  84. visibility: visible;
  85. }
  86. </style>