Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <title>Bootstrap Example</title>
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  10. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  11. <style>
  12. body {
  13. height: 100vh;
  14. }
  15.  
  16. .productionLine {
  17. position: relative;
  18. width: 80%;
  19. height: 60%;
  20. /* background-color: #ddd; */
  21. margin: 200px auto;
  22. overflow: hidden;
  23. }
  24.  
  25. .progress-bar {
  26. background-color: green;
  27. }
  28.  
  29. .engineStop {
  30. background-color: red;
  31. }
  32.  
  33. .right {
  34. transform: rotate(180deg);
  35. }
  36.  
  37. .positionBot {
  38. position: absolute;
  39. bottom: 0;
  40. left: 0;
  41. right: 0;
  42. }
  43.  
  44. .positionRight {
  45. position: absolute;
  46. transform: rotate(90deg);
  47. top: 0;
  48. right: calc(-100% + 50px);
  49. left: 0;
  50. }
  51.  
  52. .positionLeft {
  53. position: absolute;
  54. transform: rotate(270deg);
  55. top: 0;
  56. left: calc(-100% + 50px);
  57. right: 0;
  58. }
  59.  
  60. .progress {
  61. margin-bottom: 0;
  62. }
  63.  
  64. button {
  65. position: absolute;
  66. top: 10px;
  67. left: 0;
  68. right: 0;
  69. width: 200px;
  70. height: 100px;
  71. margin: 10px auto;
  72. }
  73.  
  74. .radius {
  75. border-radius: 50px;
  76. }
  77. </style>
  78. </head>
  79.  
  80. <body>
  81.  
  82. <div class="productionLine radius">
  83. <div class="progress" style="height: 50px;">
  84. <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="90"
  85. aria-valuemin="0" aria-valuemax="100" style="width:100%">
  86. </div>
  87.  
  88. </div>
  89. <div class="progress positionLeft reverse" style="height: 50px;">
  90. <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="90"
  91. aria-valuemin="0" aria-valuemax="100" style="width:100%">
  92. </div>
  93.  
  94. </div>
  95. <div class="progress positionRight" style="height: 50px;">
  96. <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="90"
  97. aria-valuemin="0" aria-valuemax="100" style="width:100%">
  98. </div>
  99.  
  100. </div>
  101. <div class="progress right positionBot" style="height: 50px;">
  102. <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="90"
  103. aria-valuemin="0" aria-valuemax="100" style="width:100%">
  104. </div>
  105.  
  106. </div>
  107. </div>
  108. <button> Włącz/Wyłącz</button>
  109. <script>
  110. let lines = '';
  111. document.querySelector('button').addEventListener('click', () => {
  112. lines = document.querySelectorAll('.progress-bar')
  113. lines.forEach(element => {
  114. element.classList.toggle('engineStop')
  115.  
  116. });
  117. })
  118. </script>
  119.  
  120. </body>
  121.  
  122. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement