Skip to content

Commit

Permalink
Merge branch 'main' into feature-generate-user-id
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlaLeal committed Mar 18, 2022
2 parents 6b86dd5 + a441682 commit 34157a7
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 11 deletions.
56 changes: 52 additions & 4 deletions chromeExtension/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,64 @@ button {
box-shadow: 0px 8px 15px rgba(0,0, 0, 0.1);
transition: all 0.3s ease 0s;
cursor: pointer;

}

button:hover{
background-color: #f7fff7;
box-shadow: 0px 15px 20px rgba(0,0, 0, 0.1);
transform: translateY(-2px);
}

.flex-container{
display: flex;
justify-content: center;
margin-bottom: 40px;
}
.flex-container:first-child{
flex: 1;
order: 1;
}

.flex-container:nth-child(2){
flex:1;
order: 2;
margin: 20px;
}

input[type=button]{
display: block;
height: 22px;
width: 70px;
outline: none;
margin-left: 20px;
border: none;
border-radius: 5px;
text-align: center;
justify-content: center;
background-color:#4ecdc4;;
box-shadow: 0px 8px 15px rgba(0,0, 0, 0.1);
transition: all 0.3s ease 0s;
cursor: pointer;
}
input[type=button]:hover{
background-color:#f7fff7;
box-shadow: 0px 15px 20px rgba(0,0, 0, 0.1);
transform: translateY(-2px);
}

.gap{
margin-bottom: 100px;
}
margin-bottom: 70px;
}

input[type=text] {
padding: 100;
height: 20px;
position: relative;
left: 0;
outline: none;
border: 1px solid #cdcdcd;
border-color: rgba(0, 0, 0, .15);
background-color: white;
box-shadow: 0px 8px 15px rgba(0,0, 0, 0.1);
font-size: 14px;
border-radius: 5px;
}
16 changes: 12 additions & 4 deletions chromeExtension/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ <h1>Who Funds Your Feed</h1>
</head>

<body>
<div id="email">
<p>Please enter your e-mail to enable sponsorship detection:</p>
<div class="flex-container">
<div class="flex-child textBox">
<input type="text" id="userEmail" placeholder=" [email protected] " name="inputText" value="" />
</div>
<div class="flex-child submitButton">
<input type="button" id="submit" value="Submit" />
</div>
</div>
</div>

<h2>Click to see your personalized insights!</h2>
<button class="button" id="index_link">View Insights</button>
<p class="gap"></p>
<div id="email">
Enter e-mail: <input type="text" id="userEmail" name="inputText" value="" />
<input type ="submit" id="submit" value="Submit" />
</div>
<h2>About WFYF</h2>
<p>This chrome extension will identify sponsored content on YouTube in order to provide awareness around the largest funders of your content consumption and their respective biases</p>
<script src="popup.js"></script>
Expand Down
1 change: 1 addition & 0 deletions chromeExtension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ function openIndex() {
url = userId ? baseUrl + userId : baseUrl;
chrome.tabs.create({ active: true, url: url });
}

Binary file added frontend/src/assets/DemoToDownload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 21 additions & 3 deletions frontend/src/components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@

<div v-if="!loading">
<h2>Share Your Results</h2>
<ion-icon name="logo-instagram" style="font-size: 35px"></ion-icon>
<ion-icon name="logo-facebook" style="font-size: 35px"></ion-icon>
<ion-icon name="download-outline" style="font-size: 35px"></ion-icon>
<ion-icon
name="logo-instagram"
style="font-size: 35px; fill: grey"
></ion-icon>
<ion-icon
name="logo-facebook"
style="font-size: 35px; fill: grey"
></ion-icon>
<ion-icon
name="download-outline"
style="font-size: 35px"
@click="download()"
></ion-icon>
</div>
</div>
</template>
Expand All @@ -53,6 +63,7 @@ import HipTips from "./TipsCarousel/HipTips.vue";
import axios from "axios";
import DoubleBounce from "./loader.vue";
import SampleData from "../../../endpointLambdas/reportAnalytics/SampleOutput.json";
import img from "../assets/DemoToDownload.png";
export default {
async mounted() {
Expand Down Expand Up @@ -105,6 +116,13 @@ export default {
behavior: "smooth",
});
},
download() {
console.log(img);
var a = document.createElement("a");
a.href = img;
a.download = "MainFunder.png";
a.click();
},
},
};
</script>
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/components/MainFunderCards/LeftMainFunderStat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
style="max-width: 30vw; max-height: 30vw"
id="VideoSponsoredbyFunder"
></canvas>
<a id="toSave" v-show="false"></a>
<ion-icon
name="download-outline"
style="
font-size: 35px;
position: absolute;
left: 45vw;
top: 80vh;
cursor: pointer;
"
@click="downloadMainFunder()"
></ion-icon>
</div>
<div class="arrow-left">
<img
Expand Down Expand Up @@ -56,13 +68,21 @@ export default {
},
options: {
responsive: true,
animation: {
onComplete: function (animation) {
var a = document.getElementById("toSave");
a.setAttribute("download", "timeSponsoredByMainFunder.png");
a.setAttribute("href", this.toBase64Image());
},
},
},
};
},
data() {
return {
chartData: null,
href: null,
};
},
computed: {},
Expand All @@ -72,6 +92,12 @@ export default {
new Chart(ctx, this.chartData);
},
},
methods: {
downloadMainFunder() {
var a = document.getElementById("toSave");
a.click();
},
},
};
</script>

Expand Down

0 comments on commit 34157a7

Please sign in to comment.