Skip to content

Commit

Permalink
Stop retrieving icon from duckduckgo on home page, retrieve them from…
Browse files Browse the repository at this point in the history
… frontend server

As the user didn't consent to this external call, it's better to avoid doing them
  • Loading branch information
SeaweedbrainCY committed Jun 8, 2024
1 parent 7ead707 commit 1b84ade
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 class="is-size-1 has-text-centered has-text-weight-bold mt-6 has-text-dark m
<div class="column is-one-third-fullhd is-one-third-widescreen is-one-third-desktop is-two-thirds-tablet is-two-thirds-mobile is-flex is-flex-direction-column is-justify-content-center">
<div class="card has-background-{{example_color}} has-text-white">
<header class="card-header">
<p class="card-header-title has-text-white"><img src="https://icons.duckduckgo.com/ip3/{{example_domain}}.ico" alt="{{example_domain}} logo" width="25px" height="25px" style="margin-right: 6px;">
<p class="card-header-title has-text-white"><img src="assets/example-icons/{{example_ico}}" alt="{{example_domain}} logo" width="25px" height="25px" style="margin-right: 6px;">
{{example_title}}</p>
<button class="card-header-icon" aria-label="edit">
<span class="icon">
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class HomeComponent implements OnInit {
example_title=""
remainingTime=0;
example_color=""
example_ico=""
last_random_i = 0;
current_color_index = 0;

Expand All @@ -64,6 +65,7 @@ export class HomeComponent implements OnInit {
}

generateExample(){
const icos = ["facebook.ico", "github.ico", "google.ico", "apple.ico", "google.ico", "amazon.ico", "aws.ico", "microsoft.ico", "onedrive.ico", "gitlab.ico"]
const domains = ["facebook.com", "github.com", "google.com", "apple.com", "google.com", "amazon.com", "aws.com", "microsoft.com", "onedrive.com", "gitlab.com"]
const titles = ["Facebook", "Github", "Gmail", "Apple", "Google", "Amazon", "AWS", "Microsoft", "OneDrive", "Gitlab"]
const colors = [ "info", "success", "danger"]
Expand All @@ -75,6 +77,7 @@ export class HomeComponent implements OnInit {
this.example_domain = domains[random_i];
this.example_title = titles[random_i];
this.example_code = (Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000).toString();
this.example_ico = icos[random_i];
this.current_color_index = (this.current_color_index+1)%colors.length;
this.example_color = colors[this.current_color_index];
}
Expand Down
Binary file added frontend/src/assets/example-icons/amazon.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/apple.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/aws.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/facebook.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/github.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/gitlab.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/google.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/microsoft.ico
Binary file not shown.
Binary file added frontend/src/assets/example-icons/onedrive.ico
Binary file not shown.

0 comments on commit 1b84ade

Please sign in to comment.