-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: try a fist adsense implementation
- Loading branch information
Showing
11 changed files
with
152 additions
and
6 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
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
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,14 @@ | ||
{{#if this.mockAd}} | ||
{{!-- template-lint-disable no-inline-styles --}} | ||
{{!-- template-lint-disable style-concatenation --}} | ||
{{!-- template-lint-disable no-bare-strings --}} | ||
<div style="width: {{@width}}; height: {{@height}}; background: lightblue;">SOME ADD HERE</div> | ||
{{else}} | ||
<amp-ad | ||
width={{@width}} | ||
height={{@height}} | ||
...attributes | ||
> | ||
<div overflow=""></div> | ||
</amp-ad> | ||
{{/if}} |
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,11 @@ | ||
import Component from '@glimmer/component'; | ||
import config from 'text2stl/config/environment'; | ||
const { environment } = config; | ||
|
||
interface AmpAdArgs {} | ||
|
||
export default class LangSwitcher extends Component<AmpAdArgs> { | ||
get mockAd() { | ||
return ['development', 'test'].includes(environment); | ||
} | ||
} |
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,44 @@ | ||
<calcite-modal | ||
aria-labelledby="modal-title" | ||
resize="vertical" | ||
open | ||
{{on "calciteModalClose" @onHide}} | ||
> | ||
<div slot="header" id="modal-title"> | ||
{{t 'download_modal.title'}} | ||
</div> | ||
<div slot="content"> | ||
<AmpAd | ||
@width="100vw" | ||
@height="320" | ||
type="adsense" | ||
data-ad-client="ca-pub-3813838413338800" | ||
data-ad-slot="7911231338" | ||
data-auto-format="rspv" | ||
data-full-width="" | ||
/> | ||
{{#if this.canDownload}} | ||
<calcite-notice open icon="layers-reference" kind="success"> | ||
<div slot="title">{{t "download_modal.ready.title"}}</div> | ||
<div slot="message">{{t "download_modal.ready.message"}}</div> | ||
<calcite-link {{on "click" @downloadSTL}} slot="link" title={{t 'download_modal.download'}}> | ||
{{t 'download_modal.download'}} | ||
</calcite-link> | ||
</calcite-notice> | ||
{{else}} | ||
<calcite-loader | ||
label={{t "download_modal.wait"}} | ||
text={{t "download_modal.wait"}} | ||
scale="l" | ||
type="indeterminate" | ||
class="p-0" | ||
/> | ||
{{/if}} | ||
</div> | ||
<calcite-button {{on "click" @onHide}} slot="secondary" width="full" appearance="outline"> | ||
{{t "download_modal.close"}} | ||
</calcite-button> | ||
<calcite-button {{on "click" @downloadSTL}} loading={{not this.canDownload}} slot="primary" width="full"> | ||
{{t 'download_modal.download'}} | ||
</calcite-button> | ||
</calcite-modal> |
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,28 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
interface DownloadSTLModalArgs { | ||
onHide?: () => void; | ||
downloadSTL?: () => void; | ||
} | ||
|
||
const DOWNLOAD_WAIT_TIME = 5000; | ||
|
||
export default class DownloadSTLModal extends Component<DownloadSTLModalArgs> { | ||
@tracked _canDownload = false; | ||
|
||
get canDownload() { | ||
return this._canDownload; | ||
} | ||
|
||
constructor(owner: unknown, args: DownloadSTLModalArgs) { | ||
super(owner, args); | ||
setTimeout(() => (this._canDownload = true), DOWNLOAD_WAIT_TIME); | ||
} | ||
|
||
@action | ||
selectAll({ target }: { target: HTMLTextAreaElement }) { | ||
target.select(); | ||
} | ||
} |
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
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
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
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
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