alicestrt 4 years ago
parent
commit
210f9ee54e
  1. 4
      static/css/style.css
  2. 10
      static/js/d3_map.js
  3. 21
      static/js/group1.json

4
static/css/style.css

@ -278,3 +278,7 @@ draggable {
pointer-events: none; pointer-events: none;
font: 1em sans-serif; font: 1em sans-serif;
} }
.active {
background-color: #80ffd4;
}

10
static/js/d3_map.js

@ -27,7 +27,7 @@ d3.json("/static/js/group1.json", function(error, json) {
var node = svg.selectAll(".node") var node = svg.selectAll(".node")
.data(json.nodes) .data(json.nodes)
.enter().append("g") .enter().append("g")
.attr("class", "node") .attr("class", "node "+function(d){return d.class})
.attr("id", function(d){return d.id}) .attr("id", function(d){return d.id})
@ -97,6 +97,7 @@ d3.json("/static/js/group1.json", function(error, json) {
$("#showdadaloglu").fadeIn() $("#showdadaloglu").fadeIn()
console.log("around") console.log("around")
var dada = document.getElementById("textdadaloglu"); var dada = document.getElementById("textdadaloglu");
dada.className += " active";
dada.scrollIntoView(); dada.scrollIntoView();
var audio1 = document.getElementById("audio-1"); var audio1 = document.getElementById("audio-1");
audio1.currentTime = 12; audio1.currentTime = 12;
@ -104,9 +105,11 @@ d3.json("/static/js/group1.json", function(error, json) {
}); });
$("#muharrem").click(function(){$("#showmuharrem").fadeIn() $("#muharrem").click(function(){$("#showmuharrem").fadeIn()
console.log("around") console.log("around")
var muh = document.getElementById("textmuharrem"); var muh = document.getElementById("textmuharrem");
muh.className += " active";
muh.scrollIntoView(); muh.scrollIntoView();
var audio2 = document.getElementById("audio-1"); var audio2 = document.getElementById("audio-1");
audio2.currentTime = 50; audio2.currentTime = 50;
@ -118,11 +121,14 @@ d3.json("/static/js/group1.json", function(error, json) {
if (!$(e.target).parents().andSelf().is('#dadaloglu')) { if (!$(e.target).parents().andSelf().is('#dadaloglu')) {
$("#showdadaloglu").fadeOut(); $("#showdadaloglu").fadeOut();
$("#audiodadaloglu").trigger('pause'); $("#audiodadaloglu").trigger('pause');
var textdada = document.getElementById("textdadaloglu");
textdada.classList.remove("active");
}; };
if (!$(e.target).parents().andSelf().is('#muharrem')) { if (!$(e.target).parents().andSelf().is('#muharrem')) {
$("#showmuharrem").fadeOut(); $("#showmuharrem").fadeOut();
$("audiomuharrem").trigger('pause'); $("audiomuharrem").trigger('pause');
var textmuh = document.getElementById("textmuharrem");
textmuh.classList.remove("active");
}; };
}); });

21
static/js/group1.json

@ -1,6 +1,5 @@
{ {
"nodes": [ "nodes": [{
{
"name": "Dadaloğlu", "name": "Dadaloğlu",
"group": 1, "group": 1,
"id": "dadaloglu" "id": "dadaloglu"
@ -34,33 +33,28 @@
"name": "Aşık Veysel", "name": "Aşık Veysel",
"group": 1, "group": 1,
"id": "asikV" "id": "asikV"
} },
,
{ {
"name": "Neşet Ertaş", "name": "Neşet Ertaş",
"group": 1, "group": 1,
"id": "neset" "id": "neset"
} },
,
{ {
"name": "Muharrem Ertaş", "name": "Muharrem Ertaş",
"group": 1, "group": 1,
"id": "muharrem" "id": "muharrem"
} },
,
{ {
"name": "Ali Ekber Çiçek", "name": "Ali Ekber Çiçek",
"group": 1, "group": 1,
"id": "aliekber" "id": "aliekber"
} },
,
{ {
"name": "Dedeoğlu", "name": "Dedeoğlu",
"group": 1, "group": 1,
"id": "dedeoglu" "id": "dedeoglu"
} },
,
{ {
"name": "Pir Sultan Abdal", "name": "Pir Sultan Abdal",
"group": 1, "group": 1,
@ -99,8 +93,7 @@
"id": "haci" "id": "haci"
} }
], ],
"links": [ "links": [{
{
"source": 8, "source": 8,
"target": 0, "target": 0,
"value": 1 "value": 1

Loading…
Cancel
Save