October 22, 2024
Chicago 12, Melborne City, USA
HTML

Set `body` `background-color` programmatically in Svelte?

I’m making a site using Svelte and SvelteKit, and I’d like to use a predefined array of colors for styling in a normalized way– if I change one of the values later, everywhere that styles using that value will be updated later. // palette.js export const grays = [ 'hsl(240 3.7% 10.6%)', 'hsl(240 13% 18%)',

Read More
HTML

Unconditionally stop scraping HTML at specified element (or EOF)

I’m using Python lxml.html package to scrape an HTML file. The HTML I’m trying to scrape reads in part <h1>Description of DAB Ensemble 1</h1><table>Stuff I don't care about</table> <!-- Tags I don't care about --> <div id="announcement_data_block"> <h3>Announcement information</h3> <p>No announcement information is broadcast</p> </div> <!-- More tags I don't care about --> <h1>Description of

Read More
HTML

Adding component via TypeScript in Angular dynamically

I searched the internet for a solution but I can’t find one, either because some functions are deprecated or do not exist. I’m trying to automatically output dynamic text inside of a component, but I can’t figure it out. The component in question is structured like this: @Component({ selector: 'app-chat-bubble', standalone: true, imports: [], templateUrl:

Read More
HTML

Unconditionally stop scraping at specified element (or EOF)

I’m using Python lxml.html package to scrape an HTML file. The HTML I’m trying to scrape that reads in part <h1>Description of DAB Ensemble 1</h1><table>Stuff I don't care about</table> <!-- Tags I don't care about --> <div id="announcement_data_block> <h3>Announcement information</h3> <p>No announcement information is broadcast</p> </div> <!-- More tags I don't care about --> <h1>Description

Read More
HTML

Simple animation hangs on first page launch

I have a simple CSS ticker animation : <link rel="preload" href="../media/main/comissions_table_borderless_comp.svg" as="image" type="image/svg" fetchpriority="high"> <div class="table_container_container"> <div class="table_container"> <div class="table_content_1"> <img src="../media/main/comissions_table_borderless_comp.svg" alt="open for comissions"> <img src="../media/main/comissions_table_borderless_comp.svg" alt="open for comissions"> </div> <div class="table_content_2"> <img src="../media/main/comissions_table_borderless_comp.svg" alt="open for comissions"> <img src="../media/main/comissions_table_borderless_comp.svg" alt="open for comissions"> </div> </div> </div> .table_content_1, .table_content_2 { animation: ticker 5s infinite linear forwards;

Read More
HTML

regex for matching plain text in html works in small files but crashes in larger files in vscode

Im using this regex- >\s?([a-zA-Z0-9$&+,:;=?@#|'.\-^*()%!]+\s[a-zA-Z0-9$&+,:;=?@#|'.\-^*()%!]+)+\s?< seem to do exactly what i want but obviously very inefficient and ugly. I’m not trying to parse html so don’t come at me with that. For now will be used to search stuff in patch files using vscode. how can i improve this? You need to sign in to

Read More
HTML

How to hide a button with multiple forms in page?

I have an e-commerce page, in the page I have multiple forms each with a different name and id but every button has the same id and name., e.g; <form method="post" name="form12345" id="form12345" action="..."> <input type="button" class="btn-BuyOff" value="Acquista" id="addtocart" name="addtocart"> </form> How can I modify the visibility of the button in a specific form using

Read More
HTML

center div with text doesn't work when viewport gets narrow

I have a div (.quote) in which another div (.centered) should be centered inside the viewport (here simulated with anohter div). The text inside .centered should be left-aligned. The text has some predefined linebreaks, but should break on other words as well if necessary. .viewport { width: 440px; border: 1px solid red; } .quote {

Read More
HTML

Создание кастомного символа для моего сайта. CSS, fonts, symbols

Я видел синтаксис в HTML, где можно добавить символы в определённом синтаксисе, где &gt; – это >, &lt; – это <, и я хочу таким образом добавить свой собственный кастомный символ. Я очень долго искал информацию про создание кастомных символов с помощью font’ов, с помощью HTML-сущностей, в итоге я ничего не нашёл. Поисковики выдают инструкцию

Read More
HTML

How to dynamically set readonly property for based on value in Vue.js?

I wanted that in ‘change’ if the value of the input-number becomes equal to, for example, ‘5’ I wanted it to assign the readonly property or at least have the same behavior as the property in that input-number, as it is now it is not working <el-input-number v-model="q.values[a-1].value_numeric" :disabled="isParameterDisabled(q) || q.parameter.calculated" :readonly="isReadonly || isParameterReadonly(q)" :ref="'f_'+q.id+'_n'+a"

Read More