Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Google Translate Dropdown #215

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1149,3 +1149,5 @@ a:focus {
flex-direction: row;
}
}


4 changes: 4 additions & 0 deletions src/css/style.min.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/data/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
"name": "Karthikeya"
},
{
"name" : "Veda Varshit"
"name": "Veda Varshit"
},
{
"name": "Veekshitha Nelluru"
Expand All @@ -300,6 +300,9 @@
{
"name": "Siddhant Prasad"
},
{
"name": "Tanchuoi"
},
{
"name": "Maram Shanmukha Siva Sekhar Yeswanth"
},
Expand Down
22 changes: 22 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<meta name="twitter:image" content="/img/logo.webp" />
<meta name="twitter:image:alt" content="Hacktoberfest Logo" />


<!-- Google Translate -->
<script type="text/javascript"
src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-G6EQC4D6KY"></script>
<script>
Expand Down Expand Up @@ -80,11 +86,27 @@
</button>

<nav id="headerControls" class="header-controls">

<button id="surpriseButton" class="contact-btn" aria-label="Contact">
<a href="tos.html">ToS</a>
</button>
<button id="aboutUsButton" class="about-us-btn" aria-label="About Us">
<a href="#about-us-section">About Us</a>
</button>
<button id="surpriseButton" class="surprise-btn" aria-label="Surprise Me!">
Surprise Me!
</button>
<button id="surpriseButton" class="contact-btn" aria-label="Contact">
<a href="form.html">Contact</a>
</button>
<div id="google_translate_element"></div>

<button class="contact-btn" aria-label="ToS" onclick="window.location.href='tos.html';">ToS</button>
<button class="about-us-btn" aria-label="About Us" onclick="window.location.href='#about-us-section';">About
Us</button>
<button class="surprise-btn" aria-label="Surprise Me!">Surprise Me!</button>
<button class="contact-btn" aria-label="Contact" onclick="window.location.href='form.html';">Contact</button>

<button id="toggleButton" class="toggle-btn" aria-label="Toggle theme"></button>
</nav>

Expand Down
6 changes: 6 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,9 @@ document.addEventListener('DOMContentLoaded', function() {
headerControls.classList.toggle('show');
});
});


// Google Translate
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
2 changes: 1 addition & 1 deletion src/js/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.