_orbit.scss 9.2 KB

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