_orbit.scss 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import 'global';
  5. // @variables
  6. //
  7. $include-html-orbit-classes: $include-html-classes !default;
  8. // We use these to control the caption styles
  9. $orbit-container-bg: none !default;
  10. $orbit-caption-bg: rgba(51,51,51, .8) !default;
  11. $orbit-caption-font-color: $white !default;
  12. $orbit-caption-font-size: rem-calc(14) !default;
  13. $orbit-caption-position: "bottom" !default; // Supported values: "bottom", "under"
  14. $orbit-caption-padding: rem-calc(10 14) !default;
  15. $orbit-caption-height: auto !default;
  16. // We use these to control the left/right nav styles
  17. $orbit-nav-bg: transparent !default;
  18. $orbit-nav-bg-hover: rgba(0,0,0,0.3) !default;
  19. $orbit-nav-arrow-color: $white !default;
  20. $orbit-nav-arrow-color-hover: $white !default;
  21. // We use these to control the timer styles
  22. $orbit-timer-bg: rgba(255,255,255,0.3) !default;
  23. $orbit-timer-show-progress-bar: true !default;
  24. // We use these to control the bullet nav styles
  25. $orbit-bullet-nav-color: $iron !default;
  26. $orbit-bullet-nav-color-active: $aluminum !default;
  27. $orbit-bullet-radius: rem-calc(9) !default;
  28. // We use these to controls the style of slide numbers
  29. $orbit-slide-number-bg: rgba(0,0,0,0) !default;
  30. $orbit-slide-number-font-color: $white !default;
  31. $orbit-slide-number-padding: rem-calc(5) !default;
  32. // Graceful Loading Wrapper and preloader
  33. $wrapper-class: "slideshow-wrapper" !default;
  34. $preloader-class: "preloader" !default;
  35. // Hide controls on small
  36. $orbit-nav-hide-for-small: true !default;
  37. $orbit-bullet-hide-for-small: true !default;
  38. $orbit-timer-hide-for-small: true !default;
  39. @include exports("orbit") {
  40. @if $include-html-orbit-classes {
  41. @-webkit-keyframes rotate {
  42. from {
  43. -webkit-transform: rotate(0deg);
  44. transform: rotate(0deg);
  45. }
  46. to {
  47. -webkit-transform: rotate(360deg);
  48. transform: rotate(360deg);
  49. }
  50. }
  51. @keyframes rotate {
  52. from {
  53. -webkit-transform: rotate(0deg);
  54. -moz-transform: rotate(0deg);
  55. -ms-transform: rotate(0deg);
  56. transform: rotate(0deg);
  57. }
  58. to {
  59. -webkit-transform: rotate(360deg);
  60. -moz-transform: rotate(360deg);
  61. -ms-transform: rotate(360deg);
  62. transform: rotate(360deg);
  63. }
  64. }
  65. /* Orbit Graceful Loading */
  66. .#{$wrapper-class} {
  67. position: relative;
  68. ul {
  69. // Prevent bullets showing before .orbit-container is loaded
  70. list-style-type: none;
  71. margin: 0;
  72. // Hide all list items
  73. li,
  74. li .orbit-caption { display: none; }
  75. // ...except for the first one
  76. li:first-child { display: block; }
  77. }
  78. .orbit-container { background-color: transparent;
  79. // Show images when .orbit-container is loaded
  80. li { display: block;
  81. .orbit-caption { display: block; }
  82. }
  83. .orbit-bullets li {
  84. display: inline-block;
  85. }
  86. }
  87. // Orbit preloader
  88. .#{$preloader-class} {
  89. @include radius(1000px);
  90. animation-duration: 1.5s;
  91. animation-iteration-count: infinite;
  92. animation-name: rotate;
  93. animation-timing-function: linear;
  94. border-color: $charcoal $white;
  95. border: solid 3px;
  96. display: block;
  97. height: 40px;
  98. left: 50%;
  99. margin-left: -20px;
  100. margin-top: -20px;
  101. position: absolute;
  102. top: 50%;
  103. width: 40px;
  104. }
  105. }
  106. .orbit-container {
  107. background: $orbit-container-bg;
  108. overflow: hidden;
  109. position: relative;
  110. width: 100%;
  111. .orbit-slides-container {
  112. list-style: none;
  113. margin: 0;
  114. padding: 0;
  115. position: relative;
  116. // Prevents images (and captions) from disappearing after first rotation on Chrome for Android
  117. -webkit-transform: translateZ(0);
  118. -moz-transform: translateZ(0);
  119. -ms-transform: translateZ(0);
  120. -o-transform: translateZ(0);
  121. transform: translateZ(0);
  122. img { display: block; max-width: 100%; }
  123. > * {
  124. position: absolute;
  125. top: 0;
  126. width: 100%;
  127. @if $text-direction == rtl {
  128. margin-right: 100%;
  129. }
  130. @else {
  131. margin-left: 100%;
  132. }
  133. &:first-child {
  134. @if $text-direction == rtl {
  135. margin-right: 0;
  136. }
  137. @else {
  138. margin-left: 0;
  139. }
  140. }
  141. .orbit-caption {
  142. @if $orbit-caption-position == "bottom" {
  143. bottom: 0;
  144. position: absolute;
  145. } @else if $orbit-caption-position == "under" {
  146. position: relative;
  147. }
  148. background-color: $orbit-caption-bg;
  149. color: $orbit-caption-font-color;
  150. font-size: $orbit-caption-font-size;
  151. padding: $orbit-caption-padding;
  152. width: 100%;
  153. }
  154. }
  155. }
  156. .orbit-slide-number {
  157. #{$default-float}: 10px;
  158. background: $orbit-slide-number-bg;
  159. color: $orbit-slide-number-font-color;
  160. font-size: 12px;
  161. position: absolute;
  162. span { font-weight: 700; padding: $orbit-slide-number-padding;}
  163. top: 10px;
  164. z-index: 10;
  165. }
  166. .orbit-timer {
  167. height: 6px;
  168. position: absolute;
  169. top: 12px;
  170. width: 100px;
  171. z-index: 10;
  172. #{$opposite-direction}: 10px;
  173. .orbit-progress {
  174. @if $orbit-timer-show-progress-bar {
  175. background-color: $orbit-timer-bg;
  176. display: block;
  177. height: 3px;
  178. position: relative;
  179. right: 20px;
  180. top: 5px;
  181. width: 0;
  182. }
  183. }
  184. // Play button
  185. & > span {
  186. border-bottom: none;
  187. border-top: none;
  188. border: solid 4px $white;
  189. display: none;
  190. height: 14px;
  191. position: absolute;
  192. top: 0;
  193. width: 11px;
  194. #{$opposite-direction}: 0;
  195. }
  196. // Pause button
  197. &.paused {
  198. & > span {
  199. border-color: transparent;
  200. border-left-color: $white;
  201. border-left-style: solid;
  202. border: inset 8px;
  203. height: 14px;
  204. top: 0;
  205. width: 11px;
  206. #{$opposite-direction}: -4px;
  207. &.dark {
  208. border-left-color: $oil;
  209. }
  210. }
  211. }
  212. }
  213. &:hover .orbit-timer > span { display: block; }
  214. // Let's get those controls to be right in the center on each side
  215. .orbit-prev,
  216. .orbit-next {
  217. background-color: $orbit-nav-bg;
  218. color: white;
  219. height: 60px;
  220. line-height: 50px;
  221. margin-top: -25px;
  222. position: absolute;
  223. text-indent: -9999px !important;
  224. top: 45%;
  225. width: 36px;
  226. z-index: 10;
  227. &:hover {
  228. background-color: $orbit-nav-bg-hover;
  229. }
  230. & > span {
  231. border: inset 10px;
  232. display: block;
  233. height: 0;
  234. margin-top: -10px;
  235. position: absolute;
  236. top: 50%;
  237. width: 0;
  238. }
  239. }
  240. .orbit-prev { #{$default-float}: 0;
  241. & > span {
  242. border-#{$opposite-direction}-style: solid;
  243. border-color: transparent;
  244. border-#{$opposite-direction}-color: $orbit-nav-arrow-color;
  245. }
  246. &:hover > span {
  247. border-#{$opposite-direction}-color: $orbit-nav-arrow-color-hover;
  248. }
  249. }
  250. .orbit-next { #{$opposite-direction}: 0;
  251. & > span {
  252. border-color: transparent;
  253. border-#{$default-float}-style: solid;
  254. border-#{$default-float}-color: $orbit-nav-arrow-color;
  255. #{$default-float}: 50%;
  256. margin-#{$default-float}: -4px;
  257. }
  258. &:hover > span {
  259. border-#{$default-float}-color: $orbit-nav-arrow-color-hover;
  260. }
  261. }
  262. }
  263. .orbit-bullets-container { text-align: center; }
  264. .orbit-bullets {
  265. display: block;
  266. float: none;
  267. margin: 0 auto 30px auto;
  268. overflow: hidden;
  269. position: relative;
  270. text-align: center;
  271. top: 10px;
  272. li {
  273. background: $orbit-bullet-nav-color;
  274. cursor: pointer;
  275. display: inline-block;
  276. // float: $default-float;
  277. float: none;
  278. height: $orbit-bullet-radius;
  279. margin-#{$opposite-direction}: 6px;
  280. width: $orbit-bullet-radius;
  281. @include radius(1000px);
  282. &.active {
  283. background: $orbit-bullet-nav-color-active;
  284. }
  285. &:last-child { margin-#{$opposite-direction}: 0; }
  286. }
  287. }
  288. .touch {
  289. .orbit-container {
  290. .orbit-prev,
  291. .orbit-next { display: none; }
  292. }
  293. .orbit-bullets { display: none; }
  294. }
  295. @media #{$medium-up} {
  296. .touch {
  297. .orbit-container {
  298. .orbit-prev,
  299. .orbit-next { display: inherit; }
  300. }
  301. .orbit-bullets { display: block; }
  302. }
  303. }
  304. @media #{$small-only} {
  305. .orbit-stack-on-small {
  306. .orbit-slides-container {height: auto !important;}
  307. .orbit-slides-container > * {
  308. margin:0 !important;
  309. opacity: 1 !important;
  310. position: relative;
  311. }
  312. .orbit-slide-number {
  313. display: none;
  314. }
  315. }
  316. @if $orbit-timer-hide-for-small {
  317. .orbit-timer{display: none;}
  318. }
  319. @if $orbit-nav-hide-for-small {
  320. .orbit-next,.orbit-prev{display: none;}
  321. }
  322. @if $orbit-bullet-hide-for-small {
  323. .orbit-bullets{display: none;}
  324. }
  325. }
  326. }
  327. }