-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
192 lines (169 loc) · 7.54 KB
/
Copy pathscript.js
File metadata and controls
192 lines (169 loc) · 7.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
mouseX = 0;
mouseY = 0;
hoverX = 0;
hoverY = 0;
hoveredButton = null;
$(document).ready(function() {
useTallestQuoteHeight();
loopQuotes();
populateFAQ();
$(".section.contact textarea").attr("rows", 1);
textarea = document.querySelector(".section.contact textarea");
textarea.addEventListener('input', resizeTextarea, false);
resizeTextarea();
});
$(window).resize(function() {
useTallestQuoteHeight();
sizeFAQs();
resizeTextarea();
$(".section.navbar").removeClass("open");
});
//QUOTE SLIDER CONTENT
const quotes = [
{
quote: "The meaning of life is to give life meaning.",
attribution: "Viktor E. Frankl",
},
{
quote: "What lies behind us and what lies before us are tiny matters compared to what lies within us.",
attribution: "Ralph Waldo Emerson",
},
{
quote: "I am not what happened to me, I am what I choose to become.",
attribution: "CG Jung",
},
{
quote: "You miss 100% of the shots you don’t take.",
attribution: "Wayne Gretzky",
},
];
//FAQ QUESTIONS
const faq = [
{
question: "What kinds of issues do you help with?",
answer: "We are able to focus on a multitude of challenges, from anxiety to depression, self-esteem issues or family conflict, as well as life transitions and career stressors. We want to be able to guide and support you through these moments and take your potential higher. We also specialize in performance improvement, either on the athletic field or in strategizing your next career move, as well as spirituality endeavors that create a visionary path for you.",
},
{
question: "What can I expect in counseling-therapy?",
answer: "While counseling looks different for everyone, we want to bring out the gifts within you. It is together we identify the strengths you already possess and discover any blocks that may be holding you back. We will align toward setting your personal goals and create workable techniques for your everyday life to cope and create new habits that you can practice over a lifetime.",
},
{
question: "What methods do you use in practice?",
answer: "We ascribe to solution-focused, evidence-based methods and use mindfulness-based practices. We look at challenges through a trauma-informed lens and realize that we all come with a set of values and behavior patterns that have worked for us so far. We use meditation, guided practice, and relaxation techniques as well as acceptance and commitment therapy (ACT) to guide and inform our daily lives toward betterment.",
},
{
question: "How long will therapy take for me?",
answer: "We value an individualized approach, so each session is different yet guided toward your goals. We will discuss progress at each of our sessions but generally speaking, our approach is brief and solution-focused. In the words of Stephen Covey, we ‘begin with the end in mind,’ that being a better you -- mentally, physically, spiritually.",
},
{
question: "How long will we spend together in session?",
answer: "Our first session will be approximately 90 minutes where we will gather an overview of your goals and what you’d hope to work on in therapy. We won’t go ’too deep here’ but only scratch the surface to gather the big picture. Please bring your client intake forms signed to this appointment and/or email back to us in advance at hello@nolimitscounseling.com. Beyond that, subsequent appointments will be 45-minutes in length. These can take place either in-person, or over zoom, or we can meet at varied locations within the community. It is our hope and intention that therapy can fit into your ‘daily day’ whether that means a quick lunch-break check-in, a walk in the park, a hike to clear the mind, or a favorite coffee shop. We are here to help, and meet you where you’re at.",
},
];
currentQuote = 0;
quoteHeights = [];
//POPULATE QUOTES
quotes.forEach(function(quote, quoteIndex) {
$(".quotes-wrapper").append(`
<div class="quote-group">
<span class="quote f-header-2">${quotes[quoteIndex].quote}</span>
<span class="attribution f-header-4">${quotes[quoteIndex].attribution}</span>
</div>
`);
});
//SIZE QUOTES SECTION TO TALLEST QUOTE
function useTallestQuoteHeight() {
quoteHeights = [];
$(".quote-group").each(function(index) {
quoteHeights.push($(this).outerHeight());
});
$(".quotes-wrapper").css("height", `${Math.max(...quoteHeights)}`)
}
//LOOP THROUGH AVAILABLE QUOTES
function loopQuotes() {
$(".quote-group").each(function(index) {
$(this).css("opacity", `${index === currentQuote ? "1" : "0"}`);
});
setTimeout(function() {
if (currentQuote < quotes.length - 1) {
currentQuote +=1;
} else {
currentQuote = 0;
}
$(".quote-group").each(function(index) {
$(this).css({opacity: `${index === currentQuote ? "1" : "0"}`, transitionDelay: `${index === currentQuote ? "1s" : "0s"}`});
});
loopQuotes();
}, 6000);
}
//POPULATE FAQ QUESTIONS
function populateFAQ() {
faq.forEach(function(question, questionIndex) {
$(".section.faq .questions").append(`
<div class="group ${questionIndex === 0 ? "open" : ""}">
<div class="top-bar">
<span class="question f-header-3">${faq[questionIndex].question}</span>
<div class="button"></div>
</div>
<div class="answer f-body-1">${faq[questionIndex].answer}</div>
</div>
`);
});
sizeFAQs();
};
//KEEP ACCORDION SIZING ACCURATE
function sizeFAQs() {
$(".section.faq .group").each(function(index) {
const closedHeight = $(this).children(".top-bar").outerHeight();
const openHeight = $(this).children(".top-bar").outerHeight() + $(this).children(".answer").outerHeight();
$(this).css({height: `${$(this).hasClass("open") ? openHeight : closedHeight}`})
});
}
//TOGGLE FAQ "OPEN" STATE
$(document).on("click", ".section.faq .group", function() {
if ($(this).hasClass("open")) {
$(this).removeClass("open");
} else {
$(".section.faq .group").removeClass("open");
$(this).addClass("open");
}
sizeFAQs();
});
//EXPAND "MESSAGE" TEXTAREA TO ACCOMMODATE ALL TEXT WHENEVER TEXTAREA VALUE CHANGES
function resizeTextarea() {
textarea.style.height = "auto";
textarea.style.height = (textarea.scrollHeight) + "px";
}
//TRACK WHICH BUTTON IS BEING HOVERED
$(document).on("mousemove", function(e) {
if (hoveredButton !== null) {
mouseX = e.pageX;
mouseY = e.pageY;
hoverX = mouseX - hoveredButton.offset().left;
hoverY = mouseY - hoveredButton.offset().top;
hoveredButton.children(".glow-hover").css({
left: `${hoverX}px`,
top: `${hoverY}px`,
});
}
});
//GIVE EACH BUTTON A HOVER EFFECT CHILD
$(".glowing").each(function(index) {
$(this).append(`<div class="glow-hover"></div`);
})
//SET THE BUTTON BEING HOVERED
$(".glowing").hover(function() {
hoveredButton = $(this);
}, function() {
hoveredButton = null;
});
//OPEN AND CLOSE NAV MOBILE MENU
$(document).on("click", ".hamburger", function() {
$(".section.navbar").toggleClass("open");
});
$(document).on("click", ".section.navbar .links .link", function() {
$(".section.navbar").removeClass("open");
});
$(document).on("click", ".section.navbar .links .button", function() {
$(".section.navbar").removeClass("open");
});