Skip to content

Commit

Permalink
feat: Google Translate Dropdown (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyJolli authored Nov 1, 2024
2 parents 5d841e2 + 9873ec4 commit 7b94167
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
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.

0 comments on commit 7b94167

Please sign in to comment.