-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2032d09
Showing
10 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "simonhamp/the-og", | ||
"description": "OpenGraph Image Generator for PHP", | ||
"type": "library", | ||
"require": { | ||
"intervention/image": "^3.1" | ||
}, | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"SimonHamp\\TheOg\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Simon Hamp", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace SimonHamp\TheOg; | ||
|
||
enum Background: string | ||
{ | ||
case Bananas = 'bananas.webp'; | ||
case CloudyDay = 'cloud-day.png'; | ||
case JustWaves = 'just-waves.webp'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace SimonHamp\TheOg; | ||
|
||
enum ColorScheme: string | ||
{ | ||
case Light = 'light'; | ||
case Dark = 'dark'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace SimonHamp\TheOg; | ||
|
||
class Image | ||
{ | ||
protected string $url; | ||
protected string $title; | ||
protected string $description; | ||
protected Theme $theme; | ||
protected ColorScheme $colorScheme; | ||
protected string $accentColor; | ||
protected Background $background; | ||
protected string $callToAction; | ||
|
||
public function url(string $url): self | ||
{ | ||
$this->url = $url; | ||
return $this; | ||
} | ||
|
||
public function title(string $title): self | ||
{ | ||
$this->title = $title; | ||
return $this; | ||
} | ||
|
||
public function description(string $description): self | ||
{ | ||
$this->description = $description; | ||
return $this; | ||
} | ||
|
||
public function theme(Theme $theme): self | ||
{ | ||
$this->theme = $theme; | ||
return $this; | ||
} | ||
|
||
public function colorScheme(ColorScheme $colorScheme): self | ||
{ | ||
$this->colorScheme = $colorScheme; | ||
return $this; | ||
} | ||
|
||
public function accentColor(string $hexCode): self | ||
{ | ||
$this->accentColor = $hexCode; | ||
return $this; | ||
} | ||
|
||
public function background(Background $background): self | ||
{ | ||
$this->background = $background; | ||
return $this; | ||
} | ||
|
||
public function callToAction(string $content): self | ||
{ | ||
$this->callToAction = $content; | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace SimonHamp\TheOg; | ||
|
||
enum Theme: string | ||
{ | ||
case Standard = 'standard'; | ||
case Bold = 'bold'; | ||
case Split = 'split'; | ||
} |