Compare commits
2 Commits
c7876fea3f
...
5f8264cda8
Author | SHA1 | Date | |
---|---|---|---|
5f8264cda8 | |||
73149275fd |
25
index.html
25
index.html
@@ -23,7 +23,7 @@
|
|||||||
.state {
|
.state {
|
||||||
stroke: black;
|
stroke: black;
|
||||||
fill: none;
|
fill: none;
|
||||||
stroke-width: 1;
|
stroke-width: 0.5;
|
||||||
}
|
}
|
||||||
.language {
|
.language {
|
||||||
stroke: red;
|
stroke: red;
|
||||||
@@ -31,16 +31,24 @@
|
|||||||
hover events to be recognized on the inside. */
|
hover events to be recognized on the inside. */
|
||||||
fill: black;
|
fill: black;
|
||||||
fill-opacity: 0.0;
|
fill-opacity: 0.0;
|
||||||
stroke-width: 2;
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.languageText {
|
||||||
|
visibility: hidden;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size:1.25em;
|
||||||
|
}
|
||||||
|
.language:hover ~ .languageText {
|
||||||
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.district {
|
.district {
|
||||||
stroke: white;
|
stroke: white;
|
||||||
stroke-width: 0.5;
|
stroke-width: 0.25;
|
||||||
transition: fill 0.3s;
|
transition: fill 0.3s;
|
||||||
}
|
}
|
||||||
.language:hover {
|
.language:hover {
|
||||||
stroke-width: 3;
|
stroke-width: 2;
|
||||||
}
|
}
|
||||||
.districtText {
|
.districtText {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
@@ -55,12 +63,13 @@
|
|||||||
<section id="textStuff">
|
<section id="textStuff">
|
||||||
<h1>Indian Translate</h1>
|
<h1>Indian Translate</h1>
|
||||||
|
|
||||||
<label for="toTranslate">Enter text to translate:
|
<form class="translateForm" action="/submit" method="get">
|
||||||
<input type="text" name="toTranslate"/>
|
<label for="query">Enter text to translate:</label>
|
||||||
</label>
|
<input type="text" name="query" id="query" required/>
|
||||||
|
<input type="submit" value="Translate"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<svg id = "indiaMap" width="700" height="700"></svg>
|
<svg id = "indiaMap" width="1000" height="1000"></svg>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
|
12
index.js
12
index.js
@@ -259,9 +259,15 @@ function drawMap(world) {
|
|||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("font-size", "12px")
|
.attr("font-size", "12px")
|
||||||
.attr("fill", "black")
|
.attr("fill", "black")
|
||||||
.attr("class", "districtText")
|
.attr("class", "languageText")
|
||||||
.attr("id", d => d.properties.district+"Text")
|
.attr("id", d => d.properties.lang_name+"Text")
|
||||||
.text(d => d.properties.district);
|
.text(function(d) {
|
||||||
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
|
return d.properties.lang_name;
|
||||||
|
} else {
|
||||||
|
return d.properties.district;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let allLangs = []
|
let allLangs = []
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user