You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
1.9 KiB

  1. semantic.home = {};
  2. // ready event
  3. semantic.home.ready = function() {
  4. var
  5. $themeDropdown = $('.theme.dropdown'),
  6. $header = $('.masthead'),
  7. $ui = $header.find('h1 b'),
  8. $phrase = $header.find('h1 span'),
  9. $download = $header.find('.download'),
  10. $library = $header.find('.library'),
  11. $version = $header.find('.version'),
  12. handler
  13. ;
  14. handler = {
  15. endAnimation: function() {
  16. $header
  17. .addClass('stopped')
  18. ;
  19. },
  20. introduction: function() {
  21. // zoom out
  22. setTimeout(function() {
  23. $header
  24. .removeClass('zoomed')
  25. ;
  26. }, 1500);
  27. $ui.typed({
  28. replaceBaseText : true,
  29. strings : [
  30. $ui.data('text')
  31. ],
  32. showCursor : false,
  33. typeSpeed : 120,
  34. backSpeed : 120,
  35. backDelay : 500
  36. });
  37. setTimeout(function() {
  38. $library.transition('scale in', 1000);
  39. }, 6400);
  40. setTimeout(function() {
  41. $version.transition('fade', 600);
  42. }, 7000);
  43. }
  44. };
  45. $('.masthead')
  46. .visibility({
  47. onPassing : handler.introduction,
  48. onBottomPassed : handler.endAnimation
  49. })
  50. ;
  51. $themeDropdown
  52. .dropdown('setting', 'transition', 'drop')
  53. .dropdown('setting', 'duration', 350)
  54. .dropdown('setting', 'action', 'activate')
  55. ;
  56. $('.card .dimmer')
  57. .dimmer({
  58. on: 'hover'
  59. })
  60. ;
  61. window.Transifex.live.onTranslatePage(function(countryCode){
  62. var fullName = $('.language.dropdown .item[data-value=' + countryCode + ']').eq(0).text();
  63. $('.language.dropdown > .text').html(fullName);
  64. });
  65. $('.demo .ui.accordion')
  66. .accordion()
  67. ;
  68. $('.demo .ui.dropdown')
  69. .dropdown()
  70. ;
  71. $('.demo .ui.checkbox')
  72. .checkbox()
  73. ;
  74. $('.ui.sidebar')
  75. .sidebar('setting', 'transition', 'slide along')
  76. ;
  77. };
  78. // attach ready event
  79. $(document)
  80. .ready(semantic.home.ready)
  81. ;