Skip to content

Instantly share code, notes, and snippets.

View AndyObtiva's full-sized avatar

Andy Maleh AndyObtiva

View GitHub Profile
require 'glimmer-dsl-web'
class HelloModal
include Glimmer::Web::Component
before_render do
@greeting_person = GreetingPerson.new
end
markup {
class GreetingModal
include Glimmer::Web::Component
attribute :greeting_target, default: 'World'
markup {
div(class: 'modal-outer') {
div(class: 'modal-inner') {
h2 { 'Greeting' }
GreetingPerson = Struct.new(:name, keyword_init: true)
class AddressTypeSelect
include Glimmer::Web::Component
attribute :address_types, default: []
attribute :selected_address_type
markup {
select { |select_element|
address_types.each do |address_type|
option(value: address_type) { address_type }
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES)
...
}
}
...
option :values, default: []
option :display_values
option :selected_values, default: []
option :locale, default: :en
option :translations, default: {}
option :selected_values_formatter, default: SELECTED_VALUES_FORMATTER_DEFAULT
option :width, default: 175
option :height, default: 40
option :margin, default: '0 15px 0 0'
option :text_align, default: :center
...
markup {
div {
...
multi_checkbox_dropdown(
values: SomePresenter::STATUS_FILTER_TYPES,
display_values: SomePresenter::STATUS_FILTER_TYPES.map(&:capitalize),
locale: I18n.locale,
width: 190,
translations: {
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES) {
selected_values <=> [@some_presenter, :status_filters]
}
...
}
}
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES) {
on_change do |selected_values|
# do something with selected_values
end
}
...

Glimmer Hangman Icon Glimmer Hangman 1.0.0

Gem Version

Hangman (word game) that runs on Mac, Windows, and Linux. Built with Ruby and Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library) using Application Scaffolding.

Implementation started at the RubyConf 2024 Hack Day Event for Glimmer DSL for LibUI, which was connected to the [RubyConf 2024 workshop "How To Build Basic Desktop Applicatio