1
- < << << << HEAD
2
- var visited = false
3
- window . onscroll = function ( ) {
4
- const institute_name = document . getElementsByClassName ( 'institute_name' )
5
- const full_navbar = document . getElementsByTagName ( 'header' )
6
- const logo = document . getElementById ( 'logo_250' )
7
- const topbar = document . getElementById ( 'top_bar' )
8
- const diff_lang = document . getElementsByClassName ( 'mySlides' )
9
- if ( window . scrollY > 100 ) {
10
- topbar . style . transform = 'translateY(-50px)'
11
- for ( let i = 0 ; i < diff_lang . length ; i ++ ) {
12
- diff_lang [ i ] . classList . remove ( 'mt-7' )
13
- }
14
- for ( let i = 0 ; i < institute_name . length ; i ++ ) {
15
- logo . style . width = '90px'
16
- logo . style . height = '90px'
17
- logo . classList . remove ( 'top-8' )
18
- logo . classList . add ( 'top-0' )
19
- if ( institute_name [ i ] . classList . contains ( 'text-xl' ) ) {
20
- institute_name [ i ] . classList . remove ( 'text-xl' )
21
- institute_name [ i ] . classList . add ( 'text-lg' )
22
- } else if ( institute_name [ i ] . classList . contains ( 'text-lg' ) ) {
23
- institute_name [ i ] . classList . remove ( 'text-lg' )
24
- institute_name [ i ] . classList . add ( 'text-sm' )
25
- }
26
- }
27
- } else {
28
- logo . style . width = '120px'
29
- logo . style . height = '120px'
30
- topbar . style . transform = 'translateY(0)'
31
- for ( let i = 0 ; i < diff_lang . length ; i ++ ) {
32
- diff_lang [ i ] . classList . add ( 'mt-7' )
33
- }
34
- logo . classList . remove ( 'top-0' )
35
- logo . classList . add ( 'top-8' )
36
- for ( var i = 0 ; i < institute_name . length ; i ++ ) {
37
- // console.log(institute_name[i].classList);
38
- if ( institute_name [ i ] . classList . contains ( 'text-lg' ) ) {
39
- institute_name [ i ] . classList . remove ( 'text-lg' )
40
- institute_name [ i ] . classList . add ( 'text-xl' )
41
- } else if ( institute_name [ i ] . classList . contains ( 'text-sm' ) ) {
42
- institute_name [ i ] . classList . remove ( 'text-sm' )
43
- institute_name [ i ] . classList . add ( 'text-lg' )
44
- }
45
- }
46
- }
47
- }
48
-
49
- function openDropdown ( ) {
50
- var dropdown = document . getElementById ( 'dropdown' )
51
- if ( dropdown . classList . contains ( 'hidden' ) ) {
52
- dropdown . classList . remove ( 'hidden' )
53
- } else {
54
- dropdown . classList . add ( 'hidden' )
55
- }
56
- }
57
-
58
- function showSearchPage ( event ) {
59
- if ( event . target . id == 'search_form' ) {
60
- return
61
- }
62
- var search_page = document . getElementById ( 'search_page' )
63
- if ( search_page . classList . contains ( 'hidden' ) ) {
64
- search_page . classList . remove ( 'hidden' )
65
- search_page . classList . add ( 'grid' )
66
- } else {
67
- search_page . classList . remove ( 'grid' )
68
- search_page . classList . add ( 'hidden' )
69
- }
70
- }
71
-
72
- function isInViewPort ( element ) {
73
- var bounding = element . getBoundingClientRect ( )
74
- if (
75
- bounding . top >= 0 &&
76
- bounding . left >= 0 &&
77
- bounding . right <=
78
- ( window . innerWidth || document . documentElement . clientWidth ) &&
79
- bounding . bottom <=
80
- ( window . innerHeight || document . documentElement . clientHeight )
81
- ) {
82
- console . log ( 'In the viewport! :)' )
83
- return true
84
- } else {
85
- console . log ( 'Not in the viewport. :(' )
86
- return false
87
- }
88
- }
89
- function animateValue ( obj , start , end , duration , index ) {
90
- if ( isInViewPort ( obj ) ) {
91
- let startTimestamp = null
92
- const step = ( timestamp ) => {
93
- if ( ! startTimestamp ) startTimestamp = timestamp
94
- const progress = Math . min ( ( timestamp - startTimestamp ) / duration , 1 )
95
- if ( index == 0 || index == 1 ) {
96
- obj . innerHTML = Math . floor ( progress * ( end - start ) + start ) + '+'
97
- } else {
98
- obj . innerHTML = Math . floor ( progress * ( end - start ) + start )
99
- }
100
- if ( progress < 1 ) {
101
- window . requestAnimationFrame ( step )
102
- }
103
- }
104
- window . requestAnimationFrame ( step )
105
- }
106
- }
107
-
108
- function animateValueIntiator ( ) {
109
- var rolling_nums = document . getElementById ( 'rolling_nums' ) . children
110
- visited = true
111
- for ( var i = 0 ; i < rolling_nums . length ; i ++ ) {
112
- obj = rolling_nums [ i ]
113
- animateValue ( obj , 0 , parseInt ( obj . innerHTML ) , 3000 , i )
114
- }
115
- }
116
-
117
- // Parallex Effect
118
-
119
- // const numbers = document.getElementById('numbers')
120
-
121
- // window.addEventListener('scroll', () => {
122
- // let offset = scrollY
123
- // const viewport = window.outerHeight
124
- // console.log('running')
125
- // if (offset >= numbers.offsetTop - viewport) {
126
- // console.log('touched')
127
- // numbers.style.backgroundPositionY =
128
- // -(numbers.offsetTop - offset) * 0.8 + 'px'
129
- // }
130
- // })
131
- let home = 0
132
- window . onload = function ( ) {
133
- showHome ( )
134
- }
135
- function showHome ( ) {
136
- let i
137
- let homeslider = document . getElementsByClassName ( 'homeslide' )
138
- for ( i = 0 ; i < homeslider . length ; i ++ ) {
139
- homeslider [ i ] . style . display = 'none'
140
- }
141
- home ++
142
- if ( home > homeslider . length ) {
143
- home = 1
144
- }
145
- homeslider [ home - 1 ] . style . display = 'block'
146
- setTimeout ( showHome , 3000 ) // Change image every 3 seconds
147
- }
148
- === = ===
149
1
window . onscroll = function ( ) {
150
2
const institute_name = document . getElementsByClassName ( 'institute_name' )
151
3
const full_navbar = document . getElementsByTagName ( 'header' )
@@ -480,5 +332,4 @@ window.onscroll = function () {
480
332
if ( sideMenu . style . display == "block" && z == 0 ) {
481
333
sideMenu . setAttribute ( "style" , "display:none;" ) ;
482
334
}
483
- }
484
- >>> > >>> e259f77c7eff1738cf6d00dabee248aebca00e7a
335
+ }
0 commit comments