Skip to content

Commit

Permalink
Add How-To video links
Browse files Browse the repository at this point in the history
  • Loading branch information
rgantzos committed Aug 26, 2024
1 parent 616bffd commit e2909dc
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 5 deletions.
1 change: 1 addition & 0 deletions extras/icons/external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions extras/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,4 +508,27 @@ span.new-feature-tag.beta {

.option-selection span:last-child {
border-inline-end: none;
}

/* Support */

.support-vid {
color: #ff9f00 !important;
opacity: .5;
cursor: pointer;
position: relative;
top: -.25rem;
margin-bottom: .25rem;
display: block;
}

.support-vid:hover {
opacity: 1;
}

.support-vid img {
height: 1rem;
margin-left: .25rem;
position: relative;
top: .3rem;
}
17 changes: 17 additions & 0 deletions extras/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,23 @@ async function getFeatures() {
languageData[feature.id + "/description"]?.message || feature.description;
div.appendChild(p);

if (feature.support?.yt) {
let span = document.createElement("span")
span.textContent = "How-To Video"
span.className = "support-vid"
span.dataset.url = feature.support.yt
span.addEventListener("click", function() {
let url = this.dataset.url
chrome.tabs.create({
url,
})
})
span.appendChild(Object.assign(document.createElement("img"), {
src: "/extras/icons/external.svg"
}))
div.appendChild(span)
}

if (feature.options) {
for (var optionPlace in feature.options) {
var option = feature.options[optionPlace];
Expand Down
20 changes: 20 additions & 0 deletions extras/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -887,4 +887,24 @@ body {

.option-selection span:last-child {
border-inline-end: none;
}
/* Support */

.support-vid {
color: #ff9f00 !important;
opacity: .5;
cursor: pointer;
position: relative;
top: -.25rem;
}

.support-vid:hover {
opacity: 1;
}

.support-vid img {
height: 1rem;
margin-left: .25rem;
position: relative;
top: .3rem;
}
5 changes: 4 additions & 1 deletion features/asset-size/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
],
"type": ["Editor"],
"dynamic": true,
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }]
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
"support": {
"yt": "https://youtu.be/gpH3VJvDTkc"
}
}

5 changes: 4 additions & 1 deletion features/chomp-blocks/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"tags": [],
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
"dynamic": true,
"type": ["Editor"]
"type": ["Editor"],
"support": {
"yt": "https://youtu.be/6sl-Q0ZYYyQ"
}
}
5 changes: 4 additions & 1 deletion features/custom-explore/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
}
]
}
]
],
"support": {
"yt": "https://youtu.be/QIWxCXrD2-M"
}
}
5 changes: 4 additions & 1 deletion features/more-editor-fonts/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"tags": ["New", "Featured"],
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
"styles": [{ "file": "style.css", "runOn": "/projects/*" }],
"resources": [{ "name": "more-text-icon", "path": "/text.svg" }]
"resources": [{ "name": "more-text-icon", "path": "/text.svg" }],
"support": {
"yt": "https://youtu.be/zh3zsjBcz_M"
}
}
5 changes: 4 additions & 1 deletion features/rotate-gradient/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"type": ["Editor"],
"dynamic": true,
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
"styles": [{ "file": "style.css", "runOn": "/projects/*" }]
"styles": [{ "file": "style.css", "runOn": "/projects/*" }],
"support": {
"yt": "https://youtu.be/5S032vWPvd0"
}
}

0 comments on commit e2909dc

Please sign in to comment.