-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.js
112 lines (109 loc) · 7.97 KB
/
javascript.js
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
var text = TAFFY([
{"quote":"Healthcare<br>Not<br>Wealthcare","source":"","tags": ["taxes","premiums"]},
{"quote":"Healthcare is a<br>Human Right","source":"","tags": ["premiums","existing","lgbtq","coverage"]},
{"quote":"I am not a<br>pre-existing condition!","source":"","tags": ["existing"]},
{"quote":"I stand with<br>Planned Parenthood", "source": "", "tags":["ppact"]},
{"quote":"No Hearings?<br>No Vote!<br>Show us the bill!", "source": "", "tags":["secrecy"]},
{"quote":"Don't take away<br>my birth control", "source": "", "tags":["ppact","existing"]},
{"quote":"Call your senators!<br>Tell them to #witholdconsent!", "source": "https://www.indivisibleguide.com/resource/withholding-consent-filibuster-amendment-call-script/", "tags":["secrecy"]},
{"quote":"Washington's average premium increase in 2018 under TrumpCare:<br>$571", "source": "https://www.indivisibleguide.com/resource/impact-of-trumpcare-by-state/#WA", "tags":["premiums"]},
{"quote":"Washington's Total Health Insurance Coverage Losses under TrumpCare:<br>344,300", "source": "https://www.indivisibleguide.com/resource/impact-of-trumpcare-by-state/#WA", "tags":["coverage"]},
{"quote":"Washington's Medicaid Coverage Losses under TrumpCare:<br>244,900", "source": "https://www.indivisibleguide.com/resource/impact-of-trumpcare-by-state/#WA", "tags":["coverage", "medicaid"]},
{"quote":"Washington's Employer Sponsored Coverage Losses under TrumpCare:<br>69,900", "source": "https://www.indivisibleguide.com/resource/impact-of-trumpcare-by-state/#WA", "tags":["coverage"]},
{"quote":"Washington's Individual Market Coverage Losses Under TrumpCare:<br>29,300", "source": "https://www.indivisibleguide.com/resource/impact-of-trumpcare-by-state/#WA", "tags":["coverage"]},
{"quote":"130 million Americans have a pre-existing condition", "source": "https://www.indivisibleguide.com/resource/10-worst-things-trumpcare/", "tags":["existing"]},
{"quote":"Half of the Americans on Medicaid are Children.<br>Don't cut their care!", "source": "https://www.indivisibleguide.com/resource/10-worst-things-trumpcare/", "tags":["medicaid"]},
{"quote":"13 Republican Men are Deciding Our Healthcare.<br>That's not democracy!", "source": "https://www.nytimes.com/2017/05/08/us/politics/women-health-care-senate.html", "tags":["secrecy"]},
{"quote":"ACA Senate debate: 60 hours<br><br>ACA Senate Repeal Debate: 0", "source": "http://www.snopes.com/aca-versus-ahca/", "tags":["secrecy"]},
{"quote":"24,000 Veterans in Washington could lose medicaid coverage under the AHCA", "source": "http://www.rpecwa.org/wp-content/uploads/2017/03/ACHA-infographic.jpg", "tags":["veterans","medicaid"]},
{"quote":"The AHCA eliminates $90 million in funding for WA's elderly and disabled.", "source": "https://www.insurance.wa.gov/sites/default/files/documents/Inslee-Kreidler-ltr-to-Delegation-re-AHCA-Murray.pdf", "tags":["medicaid"]},
{"quote":"The ACA brought 51,000 new jobs to Washington.<br>How many will TrumpCare destroy?", "source": "https://www.insurance.wa.gov/sites/default/files/documents/Inslee-Kreidler-ltr-to-Delegation-re-AHCA-Murray.pdf", "tags":["secrecy"]},
{"quote":"29% of Clark County Residents are insured through ACA supported programs", "source": "https://www.1in4wa.com/", "tags":["coverage"]},
{"quote": "Clark County residents get an average of $325 a month in federal subsidies for health care coverege thanks to the ACA", "source": "https://www.1in4wa.com/", "tags": ["coverage","premiums"]},
{"quote": "37,665<br>Clark County residents have insurance thanks to the medicaid expansion", "source": "https://www.1in4wa.com/", "tags": ["coverage","medicaid"]},
{"quote": "4,300<br>Clark County Residents are served by Planned Parenthood each year.", "source": "http://www.columbian.com/news/2017/jun/18/planned-parenthood-defunding-could-leave-health-care-gap-in-county/", "tags": ["ppact"]},
{"quote": "My healthcare shouldn't be decided in secret", "source": "", "tags": ["secrecy"]}
// {"quote": "", "source": "", "tags": [""]}
]);
var images = TAFFY([
{"imglink":"backgrounds/lgbtq.jpg", "tags": ["lgbtq"]},
{"imglink":"backgrounds/ppact.png", "tags": ["ppact"]},
{"imglink":"backgrounds/veterans105.jpg", "tags": ["veterans"]},
{"imglink":"backgrounds/Medicaid-Health_720.jpg", "tags": ["medicaid","coverage","existing"]},
{"imglink":"backgrounds/money.jpg", "tags": ["premiums","taxes"]},
{"imglink":"backgrounds/bloodviscosity.jpg", "tags": ["existing"]},
{"imglink":"backgrounds/brain-cogs.jpg", "tags": ["mental"]},
{"imglink":"backgrounds/closed-door.jpg", "tags": ["secrecy"]},
{"imglink":"backgrounds/comfort.jpg", "tags": ["mental"]},
{"imglink":"backgrounds/conferenceroom.jpg", "tags": ["secrecy"]},
{"imglink":"backgrounds/dna1.jpg", "tags": ["existing"]},
{"imglink":"backgrounds/dollar-signs.jpg", "tags": ["premiums","taxes"]},
{"imglink":"backgrounds/filefolders.jpg", "tags": ["generic"]},
{"imglink":"backgrounds/greed.jpg", "tags": ["taxes"]},
{"imglink":"backgrounds/heartbeat.jpg", "tags": ["existing"]},
{"imglink":"backgrounds/light-blue-background-1.jpg", "tags": ["generic"]},
{"imglink":"backgrounds/mcconnell.jpg", "tags": ["secrecy"]},
{"imglink":"backgrounds/medical-grey.gif", "tags": ["generic"]},
{"imglink":"backgrounds/pills-green.jpg", "tags": ["coverage","existing","medicaid"]},
{"imglink":"backgrounds/planned-parenthood-pills.jpg", "tags": ["ppact"]},
{"imglink":"backgrounds/plannedparenthoodbuilding.jpg", "tags": ["ppact"]},
{"imglink":"backgrounds/prideflag.jpg", "tags": ["lgbtq"]},
{"imglink":"backgrounds/protest-fists.jpg", "tags": ["generic"]},
{"imglink":"backgrounds/protest-fists2.jpg", "tags": ["generic"]},
{"imglink":"backgrounds/protesters.jpg", "tags": ["generic"]},
{"imglink":"backgrounds/sadface.jpg", "tags": ["mental"]},
{"imglink":"backgrounds/scope-heart.jpg", "tags": ["existing"]},
{"imglink":"backgrounds/secrecy.jpg", "tags": ["secrecy"]},
{"imglink":"backgrounds/senatefloor.jpg", "tags": ["secrecy"]},
{"imglink":"backgrounds/strong-brain.jpg", "tags": ["mental"]},
{"imglink":"backgrounds/ultrasound.jpg", "tags": ["ppact","existing"]}
// {"imglink":"backgrounds/", "tags": [""]},
]);
function newSign(tag) {
var quotes = text().get();
var imgs = images().get();
var tagQuotes = [];
for (var i = quotes.length - 1; i >= 0; i--) {
quote = quotes[i];
tags = quote["tags"];
for (var x = tags.length - 1; x >= 0; x--) {
var match = {};
if (tags[x] == tag){
match["quote"] = quote["quote"];
match["src"] = quote["source"];
tagQuotes.push(match);
}
}
}
var tagImgs = [];
for (var i = imgs.length - 1; i >= 0; i--) {
img = imgs[i];
tags = img["tags"];
for (var x = tags.length - 1; x >= 0; x--) {
if (tags[x] == tag || tags[x] == "generic"){
tagImgs.push(img["imglink"]);
}
}
}
var colors = ["lightgrey", "black", "grey", "white"]
var randomQuote = Math.floor(Math.random() * (tagQuotes.length));
var randomImg = Math.floor(Math.random() * (tagImgs.length));
var randomColor = Math.floor(Math.random() * (colors.length));
if (tagQuotes.length > 0) {
document.getElementById('signText').innerHTML = tagQuotes[randomQuote]["quote"];
document.getElementById('signText').style.color = colors[randomColor];
document.getElementById('signLink').innerHTML = tagQuotes[randomQuote]["src"];
document.getElementById('signLink').href = tagQuotes[randomQuote]["src"];
document.getElementById('signLink').style.color = colors[randomColor];
document.getElementById('signDisplay').style.backgroundImage = "url('" + tagImgs[randomImg] + "')";
document.getElementById('thumbText').innerHTML = tagQuotes[randomQuote]["quote"];
document.getElementById('thumbText').style.color = colors[randomColor];
document.getElementById('thumbLink').innerHTML = tagQuotes[randomQuote]["src"];
document.getElementById('thumbLink').href = tagQuotes[randomQuote]["src"];
document.getElementById('thumbLink').style.color = colors[randomColor];
document.getElementById('signThumb').style.backgroundImage = "url('" + tagImgs[randomImg] + "')";
}
else {
alert("We've got nothing. Choose another topic.");
}
}