Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. <template>
  2. <div id="home">
  3. <b-carousel id="homeSlider"
  4. style="text-shadow: 1px 1px 2px #333;"
  5. controls
  6. :interval="4000"
  7. img-width="1024"
  8. img-height="480"
  9. v-model="slide"
  10. @sliding-start="onSlideStart"
  11. @sliding-end="onSlideEnd">
  12. <b-carousel-slide>
  13. <img slot="img" class="d-block img-fluid w-100" width="1024" height="480"
  14. src="../assets/images/img1.png" alt="image slot">
  15. <h1><b>Simplifying the journey</h1>
  16. </b-carousel-slide>
  17. <b-carousel-slide>
  18. <img slot="img" class="d-block img-fluid w-100" width="1024" height="480"
  19. src="../assets/images/img2.png" alt="image slot">
  20. <h1><b>Connecting the dots </h1>
  21. </b-carousel-slide>
  22. <b-carousel-slide>
  23. <img slot="img" class="d-block img-fluid w-100" width="1024" height="480"
  24. src="../assets/images/img3.png" alt="image slot">
  25. <h1><b>The critical decisions</h1>
  26. </b-carousel-slide>
  27. </b-carousel>
  28. <!-- <div class="carousel-controls-separator"></div> -->
  29. </div>
  30. </template>
  31.  
  32. <script lang="js">
  33. export default{
  34. data () {
  35. return {
  36. slide: 0,
  37. sliding: null
  38. }
  39. },
  40. methods: {
  41. onSlideStart (slide) {
  42. this.sliding = true
  43. },
  44. onSlideEnd (slide) {
  45. this.sliding = false
  46. }
  47. }
  48. }
  49. </script>
  50.  
  51. <style lang="scss" scoped>
  52. @import '../styles/variables.scss';
  53. //general
  54. @import '../styles/styles.scss';
  55. // home section
  56. $carouselControlSize : 50px;
  57. $carouselControlSeparatorSize : 50px;
  58. $carouselControlsWidth : #{($carouselControlSize * 2) + $carouselControlSeparatorSize};
  59.  
  60. div#home {
  61. div#homeSlider {
  62. div.carousel-item {
  63. height : auto;
  64.  
  65. div.carousel-caption{
  66. bottom: auto;
  67. top: 30%;
  68.  
  69. h1 {
  70. font-weight : 200;
  71. }
  72. }
  73. }
  74.  
  75. div.carousel-controls {
  76. position : absolute;
  77. width : $carouselControlsWidth;
  78. height : $carouselControlSize;
  79. bottom : 60px;
  80. left : calc(50% - #{$carouselControlsWidth / 2});
  81. z-index : 10;
  82.  
  83. .carousel-control {
  84. height : $carouselControlSize;
  85. width : $carouselControlSize;
  86. border-radius : 50%;
  87. border : 2px solid map-get($colors, "white");
  88. }
  89.  
  90. .carousel-control-prev-icon, .carousel-control-next-icon {
  91. position : relative;
  92. opacity : 1;
  93. }
  94. .carousel-control-prev i {
  95. margin-left : -2px;
  96. }
  97. .carousel-control-next i {
  98. margin-right : -2px;
  99. }
  100.  
  101. .carousel-control-separator {
  102. height : 2px;
  103. width : $carouselControlSeparatorSize;
  104. background-color : map-get($colors, "white");
  105. }
  106. }
  107. }
  108. }
  109. a.carousel-control-next{
  110. position: absolute;
  111. top: 50%;
  112. right: 0;
  113. height: 50px;
  114. width: 50px;
  115. border-radius: 50%;
  116. border: 2px solid white;
  117. right: 40%;
  118. top: 80%;
  119. opacity: 1;
  120. }
  121. .carousel-controls-separator{
  122. width: 100px;
  123. position: absolute;
  124. bottom: 60%;
  125. left: 44%;
  126. border: 2px solid white;
  127. }
  128. div#home{
  129. div#homeSlider{
  130. .carousel-caption h1{
  131. bottom: 250px;
  132. font-size: 30px;
  133. }
  134. }
  135. }
  136. div#home{
  137. div#homeSlider{
  138. a.carousel-control-next{
  139. position: absolute;
  140. top: 50%;
  141. height: 50px;
  142. width: 50px;
  143. border-radius: 50%;
  144. border: 2px solid white;
  145. right: 40%;
  146. top: 80%;
  147. opacity: 1;
  148. }
  149. }
  150. }
  151.  
  152. //media queries
  153. // sm devices
  154. @media (max-width: 575.98px){
  155. div#home{
  156. .thumbnail{
  157. position: relative;
  158. }
  159. .caption{
  160. position: absolute;
  161. top: 40%;
  162. width: 100%
  163. }
  164. h1{
  165. font-size: 20px !important;
  166. font-weight: 300;
  167. margin-left: 20px;
  168. margin-right: 20px;
  169. }
  170. }
  171.  
  172. }
  173. //media queries
  174. @media (max-width: 768px){
  175. div#home{
  176. .thumbnail{
  177. position: relative;
  178. }
  179. .caption{
  180. position: absolute;
  181. top: 40%;
  182. width: 100%
  183. }
  184. h1{
  185. font-size: 22px;
  186. font-weight: 300;
  187. margin-left: 20px;
  188. margin-right: 20px;
  189. }
  190. }
  191. }
  192. //media queries
  193. @media (min-width: 992px){
  194. div#home div#homeSlider div.carousel-item{
  195. height: auto;
  196. }
  197. div#home h1{
  198. font-size: 34px;
  199. }
  200. div#home{
  201. .carousel-inner img{
  202. height: auto;
  203. }
  204. }
  205. }
  206. .carousel-caption h1{
  207. position: relative;
  208. top: 24%;
  209. }
  210. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement